diff --git a/.gitignore b/.gitignore index 8f78dc38..6333fe1e 100644 --- a/.gitignore +++ b/.gitignore @@ -11,6 +11,7 @@ __pycache__/ # Distribution / packaging .Python env/ +.venv/ build/ develop-eggs/ dist/ diff --git a/pyproject.toml b/pyproject.toml index 320777c9..f5821fd7 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -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 = "hello@jpadilla.com", 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 diff --git a/setup.cfg b/setup.cfg deleted file mode 100644 index c9a60c23..00000000 --- a/setup.cfg +++ /dev/null @@ -1,68 +0,0 @@ -[metadata] -name = PyJWT -version = attr: jwt.__version__ -author = Jose Padilla -author_email = hello@jpadilla.com -description = JSON Web Token implementation in Python -license = MIT -keywords = - json - jwt - security - signing - token - web -url = https://github.com/jpadilla/pyjwt -long_description = file: README.rst -long_description_content_type = text/x-rst -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.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 - -[options] -zip_safe = false -include_package_data = true -python_requires = >=3.8 -packages = find: - -[options.package_data] -* = py.typed - -[options.extras_require] -docs = - sphinx - sphinx-rtd-theme - zope.interface -crypto = - cryptography>=3.4.0 -tests = - pytest>=6.0.0,<7.0.0 - coverage[toml]==5.0.4 -dev = - sphinx - sphinx-rtd-theme - zope.interface - cryptography>=3.4.0 - pytest>=6.0.0,<7.0.0 - coverage[toml]==5.0.4 - pre-commit - -[options.packages.find] -exclude = - tests - tests.* - -[flake8] -extend-ignore = E203, E501 diff --git a/setup.py b/setup.py deleted file mode 100755 index 229b2ebb..00000000 --- a/setup.py +++ /dev/null @@ -1,5 +0,0 @@ -#!/usr/bin/env python3 - -from setuptools import setup - -setup() diff --git a/tox.ini b/tox.ini index 81d8e965..44717ffc 100644 --- a/tox.ini +++ b/tox.ini @@ -1,3 +1,7 @@ +[flake8] +min_python_version = 3.8 +ignore= E501, E203, W503, E704 + [pytest] addopts = -ra testpaths = tests