Skip to content

Commit

Permalink
Refactor project configuration files from setup.cfg to pyproject.toml…
Browse files Browse the repository at this point in the history
… PEP-518 (#995)

* Refactor project configuration files

* Move flake8 configuration to tox.ini

Flake8 does not support pyproject.toml

* fix and relax flake8 configuration
  • Loading branch information
cleder authored Oct 7, 2024
1 parent 53dd594 commit 9bcb83f
Show file tree
Hide file tree
Showing 5 changed files with 116 additions and 89 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ __pycache__/
# Distribution / packaging
.Python
env/
.venv/
build/
develop-eggs/
dist/
Expand Down
127 changes: 111 additions & 16 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,35 +1,130 @@
[build-system]
requires = ["setuptools"]
build-backend = "setuptools.build_meta"
requires = [
"setuptools",
]

[tool.coverage.run]
parallel = true
branch = true
source = ["jwt"]
[project]
authors = [
{ email = "[email protected]", name = "Jose Padilla" },
]
classifiers = [
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Developers",
"License :: OSI Approved :: MIT License",
"Natural Language :: English",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Topic :: Utilities",
]
description = "JSON Web Token implementation in Python"
dynamic = [
"version",
]
keywords = [
"json",
"jwt",
"security",
"signing",
"token",
"web",
]
name = "PyJWT"
requires-python = ">=3.8"

[project.license]
text = "MIT"

[project.optional-dependencies]
crypto = [
"cryptography>=3.4.0",
]
dev = [
"coverage[toml]==5.0.4",
"cryptography>=3.4.0",
"pre-commit",
"pytest>=6.0.0,<7.0.0",
"sphinx",
"sphinx-rtd-theme",
"zope.interface",
]
docs = [
"sphinx",
"sphinx-rtd-theme",
"zope.interface",
]
tests = [
"coverage[toml]==5.0.4",
"pytest>=6.0.0,<7.0.0",
]

[project.readme]
content-type = "text/x-rst"
file = "README.rst"

[project.urls]
Homepage = "https://github.com/jpadilla/pyjwt"

[tool.coverage.paths]
source = ["jwt", ".tox/*/site-packages"]
source = [
".tox/*/site-packages",
"jwt",
]

[tool.coverage.report]
exclude_lines = [
"if TYPE_CHECKING:",
"pragma: no cover",
]
show_missing = true
exclude_lines = ["if TYPE_CHECKING:", "pragma: no cover"]

[tool.coverage.run]
branch = true
parallel = true
source = [
"jwt",
]

[tool.isort]
profile = "black"
atomic = true
combine_as_imports = true
profile = "black"

[tool.mypy]
python_version = 3.11
allow_incomplete_defs = true
allow_untyped_defs = true
ignore_missing_imports = true
warn_unused_ignores = true
no_implicit_optional = true
overrides = [
{ disallow_untyped_calls = false, module = "tests.*" },
]
python_version = 3.11
strict = true
# TODO: remove these strict loosenings when possible
allow_incomplete_defs = true
allow_untyped_defs = true
warn_return_any = false
warn_unused_ignores = true

[tool.setuptools]
include-package-data = true
zip-safe = false

[tool.setuptools.dynamic.version]
attr = "jwt.__version__"

[tool.setuptools.package-data]
"*" = [
"py.typed",
]

[[tool.mypy.overrides]]
module = "tests.*"
disallow_untyped_calls = false
[tool.setuptools.packages.find]
exclude = [
"tests",
"tests.*",
]
namespaces = false
68 changes: 0 additions & 68 deletions setup.cfg

This file was deleted.

5 changes: 0 additions & 5 deletions setup.py

This file was deleted.

4 changes: 4 additions & 0 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
[flake8]
min_python_version = 3.8
ignore= E501, E203, W503, E704

[pytest]
addopts = -ra
testpaths = tests
Expand Down

0 comments on commit 9bcb83f

Please sign in to comment.