|
1 | 1 | import os |
2 | 2 | from setuptools import setup |
3 | 3 |
|
4 | | - |
5 | 4 | PACKAGE = "allure-robotframework" |
6 | | -VERSION = "2.8.6" |
7 | 5 |
|
8 | 6 | classifiers = [ |
9 | 7 | 'Development Status :: 5 - Production/Stable', |
|
15 | 13 | 'Topic :: Software Development :: Testing', |
16 | 14 | ] |
17 | 15 |
|
| 16 | +setup_requires = [ |
| 17 | + "setuptools_scm" |
| 18 | +] |
| 19 | + |
18 | 20 | install_requires = [ |
19 | | - "allure-python-commons==2.8.6", |
20 | 21 | ] |
21 | 22 |
|
22 | 23 |
|
23 | | -def read(fname): |
| 24 | +def prepare_version(): |
| 25 | + from setuptools_scm import get_version |
| 26 | + configuration = {"root": "..", "relative_to": __file__} |
| 27 | + version = get_version(**configuration) |
| 28 | + install_requires.append("allure-python-commons=={version}".format(version=version)) |
| 29 | + return configuration |
| 30 | + |
| 31 | + |
| 32 | +def get_readme(fname): |
24 | 33 | return open(os.path.join(os.path.dirname(__file__), fname)).read() |
25 | 34 |
|
26 | 35 |
|
27 | 36 | if __name__ == '__main__': |
28 | 37 | setup( |
29 | 38 | name=PACKAGE, |
30 | | - version=VERSION, |
| 39 | + use_scm_version=prepare_version, |
31 | 40 | description="Allure Robot Framework integration", |
32 | 41 | license="Apache-2.0", |
| 42 | + install_requires=install_requires, |
| 43 | + setup_requires=setup_requires, |
33 | 44 | keywords="allure reporting robotframework", |
34 | 45 | packages=['allure_robotframework', 'AllureLibrary'], |
35 | 46 | package_dir={"allure_robotframework": "src/listener", 'AllureLibrary': 'src/library'}, |
36 | | - install_requires=install_requires, |
37 | 47 | py_modules=['allure_robotframework'], |
38 | 48 | url="https://github.com/allure-framework/allure-python", |
39 | 49 | author="Sergey Khomutinin", |
40 | 50 | author_email="skhomuti@gmail.com", |
41 | | - long_description=read('README.rst'), |
| 51 | + long_description=get_readme('README.rst'), |
42 | 52 | classifiers=classifiers, |
43 | 53 | ) |
0 commit comments