Skip to content

Commit 4c7c87c

Browse files
authored
auto-version (via allure-framework#457)
1 parent 53f203a commit 4c7c87c

File tree

10 files changed

+78
-34
lines changed

10 files changed

+78
-34
lines changed

allure-behave/setup.py

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
from setuptools import setup
33

44
PACKAGE = "allure-behave"
5-
VERSION = "2.8.6"
65

76
classifiers = [
87
'Development Status :: 5 - Production/Stable',
@@ -18,30 +17,42 @@
1817
'Programming Language :: Python :: 3.7',
1918
]
2019

20+
setup_requires = [
21+
"setuptools_scm"
22+
]
23+
2124
install_requires = [
2225
"behave>=1.2.5",
23-
"allure-python-commons==2.8.6"
2426
]
2527

2628

27-
def read(fname):
29+
def prepare_version():
30+
from setuptools_scm import get_version
31+
configuration = {"root": "..", "relative_to": __file__}
32+
version = get_version(**configuration)
33+
install_requires.append("allure-python-commons=={version}".format(version=version))
34+
return configuration
35+
36+
37+
def get_readme(fname):
2838
return open(os.path.join(os.path.dirname(__file__), fname)).read()
2939

3040

3141
def main():
3242
setup(
3343
name=PACKAGE,
34-
version=VERSION,
44+
use_scm_version=prepare_version,
3545
description="Allure behave integration",
3646
url="https://github.com/allure-framework/allure-python",
3747
author="QAMetaSoftware, Stanislav Seliverstov",
3848
author_email="sseliverstov@qameta.io",
3949
license="Apache-2.0",
4050
classifiers=classifiers,
4151
keywords="allure reporting behave",
42-
long_description=read('README.rst'),
52+
long_description=get_readme('README.rst'),
4353
packages=["allure_behave"],
4454
package_dir={"allure_behave": "src"},
55+
setup_requires=setup_requires,
4556
install_requires=install_requires
4657
)
4758

allure-behave/tox.ini

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ setenv =
1111
ALLURE_INDENT_OUTPUT=yep
1212

1313
deps=
14-
{distshare}/allure-python-commons-2*.zip
15-
{distshare}/allure-python-commons-test-2*.zip
14+
{distshare}/allure-python-commons-test-?.*.zip
15+
{distshare}/allure-python-commons-?.*.zip
1616

1717
whitelist_externals =
1818
rm

allure-pytest-bdd/setup.py

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
from setuptools import setup
33

44
PACKAGE = "allure-pytest-bdd"
5-
VERSION = "2.8.6b"
65

76
classifiers = [
87
'Development Status :: 5 - Production/Stable',
@@ -13,33 +12,45 @@
1312
'Topic :: Software Development :: Testing',
1413
]
1514

15+
setup_requires = [
16+
"setuptools_scm"
17+
]
18+
1619
install_requires = [
1720
"pytest>=4.5.0",
1821
"pytest-bdd>=3.0.0",
1922
"six>=1.9.0",
20-
"allure-python-commons==2.8.6"
2123
]
2224

2325

24-
def read(fname):
26+
def prepare_version():
27+
from setuptools_scm import get_version
28+
configuration = {"root": "..", "relative_to": __file__}
29+
version = get_version(**configuration)
30+
install_requires.append("allure-python-commons=={version}".format(version=version))
31+
return configuration
32+
33+
34+
def get_readme(fname):
2535
return open(os.path.join(os.path.dirname(__file__), fname)).read()
2636

2737

2838
def main():
2939
setup(
3040
name=PACKAGE,
31-
version=VERSION,
41+
use_scm_version=prepare_version,
3242
description="Allure pytest-bdd integration",
3343
url="https://github.com/allure-framework/allure-python",
3444
author="QAMetaSoftware, Stanislav Seliverstov",
3545
author_email="sseliverstov@qameta.io",
3646
license="Apache-2.0",
3747
classifiers=classifiers,
3848
keywords="allure reporting pytest",
39-
long_description=read('README.rst'),
49+
long_description=get_readme('README.rst'),
4050
packages=["allure_pytest_bdd"],
4151
package_dir={"allure_pytest_bdd": "src"},
4252
entry_points={"pytest11": ["allure_pytest_bdd = allure_pytest_bdd.plugin"]},
53+
setup_requires=setup_requires,
4354
install_requires=install_requires
4455
)
4556

allure-pytest-bdd/tox.ini

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ setenv = ALLURE_INDENT_OUTPUT=yep
99

1010
deps =
1111
mock
12-
{distshare}/allure-python-commons-2*.zip
13-
{distshare}/allure-python-commons-test-2*.zip
12+
{distshare}/allure-python-commons-test-?.*.zip
13+
{distshare}/allure-python-commons-?.*.zip
1414

1515
commands =
1616
py.test --basetemp={envtmpdir}/tmp \

allure-pytest/setup.py

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
pass
1515

1616
PACKAGE = "allure-pytest"
17-
VERSION = "2.8.6"
1817

1918
classifiers = [
2019
'Development Status :: 5 - Production/Stable',
@@ -25,32 +24,45 @@
2524
'Topic :: Software Development :: Testing',
2625
]
2726

27+
setup_requires = [
28+
"setuptools_scm"
29+
]
30+
31+
2832
install_requires = [
2933
"pytest>=4.5.0",
3034
"six>=1.9.0",
31-
"allure-python-commons==2.8.6"
3235
]
3336

3437

35-
def read(fname):
38+
def prepare_version():
39+
from setuptools_scm import get_version
40+
configuration = {"root": "..", "relative_to": __file__}
41+
version = get_version(**configuration)
42+
install_requires.append("allure-python-commons=={version}".format(version=version))
43+
return configuration
44+
45+
46+
def get_readme(fname):
3647
return open(os.path.join(os.path.dirname(__file__), fname)).read()
3748

3849

3950
def main():
4051
setup(
4152
name=PACKAGE,
42-
version=VERSION,
53+
use_scm_version=prepare_version,
4354
description="Allure pytest integration",
4455
url="https://github.com/allure-framework/allure-python",
4556
author="QAMetaSoftware, Stanislav Seliverstov",
4657
author_email="sseliverstov@qameta.io",
4758
license="Apache-2.0",
4859
classifiers=classifiers,
4960
keywords="allure reporting pytest",
50-
long_description=read('README.rst'),
61+
long_description=get_readme('README.rst'),
5162
packages=["allure_pytest"],
5263
package_dir={"allure_pytest": "src"},
5364
entry_points={"pytest11": ["allure_pytest = allure_pytest.plugin"]},
65+
setup_requires=setup_requires,
5466
install_requires=install_requires
5567
)
5668

allure-pytest/tox.ini

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ passenv = HOME
1212
setenv = ALLURE_INDENT_OUTPUT=yep
1313

1414
deps =
15-
{distshare}/allure-python-commons-2*.zip
16-
{distshare}/allure-python-commons-test-2*.zip
15+
{distshare}/allure-python-commons-test-?.*.zip
16+
{distshare}/allure-python-commons-?.*.zip
1717
pyhamcrest
1818
mock
1919

allure-python-commons-test/setup.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
from setuptools import setup
22

33
PACKAGE = "allure-python-commons-test"
4-
VERSION = "2.8.6"
54

65
install_requires = [
76
"pyhamcrest>=1.9.0",
@@ -12,7 +11,8 @@
1211
def main():
1312
setup(
1413
name=PACKAGE,
15-
version=VERSION,
14+
use_scm_version={"root": "..", "relative_to": __file__},
15+
setup_requires=['setuptools_scm'],
1616
description="Common module for self-testing allure integrations with python-based frameworks",
1717
url="https://github.com/allure-framework/allure-python",
1818
author="QAMetaSoftware, Stanislav Seliverstov",

allure-python-commons/setup.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
from setuptools import setup
22

33
PACKAGE = "allure-python-commons"
4-
VERSION = "2.8.6"
54

65
classifiers = [
76
'Development Status :: 5 - Production/Stable',
@@ -22,7 +21,8 @@
2221
def main():
2322
setup(
2423
name=PACKAGE,
25-
version=VERSION,
24+
use_scm_version={"root": "..", "relative_to": __file__},
25+
setup_requires=['setuptools_scm'],
2626
description="Common module for integrate allure with python-based frameworks",
2727
url="https://github.com/allure-framework/allure-python",
2828
author="QAMetaSoftware, Stanislav Seliverstov",

allure-robotframework/setup.py

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
import os
22
from setuptools import setup
33

4-
54
PACKAGE = "allure-robotframework"
6-
VERSION = "2.8.6"
75

86
classifiers = [
97
'Development Status :: 5 - Production/Stable',
@@ -15,29 +13,41 @@
1513
'Topic :: Software Development :: Testing',
1614
]
1715

16+
setup_requires = [
17+
"setuptools_scm"
18+
]
19+
1820
install_requires = [
19-
"allure-python-commons==2.8.6",
2021
]
2122

2223

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):
2433
return open(os.path.join(os.path.dirname(__file__), fname)).read()
2534

2635

2736
if __name__ == '__main__':
2837
setup(
2938
name=PACKAGE,
30-
version=VERSION,
39+
use_scm_version=prepare_version,
3140
description="Allure Robot Framework integration",
3241
license="Apache-2.0",
42+
install_requires=install_requires,
43+
setup_requires=setup_requires,
3344
keywords="allure reporting robotframework",
3445
packages=['allure_robotframework', 'AllureLibrary'],
3546
package_dir={"allure_robotframework": "src/listener", 'AllureLibrary': 'src/library'},
36-
install_requires=install_requires,
3747
py_modules=['allure_robotframework'],
3848
url="https://github.com/allure-framework/allure-python",
3949
author="Sergey Khomutinin",
4050
author_email="skhomuti@gmail.com",
41-
long_description=read('README.rst'),
51+
long_description=get_readme('README.rst'),
4252
classifiers=classifiers,
4353
)

allure-robotframework/tox.ini

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ setenv =
1010
TEST_TMP={envtmpdir}
1111

1212
deps =
13-
{distshare}/allure-python-commons-2*.zip
14-
{distshare}/allure-python-commons-test-2*.zip
13+
{distshare}/allure-python-commons-test-?.*.zip
14+
{distshare}/allure-python-commons-?.*.zip
1515
robotframework
1616
robotframework-pabot
1717
docutils

0 commit comments

Comments
 (0)