Skip to content

Commit 7f3b98e

Browse files
committed
Move to setup.cfg declarative style
Closes #204 Signed-off-by: Sylvain Hellegouarch <sh@defuze.org>
1 parent dc77f78 commit 7f3b98e

File tree

5 files changed

+105
-96
lines changed

5 files changed

+105
-96
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@
44

55
[Unreleased]: https://github.com/chaostoolkit/chaostoolkit-lib/compare/1.17.0...HEAD
66

7+
### Changed
8+
9+
- Moved from setup.py to declarative setup.cfg [#204][204]
10+
11+
[204]: https://github.com/chaostoolkit/chaostoolkit-lib/issues/204
12+
713
## [1.17.0][] - 2021-02-15
814

915
[1.17.0]: https://github.com/chaostoolkit/chaostoolkit-lib/compare/1.16.0...1.17.0

pyproject.toml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
[build-system]
2+
requires = [
3+
"setuptools>=34.4",
4+
"wheel",
5+
"setuptools_scm>=1.15",
6+
"setuptools_scm_git_archive>=1.0",
7+
]
8+
build-backend = "setuptools.build_meta"

requirements-dev.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ pytest~=5.0; python_version < '3.6'
55
pytest~=6.2; python_version >= '3.6'
66
pytest-cov
77
pytest-sugar
8-
ply==3.4
9-
pyhcl>=0.2.1,<0.3.0
8+
ply
9+
pyhcl
1010
hvac
1111
jsonpath2
1212
chardet

setup.cfg

Lines changed: 84 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,91 @@
22
release = sdist bdist_wheel
33
test = pytest
44

5-
[wheel]
6-
universal = 0
5+
[bdist_wheel]
6+
universal = 1
77

88
[metadata]
9-
license_file = LICENSE
9+
name = chaoslib
10+
url = https://chaostoolkit.org
11+
project_urls =
12+
Docs: RTD = https://docs.chaostoolkit.org
13+
CI: GitHub = https://github.com/chaostoolkit/chaostoolkit-lib/actions
14+
GitHub: issues = https://github.com/chaostoolkit/chaostoolkit-lib/issues
15+
GitHub: repo = https://github.com/chaostoolkit/chaostoolkit-lib
16+
description = Chaos Toolkit core library
17+
long_description = file: README.md
18+
long_description_content_type = text/markdown
19+
author = Chaos Toolkit
20+
author_email = contact@chaostoolkit.org
21+
zip_safe = False
22+
platforms = any
23+
license = Apache License Version 2.0
24+
classifiers =
25+
Development Status :: 5 - Production/Stable
26+
Intended Audience :: Developers
27+
License :: Freely Distributable
28+
License :: OSI Approved :: Apache Software License
29+
Operating System :: OS Independent
30+
Programming Language :: Python
31+
Programming Language :: Python :: 3
32+
Programming Language :: Python :: 3.5
33+
Programming Language :: Python :: 3.6
34+
Programming Language :: Python :: 3.7
35+
Programming Language :: Python :: 3.8
36+
Programming Language :: Python :: Implementation
37+
Programming Language :: Python :: Implementation :: CPython
38+
39+
[options]
40+
use_scm_version = True
41+
python_requires = >=3.5
42+
packages = find:
43+
include_package_data = True
44+
setup_requires =
45+
pytest_runner
46+
setuptools_scm>=1.15.0
47+
setuptools_scm_git_archive>=1.0
48+
install_require =
49+
logzero~=1.5
50+
requests~=2.21
51+
pyyaml~=5.3; python_version < '3.6'
52+
pyyaml~=5.4; python_version >= '3.6'
53+
contextvars;python_version<"3.7"
54+
importlib-metadata~=1.2.0; python_version < '3.8'
55+
tests_require =
56+
requests-mock
57+
coverage
58+
pycodestyle
59+
pytest~=5.0; python_version < '3.6'
60+
pytest~=6.2; python_version >= '3.6'
61+
pytest-cov
62+
pytest-sugar
63+
ply
64+
pyhcl
65+
hvac
66+
jsonpath2
67+
chardet
68+
69+
70+
[options.extras_require]
71+
vault = hvac>=0.7.2
72+
jsonpath = jsonpath2>=0.2.1
73+
decoders = cchardet>=2.1.4; chardet>=3.0.4
74+
75+
76+
[tool:pytest]
77+
testpaths = tests
78+
79+
python_files =
80+
test_*.py
81+
*_test.py
82+
tests.py
83+
addopts =
84+
-v
85+
-rxs
86+
--cov chaoslib
87+
--cov-report term-missing:skip-covered
88+
--cov-report xml
89+
-p no:warnings
1090

1191
[pycodestyle]
12-
ignore = E402,E126,E127,C901
92+
ignore = E402,E126,E127,C901

setup.py

Lines changed: 5 additions & 90 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,8 @@
11
#!/usr/bin/env python
22
"""chaostoolkit core library builder and installer"""
3-
4-
import sys
53
import os.path
6-
import io
74

8-
import setuptools
5+
from setuptools import setup
96

107

118
def get_version_from_package() -> str:
@@ -21,91 +18,9 @@ def get_version_from_package() -> str:
2118
version = version.replace("'", "").strip()
2219
return version
2320

24-
name = 'chaostoolkit-lib'
25-
desc = 'Chaos engineering toolkit core library'
26-
27-
with io.open('README.md', encoding='utf-8') as strm:
28-
long_desc = strm.read()
29-
30-
classifiers = [
31-
'Development Status :: 4 - Beta',
32-
'Intended Audience :: Developers',
33-
'License :: Freely Distributable',
34-
'Operating System :: OS Independent',
35-
'License :: OSI Approved :: Apache Software License',
36-
'Programming Language :: Python',
37-
'Programming Language :: Python :: 3',
38-
'Programming Language :: Python :: 3.5',
39-
'Programming Language :: Python :: 3.6',
40-
'Programming Language :: Python :: 3.7',
41-
'Programming Language :: Python :: 3.8',
42-
'Programming Language :: Python :: Implementation',
43-
'Programming Language :: Python :: Implementation :: CPython',
44-
'Topic :: System :: Distributed Computing'
45-
]
46-
author = 'chaostoolkit Team'
47-
author_email = 'contact@chaostoolkit.org'
48-
url = 'http://chaostoolkit.org'
49-
license = 'Apache License 2.0'
50-
packages = [
51-
'chaoslib',
52-
'chaoslib.discovery',
53-
'chaoslib.provider',
54-
'chaoslib.control'
55-
]
56-
57-
needs_pytest = set(['pytest', 'test']).intersection(sys.argv)
58-
pytest_runner = ['pytest_runner'] if needs_pytest else []
59-
test_require = []
60-
with io.open('requirements-dev.txt') as f:
61-
test_require = [l.strip() for l in f if not l.startswith('#')]
62-
63-
install_require = []
64-
with io.open('requirements.txt') as f:
65-
install_require = [l.strip() for l in f if not l.startswith('#')]
66-
67-
install_require.append(
68-
'contextvars;python_version<"3.7"'
69-
)
70-
71-
extras_require = {
72-
"vault": [
73-
"hvac>=0.7.2"
74-
],
75-
"jsonpath": [
76-
"jsonpath2>=0.2.1"
77-
],
78-
"decoders": [
79-
"cchardet>=2.1.4",
80-
"chardet>=3.0.4"
81-
]
82-
}
83-
84-
setup_params = dict(
85-
name=name,
86-
version=get_version_from_package(),
87-
description=desc,
88-
long_description=long_desc,
89-
long_description_content_type='text/markdown',
90-
classifiers=classifiers,
91-
author=author,
92-
author_email=author_email,
93-
url=url,
94-
license=license,
95-
packages=packages,
96-
include_package_data=True,
97-
install_requires=install_require,
98-
tests_require=test_require,
99-
setup_requires=pytest_runner,
100-
extras_require=extras_require,
101-
python_requires='>=3.5.*'
102-
)
103-
104-
105-
def main():
106-
"""Package installation entry point."""
107-
setuptools.setup(**setup_params)
108-
10921

11022
if __name__ == '__main__':
111-
main()
23+
setup(
24+
name="chaostoolkit-lib",
25+
version=get_version_from_package()
26+
)

0 commit comments

Comments
 (0)