Compare commits
70 commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e2740ed1a9 | ||
|
|
c03c733aa0 | ||
|
|
9d58431f1a | ||
|
|
3f93a03181 | ||
|
|
d6b0f69cfe | ||
|
|
897af3595d | ||
|
|
f9e7c202ed | ||
|
|
1e8175c602 | ||
|
|
d2dc56d8d4 | ||
|
|
da411b2d76 | ||
|
|
1a36473623 | ||
|
|
67e6ad6676 | ||
|
|
48ec580421 | ||
|
|
a92ed34374 | ||
|
|
702b5543cc | ||
|
|
81cdb51f11 | ||
|
|
dbbfbff7bc | ||
|
|
8e0a657130 | ||
|
|
187dd0741a | ||
|
|
a4061ddcd9 | ||
|
|
abebaf9097 | ||
|
|
5336f0422b | ||
|
|
c01753392a | ||
|
|
9084aea343 | ||
|
|
ae2a66c5fd | ||
|
|
6baa10940b | ||
|
|
cd229d0ae1 | ||
|
|
8b3f9ef982 | ||
|
|
da02fa840c | ||
|
|
8bba2e33db | ||
|
|
053b4acc1c | ||
|
|
9e37fb5d60 | ||
|
|
235ac21e82 | ||
|
|
fbc40ed423 | ||
|
|
f7a20f0ee9 | ||
|
|
ca3403d6c6 | ||
|
|
31acdc5cf9 | ||
|
|
fc8cd419b6 | ||
|
|
b31e51b49c | ||
|
|
cc2aa6486b | ||
|
|
bd7302602b | ||
|
|
fbfeffe64a | ||
|
|
a8735c515d | ||
|
|
abb0d64d30 | ||
|
|
5dbb7bfe98 | ||
|
|
30893d1af5 | ||
|
|
4a9312313e | ||
|
|
6f5ab59dcb | ||
|
|
494bd2292c | ||
|
|
3b847d6544 | ||
|
|
1f165faa22 | ||
|
|
c1cbc6360b | ||
|
|
852adefaf1 | ||
|
|
a831c8ae05 | ||
|
|
2c1040fc94 | ||
|
|
7e19ed35c9 | ||
|
|
4468aff4ac | ||
|
|
0766769819 | ||
|
|
550a57be65 | ||
|
|
52ab286b49 | ||
|
|
a2ba90b3ca | ||
|
|
7ec373f51a | ||
|
|
905ee4bbc9 | ||
|
|
4d8c3f1087 | ||
|
|
a927884187 | ||
|
|
dc7a418249 | ||
|
|
30fe1176a1 | ||
|
|
58b0aec05c | ||
|
|
422ddd3269 | ||
|
|
d73258a4d0 |
9 changed files with 486 additions and 21 deletions
10
.gitignore
vendored
Normal file
10
.gitignore
vendored
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
python-Levenshtein-0.10.1.tar.bz2
|
||||
/python-Levenshtein-0.12.0.tar.gz
|
||||
/Levenshtein-0.20.8.tar.gz
|
||||
/python-Levenshtein-0.21.0.tar.gz
|
||||
/Levenshtein-0.21.0.tar.gz
|
||||
/Levenshtein-0.23.0.tar.gz
|
||||
/Levenshtein-0.26.0.tar.gz
|
||||
/Levenshtein-0.26.1.tar.gz
|
||||
/Levenshtein-0.27.1.tar.gz
|
||||
/Levenshtein-0.27.3.tar.gz
|
||||
21
Makefile
21
Makefile
|
|
@ -1,21 +0,0 @@
|
|||
# Makefile for source rpm: python-Levenshtein
|
||||
# $Id$
|
||||
NAME := python-Levenshtein
|
||||
SPECFILE = $(firstword $(wildcard *.spec))
|
||||
|
||||
define find-makefile-common
|
||||
for d in common ../common ../../common ; do if [ -f $$d/Makefile.common ] ; then if [ -f $$d/CVS/Root -a -w $$/Makefile.common ] ; then cd $$d ; cvs -Q update ; fi ; echo "$$d/Makefile.common" ; break ; fi ; done
|
||||
endef
|
||||
|
||||
MAKEFILE_COMMON := $(shell $(find-makefile-common))
|
||||
|
||||
ifeq ($(MAKEFILE_COMMON),)
|
||||
# attept a checkout
|
||||
define checkout-makefile-common
|
||||
test -f CVS/Root && { cvs -Q -d $$(cat CVS/Root) checkout common && echo "common/Makefile.common" ; } || { echo "ERROR: I can't figure out how to checkout the 'common' module." ; exit -1 ; } >&2
|
||||
endef
|
||||
|
||||
MAKEFILE_COMMON := $(shell $(checkout-makefile-common))
|
||||
endif
|
||||
|
||||
include $(MAKEFILE_COMMON)
|
||||
149
changelog
Normal file
149
changelog
Normal file
|
|
@ -0,0 +1,149 @@
|
|||
* Fri Jul 21 2023 Fedora Release Engineering <releng@fedoraproject.org> - 0.12.0-25
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild
|
||||
|
||||
* Tue Jun 13 2023 Python Maint <python-maint@redhat.com> - 0.12.0-24
|
||||
- Rebuilt for Python 3.12
|
||||
|
||||
* Fri Jan 20 2023 Fedora Release Engineering <releng@fedoraproject.org> - 0.12.0-23
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild
|
||||
|
||||
* Fri Jul 22 2022 Fedora Release Engineering <releng@fedoraproject.org> - 0.12.0-22
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild
|
||||
|
||||
* Mon Jun 13 2022 Python Maint <python-maint@redhat.com> - 0.12.0-21
|
||||
- Rebuilt for Python 3.11
|
||||
|
||||
* Fri Jan 21 2022 Fedora Release Engineering <releng@fedoraproject.org> - 0.12.0-20
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild
|
||||
|
||||
* Fri Jul 23 2021 Fedora Release Engineering <releng@fedoraproject.org> - 0.12.0-19
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild
|
||||
|
||||
* Fri Jun 04 2021 Python Maint <python-maint@redhat.com> - 0.12.0-18
|
||||
- Rebuilt for Python 3.10
|
||||
|
||||
* Wed Jan 27 2021 Fedora Release Engineering <releng@fedoraproject.org> - 0.12.0-17
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
|
||||
|
||||
* Tue Jul 28 2020 Fedora Release Engineering <releng@fedoraproject.org> - 0.12.0-16
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
|
||||
|
||||
* Tue May 26 2020 Miro Hrončok <mhroncok@redhat.com> - 0.12.0-15
|
||||
- Rebuilt for Python 3.9
|
||||
|
||||
* Thu Jan 30 2020 Fedora Release Engineering <releng@fedoraproject.org> - 0.12.0-14
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
|
||||
|
||||
* Thu Oct 03 2019 Miro Hrončok <mhroncok@redhat.com> - 0.12.0-13
|
||||
- Rebuilt for Python 3.8.0rc1 (#1748018)
|
||||
|
||||
* Thu Aug 22 2019 Miro Hrončok <mhroncok@redhat.com> - 0.12.0-12
|
||||
- Subpackage python2-Levenshtein has been removed
|
||||
See https://fedoraproject.org/wiki/Changes/Mass_Python_2_Package_Removal
|
||||
|
||||
* Mon Aug 19 2019 Miro Hrončok <mhroncok@redhat.com> - 0.12.0-11
|
||||
- Rebuilt for Python 3.8
|
||||
|
||||
* Fri Jul 26 2019 Fedora Release Engineering <releng@fedoraproject.org> - 0.12.0-10
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
|
||||
|
||||
* Sat Feb 02 2019 Fedora Release Engineering <releng@fedoraproject.org> - 0.12.0-9
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
|
||||
|
||||
* Fri Jul 13 2018 Fedora Release Engineering <releng@fedoraproject.org> - 0.12.0-8
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
|
||||
|
||||
* Tue Jun 19 2018 Miro Hrončok <mhroncok@redhat.com> - 0.12.0-7
|
||||
- Rebuilt for Python 3.7
|
||||
|
||||
* Fri Feb 09 2018 Fedora Release Engineering <releng@fedoraproject.org> - 0.12.0-6
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
|
||||
|
||||
* Thu Aug 03 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.12.0-5
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild
|
||||
|
||||
* Thu Jul 27 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.12.0-4
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
|
||||
|
||||
* Sat Feb 11 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.12.0-3
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
|
||||
|
||||
* Mon Dec 19 2016 Miro Hrončok <mhroncok@redhat.com> - 0.12.0-2
|
||||
- Rebuild for Python 3.6
|
||||
|
||||
* Tue Sep 20 2016 Dominika Krejci <dkrejci@redhat.com> - 0.12.0-1
|
||||
- Update to 0.12.0
|
||||
- Add Python 3 subpackage
|
||||
|
||||
* Tue Jul 19 2016 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.10.1-23
|
||||
- https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages
|
||||
|
||||
* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 0.10.1-22
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
|
||||
|
||||
* Thu Jun 18 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.10.1-21
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
|
||||
|
||||
* Sun Aug 17 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.10.1-20
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild
|
||||
|
||||
* Mon Jun 30 2014 Toshio Kuratomi <toshio@fedoraproject.org> - 0.10.1-19
|
||||
- replace python-setuptools-devel BR with python-setuptools
|
||||
|
||||
* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.10.1-18
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
|
||||
|
||||
* Sun Aug 04 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.10.1-17
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
|
||||
|
||||
* Thu Feb 14 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.10.1-16
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild
|
||||
|
||||
* Sat Jul 21 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.10.1-15
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
|
||||
|
||||
* Sat Jan 14 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.10.1-14
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild
|
||||
|
||||
* Tue Feb 08 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.10.1-13
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
|
||||
|
||||
* Wed Jul 21 2010 David Malcolm <dmalcolm@redhat.com> - 0.10.1-12
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Features/Python_2.7/MassRebuild
|
||||
|
||||
* Fri Feb 19 2010 Dwayne Bailey <dwayne@translate.org.za> - 0.10.1-11
|
||||
- Proper fix to source URL
|
||||
|
||||
* Thu Feb 18 2010 Dwayne Bailey <dwayne@translate.org.za> - 0.10.1-10
|
||||
- Use python2-devel in BuildRequires
|
||||
- Updated source URL
|
||||
|
||||
* Sun Jul 26 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.10.1-9
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild
|
||||
|
||||
* Thu Feb 26 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.10.1-8
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild
|
||||
|
||||
* Sat Nov 29 2008 Ignacio Vazquez-Abrams <ivazqueznet+rpm@gmail.com> - 0.10.1-7
|
||||
- Rebuild for Python 2.6
|
||||
|
||||
* Tue Oct 21 2008 Dwayne Bailey <dwayne@translate.org.za> - 0.10.1-6
|
||||
- Comments about location of source files
|
||||
- Update genextdoc.py to v1.5
|
||||
|
||||
* Thu Mar 27 2008 Dwayne Bailey <dwayne@translate.org.za> - 0.10.1-5
|
||||
- Build and package *egg-info
|
||||
- Fix some rpmlint issues
|
||||
|
||||
* Thu Feb 14 2008 Dwayne Bailey <dwayne@translate.org.za> - 0.10.1-4
|
||||
- Add genextdoc.py as Source not Patch
|
||||
|
||||
* Wed Jan 30 2008 Dwayne Bailey <dwayne@translate.org.za> - 0.10.1-3
|
||||
- Some rpmlint fixes
|
||||
- Fix document generation
|
||||
|
||||
* Wed Jan 23 2008 Dwayne Bailey <dwayne@translate.org.za> - 0.10.1-2
|
||||
- Add missing genextdoc.py to generate usage documentation
|
||||
|
||||
* Wed Jan 23 2008 Dwayne Bailey <dwayne@translate.org.za> - 0.10.1-1
|
||||
- Initial packaging
|
||||
216
genextdoc.py
Normal file
216
genextdoc.py
Normal file
|
|
@ -0,0 +1,216 @@
|
|||
#!/usr/bin/env python
|
||||
# Simple Python extension module doc generator.
|
||||
# @(#) $Id: genextdoc.py,v 1.1 2008/10/30 05:13:27 dwayne Exp $
|
||||
# Written by Yeti <yeti@physics.muni.cz>
|
||||
# This program is in the public domain.
|
||||
import re, sys, types, inspect
|
||||
from cgi import escape as q
|
||||
|
||||
args = sys.argv
|
||||
args.pop(0)
|
||||
if not args:
|
||||
print 'Usage: genextdoc.py [--selfcontained] module_name'
|
||||
sys.exit(0)
|
||||
|
||||
selfcontained = False
|
||||
if args[0].startswith('-') and 'selfcontained'.startswith(args[0].strip('-')):
|
||||
selfcontained = True
|
||||
args.pop(0)
|
||||
if not args: sys.exit(0)
|
||||
modname = args.pop(0)
|
||||
plain_docs = args
|
||||
|
||||
html_head = """\
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
|
||||
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
|
||||
<head><title>%s %s</title></head>
|
||||
<body>
|
||||
"""
|
||||
|
||||
html_foot = """\
|
||||
</body>
|
||||
</html>
|
||||
"""
|
||||
|
||||
def split_para(doc):
|
||||
p = []
|
||||
for x in doc.split('\n\n'):
|
||||
x = x.strip()
|
||||
if x.find('\n>>>') > -1:
|
||||
h, t = x.split('\n>>>', 1)
|
||||
p.append(h)
|
||||
p.append('>>>' + t)
|
||||
else:
|
||||
p.append(x)
|
||||
return p
|
||||
|
||||
def get_doc(members):
|
||||
try: doc = members['__doc__']
|
||||
except KeyError: pass
|
||||
if doc: return doc
|
||||
try: doc = 'Python module %s' % members['__name__']
|
||||
except KeyError: pass
|
||||
if doc: return doc
|
||||
else: return 'A Python module'
|
||||
|
||||
def format_synopsis(synopsis, link=False, classname=None):
|
||||
lst = synopsis.split('\n')
|
||||
for i, s in zip(range(len(lst)), lst):
|
||||
m = re.match(r'(?P<func>\w+)(?P<args>.*)', s)
|
||||
args = re.sub(r'([a-zA-Z]\w+)', r'<var>\1</var>', m.group('args'))
|
||||
func = m.group('func')
|
||||
if link:
|
||||
if classname:
|
||||
func = '<a href="#%s-%s">%s</a>' % (classname, func, func)
|
||||
else:
|
||||
func = '<a href="#%s">%s</a>' % (func, func)
|
||||
lst[i] = func + args
|
||||
return '<br/>\n'.join(lst)
|
||||
|
||||
def format_para(p):
|
||||
if not p: return ''
|
||||
doc = ''
|
||||
if p.startswith('>>>'): doc += '<pre>\n%s\n</pre>\n' % q(p)
|
||||
else:
|
||||
if not re.search('^- ', p, re.M): doc += '<p>%s</p>\n' % q(p)
|
||||
else:
|
||||
p = re.split('(?m)^- ', p)
|
||||
if p[0]: doc += '<p>%s</p>\n' % q(p[0].strip())
|
||||
del p[0]
|
||||
doc += ('<ul>%s</ul>\n'
|
||||
% '\n'.join(['<li>%s</li>' % q(p.strip()) for p in p]))
|
||||
return doc
|
||||
|
||||
def preprocess_routine(name, doc):
|
||||
parts = split_para(doc)
|
||||
if parts: summary = parts.pop(0)
|
||||
else: summary = 'FIXME'
|
||||
if parts and re.match(r'\w+\(.*\)', parts[0]): synopsis = parts.pop(0)
|
||||
else: synopsis = name + '()'
|
||||
return {'synopsis': synopsis, 'summary': summary, 'details': parts}
|
||||
|
||||
def analyse(obj):
|
||||
members = obj.__dict__
|
||||
if inspect.isclass(obj):
|
||||
main_doc = preprocess_routine(obj.__name__, get_doc(members))
|
||||
bases = [x.__name__ for x in obj.__bases__]
|
||||
else:
|
||||
main_doc = split_para(get_doc(members))
|
||||
bases = []
|
||||
routines = {}
|
||||
classes = {}
|
||||
data = {}
|
||||
for name, m in members.items():
|
||||
if name.startswith('__'): continue
|
||||
try:
|
||||
mro = list(inspect.getmro(m))
|
||||
if mro[0] != m: continue
|
||||
except AttributeError: pass
|
||||
if inspect.isroutine(m):
|
||||
try: doc = m.__doc__
|
||||
except KeyError: pass
|
||||
if not doc: doc = 'FIXME'
|
||||
routines[name] = preprocess_routine(name, doc)
|
||||
continue
|
||||
if inspect.isclass(m):
|
||||
classes[name] = analyse(m)
|
||||
continue
|
||||
t = type(m)
|
||||
if t == types.IntType or t == types.StringType:
|
||||
data[name] = repr(m)
|
||||
else:
|
||||
data[name] = m.__doc__
|
||||
return {'name': obj.__name__, 'doc': main_doc, 'routines': routines,
|
||||
'classes': classes, 'data': data, 'bases': bases}
|
||||
|
||||
def format(tree, level, prefix=''):
|
||||
name = tree['name']
|
||||
if prefix: fullname = '%s-%s' % (prefix, name)
|
||||
else: fullname = name
|
||||
##### Main doc
|
||||
doc = []
|
||||
if level > 1:
|
||||
doc = ['<h%d id="%s">' % (level, fullname)]
|
||||
try: doc.append(format_synopsis(tree['doc']['synopsis']))
|
||||
except TypeError:
|
||||
doc.append(name)
|
||||
doc.append('</h%d>\n' % level)
|
||||
if tree.has_key('bases'):
|
||||
doc.append('<p>Bases: %s.</p>\n' % ', '.join(tree['bases']))
|
||||
try: lst = [tree['doc']['summary']] + tree['doc']['details']
|
||||
except TypeError: lst = tree['doc']
|
||||
for p in lst: doc.append(format_para(p))
|
||||
##### Table of contents
|
||||
routines = tree['routines'].keys()
|
||||
classes = tree['classes'].keys()
|
||||
data = tree['data'].keys()
|
||||
if routines:
|
||||
routines.sort()
|
||||
if level == 1: doc.append('<p><b>Functions:</b></p>\n')
|
||||
else: doc.append('<p><b>Methods:</b></p>\n')
|
||||
doc.append('<ul class="ltoc">\n')
|
||||
for r in routines:
|
||||
synopsis = tree['routines'][r]['synopsis']
|
||||
doc.append('<li>%s</li>\n' % format_synopsis(synopsis, True,
|
||||
fullname))
|
||||
doc.append('</ul>\n')
|
||||
if classes:
|
||||
classes.sort()
|
||||
doc.append('<p><b>Classes:</b></p>\n')
|
||||
doc.append('<ul class="ltoc">\n')
|
||||
for r in classes:
|
||||
synopsis = tree['classes'][r]['doc']['synopsis']
|
||||
doc.append('<li>%s</li>\n' % format_synopsis(synopsis, True,
|
||||
fullname))
|
||||
doc.append('</ul>\n')
|
||||
if data:
|
||||
data.sort()
|
||||
doc.append('<p><b>Data:</b></p>\n')
|
||||
doc.append('<ul class="ltoc">\n')
|
||||
for r in data:
|
||||
doc.append('<li>%s = %s</li>\n' % (r, q(tree['data'][r])))
|
||||
doc.append('</ul>\n')
|
||||
##### Functions
|
||||
if routines:
|
||||
if level == 1: doc.append('<hr/>\n')
|
||||
doc.append('<dl>\n')
|
||||
for r in routines:
|
||||
doc.append('<dt id="%s-%s">' % (fullname, r))
|
||||
rt = tree['routines'][r]
|
||||
doc.append('%s</dt>\n<dd>' % format_synopsis(rt['synopsis']))
|
||||
for p in [rt['summary']] + rt['details']:
|
||||
doc.append(format_para(p))
|
||||
doc.append('</dd>\n')
|
||||
doc.append('</dl>\n')
|
||||
##### Classes
|
||||
if classes:
|
||||
for r in classes:
|
||||
doc.append('<hr/>\n')
|
||||
doc.append(format(tree['classes'][r], level+1, fullname))
|
||||
return ''.join(doc)
|
||||
|
||||
exec 'import %s as __test__' % modname
|
||||
doctree = analyse(__test__)
|
||||
document = format(doctree, 1)
|
||||
print modname + '.html'
|
||||
fh = file(modname + '.html', 'w')
|
||||
if selfcontained: fh.write(html_head % (modname, 'module API'))
|
||||
fh.write(document)
|
||||
if selfcontained: fh.write(html_foot)
|
||||
fh.close()
|
||||
for f in plain_docs:
|
||||
try: fh = file(f, 'r')
|
||||
except: continue
|
||||
document = fh.read()
|
||||
fh.close()
|
||||
print f + '.xhtml'
|
||||
fh = file(f + '.xhtml', 'w')
|
||||
if selfcontained: fh.write(html_head % (modname, f))
|
||||
fh.write('<h1>%s %s</h1>\n\n' % (modname, f))
|
||||
fh.write('<pre class="main">\n')
|
||||
fh.write(document)
|
||||
fh.write('</pre>\n')
|
||||
if selfcontained: fh.write(html_foot)
|
||||
fh.close()
|
||||
26
levenshtein-0.20.8-cython-0.29.patch
Normal file
26
levenshtein-0.20.8-cython-0.29.patch
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
diff --git a/_custom_build/backend.py b/_custom_build/backend.py
|
||||
index 08c3c06..43b0b22 100644
|
||||
--- a/_custom_build/backend.py
|
||||
+++ b/_custom_build/backend.py
|
||||
@@ -36,7 +36,7 @@ def _ninja_required():
|
||||
|
||||
return True
|
||||
|
||||
-def get_requires_for_build_wheel(self, config_settings=None):
|
||||
+def get_requires_for_build_wheel(config_settings=None):
|
||||
packages = []
|
||||
if _cmake_required():
|
||||
packages.append('cmake')
|
||||
diff --git a/pyproject.toml b/pyproject.toml
|
||||
index 88df1c3..8ff41bb 100644
|
||||
--- a/pyproject.toml
|
||||
+++ b/pyproject.toml
|
||||
@@ -2,7 +2,7 @@
|
||||
requires = [
|
||||
"setuptools",
|
||||
"scikit-build>=0.13.0",
|
||||
- "Cython>=3.0.0a11"
|
||||
+ "Cython>=0.29.26"
|
||||
]
|
||||
build-backend = "backend"
|
||||
backend-path = ["_custom_build"]
|
||||
12
levenshtein-0.27.1-cython-cpp.patch
Normal file
12
levenshtein-0.27.1-cython-cpp.patch
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
diff -up a/src/Levenshtein/CMakeLists.txt b/src/Levenshtein/CMakeLists.txt
|
||||
--- a/src/Levenshtein/CMakeLists.txt 2026-01-10 17:00:11.456685025 -0500
|
||||
+++ b/src/Levenshtein/CMakeLists.txt 2026-01-10 17:00:37.252954218 -0500
|
||||
@@ -9,7 +9,7 @@ function(create_cython_target _name)
|
||||
MAIN_DEPENDENCY "${CMAKE_CURRENT_LIST_DIR}/${_name}.pyx"
|
||||
VERBATIM
|
||||
COMMAND
|
||||
- Python::Interpreter -m cython "${CMAKE_CURRENT_LIST_DIR}/${_name}.pyx"
|
||||
+ Python::Interpreter -m cython --cplus "${CMAKE_CURRENT_LIST_DIR}/${_name}.pyx"
|
||||
--output-file "${CMAKE_CURRENT_BINARY_DIR}/${_name}.cxx")
|
||||
|
||||
set(${_name}
|
||||
72
python-Levenshtein.spec
Normal file
72
python-Levenshtein.spec
Normal file
|
|
@ -0,0 +1,72 @@
|
|||
%global srcname Levenshtein
|
||||
|
||||
%global forgeurl https://github.com/rapidfuzz/%{srcname}
|
||||
Version: 0.27.3
|
||||
%forgemeta
|
||||
|
||||
Name: python-%{srcname}
|
||||
Summary: Python extension computing string distances and similarities
|
||||
Release: %{autorelease}
|
||||
|
||||
License: GPL-2.0-or-later
|
||||
|
||||
# Levenshtein is the latest name of the package, though the python-Levenshtein repo
|
||||
# is still being kept up-to-date in lock-step to this official upstream.
|
||||
URL: %{forgeurl}
|
||||
|
||||
Source0: %{forgesource}
|
||||
Patch0: levenshtein-0.27.1-cython-cpp.patch
|
||||
|
||||
BuildRequires: cmake
|
||||
BuildRequires: gcc
|
||||
BuildRequires: gcc-c++
|
||||
BuildRequires: python3-devel
|
||||
BuildRequires: python3-pytest
|
||||
BuildRequires: rapidfuzz-cpp-static
|
||||
|
||||
%global _description %{expand:
|
||||
Levenshtein computes Levenshtein distances, similarity ratios, generalized
|
||||
medians and set medians of Strings and Unicodes.}
|
||||
|
||||
%description %_description
|
||||
|
||||
%package -n python3-%{srcname}
|
||||
|
||||
Summary: %{summary}
|
||||
|
||||
%description -n python3-%{srcname} %_description
|
||||
|
||||
%prep
|
||||
%autosetup -n %{srcname}-%{version} -p1
|
||||
# Remove Cython's upper constraint
|
||||
sed -i '/Cython>=3\.[0-9]\+\./s/,\s*<3\.[0-9]\+\.[0-9a-z]*[0-9]*//' pyproject.toml
|
||||
|
||||
# Open up the rapidfuzz version constraint.
|
||||
sed -i 's/rapidfuzz 3.2.0/rapidfuzz 3.2...<4/' CMakeLists.txt
|
||||
|
||||
%generate_buildrequires
|
||||
%pyproject_buildrequires
|
||||
|
||||
|
||||
%build
|
||||
# To avoid empty debugsourcefiles.list, we need to build the package
|
||||
# with RelWithDebInfo
|
||||
# Upstream issue: https://github.com/scikit-build/scikit-build-core/issues/915
|
||||
export SKBUILD_CMAKE_BUILD_TYPE=RelWithDebInfo
|
||||
%pyproject_wheel
|
||||
|
||||
%install
|
||||
%pyproject_install
|
||||
%pyproject_save_files %{srcname}
|
||||
|
||||
%check
|
||||
%pyproject_check_import
|
||||
%pytest
|
||||
|
||||
%files -n python3-%{srcname} -f %{pyproject_files}
|
||||
%doc README.md
|
||||
%license LICENSE
|
||||
|
||||
|
||||
%changelog
|
||||
%{autochangelog}
|
||||
1
sources
1
sources
|
|
@ -0,0 +1 @@
|
|||
SHA512 (Levenshtein-0.27.3.tar.gz) = 1102d6421066ea59c821416d80eec99044fd574659db2e063a5564249afddac097e740788b8d0f5c1c3c72c1a4d3ae94f027ac8609f5ad1cadde378aaee9bf43
|
||||
Loading…
Add table
Add a link
Reference in a new issue