Skip to content

Commit cfbb868

Browse files
authored
Merge pull request #283 from k4black/setup-fix
🛠 Setup files refactor
2 parents a374301 + a93b11e commit cfbb868

File tree

4 files changed

+68
-77
lines changed

4 files changed

+68
-77
lines changed

pyproject.toml

+9
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
[build-system]
2+
requires = [
3+
"setuptools >= 39.2.0",
4+
"wheel >= 0.29.0",
5+
]
6+
build-backend = 'setuptools.build_meta'
7+
8+
9+
# TODO: move configuration to setup.cfg when available
110
[tool.isort]
211
multi_line_output = 3
312
include_trailing_comma = true

setup.cfg

+58-3
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,67 @@
11
[metadata]
2+
name = python-jose
23
version = attr: jose.__version__
4+
description = JOSE implementation in Python
5+
long_description = file: README.rst
6+
url = http://github.com/mpdavis/python-jose
7+
keywords = jose jws jwe jwt json web token security signing
8+
author = Michael Davis
9+
author_email = [email protected]
10+
license = MIT
11+
project_urls=
12+
Documentation = https://python-jose.readthedocs.io/en/latest/
13+
Source = https://github.com/mpdavis/python-jose/
14+
Tracker = https://github.com/mpdavis/python-jose/issues/
15+
Changelog = https://github.com/mpdavis/python-jose/blob/master/CHANGELOG.md
16+
classifiers =
17+
Development Status :: 5 - Production/Stable
18+
Intended Audience :: Developers
19+
Natural Language :: English
20+
License :: OSI Approved :: MIT License
21+
Programming Language :: Python
22+
Programming Language :: Python :: 3
23+
Programming Language :: Python :: 3 :: Only
24+
Programming Language :: Python :: 3.6
25+
Programming Language :: Python :: 3.7
26+
Programming Language :: Python :: 3.8
27+
Programming Language :: Python :: 3.9
28+
Programming Language :: Python :: 3.10
29+
Programming Language :: Python :: Implementation :: PyPy
30+
Topic :: Utilities
31+
32+
33+
[options]
34+
packages = find:
35+
install_requires =
36+
ecdsa != 0.15
37+
rsa >=4.0, <5.0, !=4.4, !=4.1.1
38+
pyasn1 >=0.4.1, <0.5.0
39+
40+
[options.extras_require]
41+
test =
42+
pytest
43+
pytest-cov
44+
cryptography =
45+
cryptography >=3.4.0
46+
pycrypto =
47+
pycrypto >=2.6.0, <2.7.0
48+
pycryptodome =
49+
pycryptodome >=3.3.1, <4.0.0
50+
51+
[options.packages.find]
52+
exclude =
53+
tests*
354

4-
[flake8]
5-
max-line-length = 120
6-
ignore = E203,W503
755

856
[wheel]
957
universal = 1
58+
[bdist_wheel]
59+
universal = 1
60+
61+
62+
[flake8]
63+
max-line-length = 120
64+
ignore = E203,W503
1065

1166
[aliases]
1267
test=pytest

setup.py

+1-73
Original file line numberDiff line numberDiff line change
@@ -1,77 +1,5 @@
11
#!/usr/bin/env python
2-
import os
3-
from pathlib import Path
4-
52
from setuptools import setup
63

7-
import jose # noqa: F401
8-
9-
long_description = (Path(__file__).parent / "README.rst").read_text()
10-
11-
12-
def get_packages(package):
13-
"""
14-
Return root package and all sub-packages.
15-
"""
16-
return [
17-
dirpath
18-
for dirpath, dirnames, filenames in os.walk(package)
19-
if os.path.exists(os.path.join(dirpath, "__init__.py"))
20-
]
21-
22-
23-
pyasn1 = ["pyasn1"]
24-
extras_require = {
25-
"cryptography": ["cryptography>=3.4.0"],
26-
"pycrypto": ["pycrypto >=2.6.0, <2.7.0"] + pyasn1,
27-
"pycryptodome": ["pycryptodome >=3.3.1, <4.0.0"] + pyasn1,
28-
}
29-
# TODO: work this into the extras selection instead.
30-
install_requires = ["ecdsa != 0.15", "rsa"] + pyasn1
31-
324

33-
setup(
34-
name="python-jose",
35-
author="Michael Davis",
36-
author_email="[email protected]",
37-
description="JOSE implementation in Python",
38-
license="MIT",
39-
keywords="jose jws jwe jwt json web token security signing",
40-
url="http://github.com/mpdavis/python-jose",
41-
packages=get_packages("jose"),
42-
long_description=long_description,
43-
project_urls={
44-
"Documentation": "https://python-jose.readthedocs.io/en/latest/",
45-
"Source": "https://github.com/mpdavis/python-jose/",
46-
"Tracker": "https://github.com/mpdavis/python-jose/issues/",
47-
"Changelog": "https://github.com/mpdavis/python-jose/blob/master/CHANGELOG.md",
48-
},
49-
classifiers=[
50-
"Development Status :: 5 - Production/Stable",
51-
"Intended Audience :: Developers",
52-
"Natural Language :: English",
53-
"License :: OSI Approved :: MIT License",
54-
"Programming Language :: Python",
55-
"Programming Language :: Python :: 3",
56-
"Programming Language :: Python :: 3 :: Only",
57-
"Programming Language :: Python :: 3.6",
58-
"Programming Language :: Python :: 3.7",
59-
"Programming Language :: Python :: 3.8",
60-
"Programming Language :: Python :: 3.9",
61-
"Programming Language :: Python :: 3.10",
62-
"Programming Language :: Python :: Implementation :: PyPy",
63-
"Topic :: Utilities",
64-
],
65-
extras_require=extras_require,
66-
setup_requires=[
67-
"pytest-runner",
68-
"setuptools>=39.2.0",
69-
],
70-
tests_require=[
71-
"ecdsa != 0.15",
72-
"pytest",
73-
"pytest-cov",
74-
"pytest-runner",
75-
],
76-
install_requires=install_requires,
77-
)
5+
setup()

tox.ini

-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ extras =
3535
deps =
3636
pytest
3737
pytest-cov
38-
pytest-runner
3938

4039
commands_pre =
4140
# Remove the python-rsa and python-ecdsa backends

0 commit comments

Comments
 (0)