- Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathsetup.py
More file actions
Latest commit
72 lines (58 loc) · 1.8 KB
/
Copy pathsetup.py
File metadata and controls
72 lines (58 loc) · 1.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
importcodecs
importos
importre
fromsetuptoolsimportsetup, find_packages, Command
here=os.path.abspath(os.path.dirname(__file__))
version='0.0.0'
changes=os.path.join(here, 'CHANGES.rst')
match=r'^#*\s*(?P<version>[0-9]+\.[0-9]+(\.[0-9]+)?)$'
withcodecs.open(changes, encoding='utf-8') aschanges:
forlineinchanges:
res=re.match(match, line)
ifres:
version=res.group('version')
break
# Get the long description
withcodecs.open(os.path.join(here, 'README.rst'), encoding='utf-8') asf:
long_description=f.read()
# Get version
withcodecs.open(os.path.join(here, 'CHANGES.rst'), encoding='utf-8') asf:
changelog=f.read()
install_requirements= []
tests_requirements= [
'pysimplemodel==0.15.0',
'pytest',
'pytest-cov',
]
classVersionCommand(Command):
description='print library version'
user_options= []
definitialize_options(self):
pass
deffinalize_options(self):
pass
defrun(self):
print(version)
setup(
name='preparer',
version=version,
description='Simple way to build a new dict based on fields declaration',
long_description=long_description,
url='https://github.com/allisson/python-preparer',
author='Allisson Azevedo',
author_email='allisson@gmail.com',
classifiers=[
'Development Status :: 3 - Alpha',
'Intended Audience :: Developers',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
'Topic :: Software Development :: Libraries',
],
packages=find_packages(exclude=['docs', 'tests*']),
setup_requires=['pytest-runner'],
install_requires=install_requirements,
tests_require=tests_requirements,
cmdclass={
'version': VersionCommand,
},
)