Skip to content

Commit

Permalink
Merge pull request #283 from k4black/setup-fix
Browse files Browse the repository at this point in the history
🛠 Setup files refactor
  • Loading branch information
mpdavis authored Dec 7, 2021
2 parents a374301 + a93b11e commit cfbb868
Show file tree
Hide file tree
Showing 4 changed files with 68 additions and 77 deletions.
9 changes: 9 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
[build-system]
requires = [
"setuptools >= 39.2.0",
"wheel >= 0.29.0",
]
build-backend = 'setuptools.build_meta'


# TODO: move configuration to setup.cfg when available
[tool.isort]
multi_line_output = 3
include_trailing_comma = true
Expand Down
61 changes: 58 additions & 3 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -1,12 +1,67 @@
[metadata]
name = python-jose
version = attr: jose.__version__
description = JOSE implementation in Python
long_description = file: README.rst
url = http://github.com/mpdavis/python-jose
keywords = jose jws jwe jwt json web token security signing
author = Michael Davis
author_email = [email protected]
license = MIT
project_urls=
Documentation = https://python-jose.readthedocs.io/en/latest/
Source = https://github.com/mpdavis/python-jose/
Tracker = https://github.com/mpdavis/python-jose/issues/
Changelog = https://github.com/mpdavis/python-jose/blob/master/CHANGELOG.md
classifiers =
Development Status :: 5 - Production/Stable
Intended Audience :: Developers
Natural Language :: English
License :: OSI Approved :: MIT License
Programming Language :: Python
Programming Language :: Python :: 3
Programming Language :: Python :: 3 :: Only
Programming Language :: Python :: 3.6
Programming Language :: Python :: 3.7
Programming Language :: Python :: 3.8
Programming Language :: Python :: 3.9
Programming Language :: Python :: 3.10
Programming Language :: Python :: Implementation :: PyPy
Topic :: Utilities


[options]
packages = find:
install_requires =
ecdsa != 0.15
rsa >=4.0, <5.0, !=4.4, !=4.1.1
pyasn1 >=0.4.1, <0.5.0

[options.extras_require]
test =
pytest
pytest-cov
cryptography =
cryptography >=3.4.0
pycrypto =
pycrypto >=2.6.0, <2.7.0
pycryptodome =
pycryptodome >=3.3.1, <4.0.0

[options.packages.find]
exclude =
tests*

[flake8]
max-line-length = 120
ignore = E203,W503

[wheel]
universal = 1
[bdist_wheel]
universal = 1


[flake8]
max-line-length = 120
ignore = E203,W503

[aliases]
test=pytest
Expand Down
74 changes: 1 addition & 73 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,77 +1,5 @@
#!/usr/bin/env python
import os
from pathlib import Path

from setuptools import setup

import jose # noqa: F401

long_description = (Path(__file__).parent / "README.rst").read_text()


def get_packages(package):
"""
Return root package and all sub-packages.
"""
return [
dirpath
for dirpath, dirnames, filenames in os.walk(package)
if os.path.exists(os.path.join(dirpath, "__init__.py"))
]


pyasn1 = ["pyasn1"]
extras_require = {
"cryptography": ["cryptography>=3.4.0"],
"pycrypto": ["pycrypto >=2.6.0, <2.7.0"] + pyasn1,
"pycryptodome": ["pycryptodome >=3.3.1, <4.0.0"] + pyasn1,
}
# TODO: work this into the extras selection instead.
install_requires = ["ecdsa != 0.15", "rsa"] + pyasn1


setup(
name="python-jose",
author="Michael Davis",
author_email="[email protected]",
description="JOSE implementation in Python",
license="MIT",
keywords="jose jws jwe jwt json web token security signing",
url="http://github.com/mpdavis/python-jose",
packages=get_packages("jose"),
long_description=long_description,
project_urls={
"Documentation": "https://python-jose.readthedocs.io/en/latest/",
"Source": "https://github.com/mpdavis/python-jose/",
"Tracker": "https://github.com/mpdavis/python-jose/issues/",
"Changelog": "https://github.com/mpdavis/python-jose/blob/master/CHANGELOG.md",
},
classifiers=[
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Developers",
"Natural Language :: English",
"License :: OSI Approved :: MIT License",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: Implementation :: PyPy",
"Topic :: Utilities",
],
extras_require=extras_require,
setup_requires=[
"pytest-runner",
"setuptools>=39.2.0",
],
tests_require=[
"ecdsa != 0.15",
"pytest",
"pytest-cov",
"pytest-runner",
],
install_requires=install_requires,
)
setup()
1 change: 0 additions & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ extras =
deps =
pytest
pytest-cov
pytest-runner

commands_pre =
# Remove the python-rsa and python-ecdsa backends
Expand Down

0 comments on commit cfbb868

Please sign in to comment.