diff --git a/.bumpversion.cfg b/.bumpversion.cfg deleted file mode 100644 index d114fed..0000000 --- a/.bumpversion.cfg +++ /dev/null @@ -1,10 +0,0 @@ -[bumpversion] -commit = False -tag = False -current_version = 0.15.0 - -[bumpversion:file:setup.cfg] - -[bumpversion:file:README.rst] - -[bumpversion:file:docs/conf.py] diff --git a/.flake8 b/.flake8 new file mode 100644 index 0000000..6e29ba0 --- /dev/null +++ b/.flake8 @@ -0,0 +1,3 @@ +[flake8] +max-line-length=88 +exclude=env,.tox,doc diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1b44ed5..27560ca 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -75,8 +75,8 @@ jobs: - name: Build sdist and wheel run: | - pip install pip setuptools wheel --upgrade - python setup.py sdist bdist_wheel + pip install build --upgrade + python -m build - name: Publish a Python distribution to PyPI uses: pypa/gh-action-pypi-publish@release/v1 diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..9f03eb6 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,129 @@ +[build-system] +requires = ["setuptools>=61.0.0"] +build-backend = "setuptools.build_meta" + +[project] +name = "django-digid-eherkenning" +version = "0.15.0" +description = "A Django app for DigiD/eHerkenning authentication flows" +authors = [ + {name = "Maykin Media", email = "support@maykinmedia.nl"} +] +readme = "README.rst" +license = {file = "LICENSE"} +keywords = ["django", "authentication", "digid", "eherkenning", "eidas", "dutch", "nl", "netherlands"] +classifiers = [ + "Development Status :: 4 - Beta", + "Framework :: Django", + "Framework :: Django :: 4.2", + "Intended Audience :: Developers", + "Operating System :: Unix", + "Operating System :: MacOS", + "Operating System :: Microsoft :: Windows", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", + "Topic :: Software Development :: Libraries :: Python Modules", +] +requires-python = ">=3.10" +dependencies = [ + "cryptography>=40.0.0", + "django>=4.2.0", + "django-sessionprofile", + "django-simple-certmanager", + "django-solo", + "lxml>=4.7.1", + "furl", + "maykin-python3-saml>=1.16.0", +] + +[project.urls] +Homepage = "https://github.com/maykinmedia/django-digid-eherkenning" +Documentation = "https://django-digid-eherkenning.readthedocs.io/en/latest/" +"Bug Tracker" = "https://github.com/maykinmedia/django-digid-eherkenning/issues" +"Source Code" = "https://github.com/maykinmedia/django-digid-eherkenning" +Changelog = "https://github.com/maykinmedia/django-digid-eherkenning/blob/master/docs/CHANGELOG.rst" + +[project.optional-dependencies] +oidc = [ + "mozilla-django-oidc-db>=0.18.0", +] +tests = [ + "django-test-migrations", + "pytest", + "pytest-django", + "pytest-mock", + "responses", + "freezegun", + "tox", + "isort", + "black", + "flake8", +] +coverage = [ + "pytest-cov", +] +docs = [ + "sphinx", + "sphinx-rtd-theme", + "psycopg2", +] +release = [ + "bump-my-version", + "twine", +] + +[tool.setuptools.packages.find] +include = ["digid_eherkenning*"] +namespaces = false + +[tool.isort] +profile = "black" +combine_as_imports = true +known_django = "django" +known_first_party="digid_eherkenning" +sections=["FUTURE", "STDLIB", "DJANGO", "THIRDPARTY", "FIRSTPARTY", "LOCALFOLDER"] + +[tool.pytest.ini_options] +testpaths = ["tests"] +DJANGO_SETTINGS_MODULE = "tests.project.settings" +markers = [ + "callback: additional configuration for the callback fixture", + "mock_backend: class/claims to be returned by the mock backend fixture", +] + +[tool.bumpversion] +current_version = "0.15.0" +files = [ + {filename = "pyproject.toml"}, + {filename = "README.rst"}, + {filename = "docs/conf.py"}, +] + +[tool.coverage.run] +branch = true +source = [ + "digid_eherkenning" +] +omit = [ + # migrations run while django initializes the test db + "*/migrations/*", +] + +[tool.coverage.report] +skip_covered = true +exclude_also = [ + "if (typing\\.)?TYPE_CHECKING:", + "@(typing\\.)?overload", + "class .*\\(.*Protocol.*\\):", + "@(abc\\.)?abstractmethod", + "raise NotImplementedError", + "\\.\\.\\.", + "pass", +] +omit = [ + "*/migrations/*", +] + +[tool.coverage.html] +directory = "cover" diff --git a/setup.cfg b/setup.cfg deleted file mode 100644 index 326b799..0000000 --- a/setup.cfg +++ /dev/null @@ -1,136 +0,0 @@ -# setuptools config -# see http://setuptools.readthedocs.io/en/latest/setuptools.html#configuring-setup-using-setup-cfg-files -[metadata] -name = django-digid-eherkenning -version = 0.15.0 -description = A Django app for DigiD/eHerkenning authentication flows -long_description = file: README.rst -url = https://github.com/maykinmedia/django-digid-eherkenning -project_urls = - Changelog = https://github.com/maykinmedia/django-digid-eherkenning/blob/master/docs/CHANGELOG.rst - Bug Tracker = https://github.com/maykinmedia/django-digid-eherkenning/issues - Source Code = https://github.com/maykinmedia/django-digid-eherkenning -license = MIT -author = Maykin Media -author_email = support@maykinmedia.nl -keywords = django, authentication, digid, eherkenning, eidas, dutch, nl, netherlands -classifiers = - Development Status :: 4 - Beta - Framework :: Django - Framework :: Django :: 4.2 - Intended Audience :: Developers - Operating System :: Unix - Operating System :: MacOS - Operating System :: Microsoft :: Windows - Programming Language :: Python :: 3.10 - Programming Language :: Python :: 3.11 - Programming Language :: Python :: 3.12 - Topic :: Software Development :: Libraries :: Python Modules - -[options] -zip_safe = False -include_package_data = True -packages = find: -python_requires = >= 3.10 -install_requires = - cryptography >= 40.0.0 - django >= 4.2.0 - django-sessionprofile - django-simple-certmanager - django-solo - lxml >= 4.7.1 - furl - maykin-python3-saml >= 1.16.0 -tests_require = - django-test-migrations - freezegun - pytest - pytest-django - pytest-mock - responses - freezegun - tox - isort - black - -[options.packages.find] -include = - digid_eherkenning - digid_eherkenning.* - -[options.extras_require] -oidc = - mozilla-django-oidc-db >= 0.18.0 -tests = - django-test-migrations - pytest - pytest-django - pytest-mock - responses - freezegun - tox - isort - black -pep8 = flake8 -coverage = pytest-cov -docs = - sphinx - sphinx-rtd-theme - psycopg2 -release = - bump2version - twine - -# 3rd party configuration - -[aliases] -test=pytest - -[isort] -combine_as_imports = true -default_section = THIRDPARTY -include_trailing_comma = true -line_length = 88 -multi_line_output = 3 -force_grid_wrap = 0 -use_parentheses = True -ensure_newline_before_comments = True -skip = env,node_modules,.tox -skip_glob = **/migrations/** -known_django=django -known_first_party=digid_eherkenning -sections=FUTURE,STDLIB,DJANGO,THIRDPARTY,FIRSTPARTY,LOCALFOLDER - -[tool:pytest] -testpaths = tests -DJANGO_SETTINGS_MODULE=tests.project.settings -markers = - callback: additional configuration for the callback fixture - mock_backend: class/claims to be returned by the mock backend fixture - -[pep8] -max-line-length=88 -ignore=W293,W291,E501,E261 -exclude=migrations,static,media - -[flake8] -max-line-length=88 -exclude=env,.tox,doc - -[coverage:run] -branch = True -source = digid_eherkenning -omit = - # migrations run while django initializes the test db - */migrations/* - -[coverage:report] -skip_covered = True -exclude_also = - if (typing\.)?TYPE_CHECKING: - @(typing\.)?overload - class .*\(.*Protocol.*\): - @(abc\.)?abstractmethod - raise NotImplementedError - \.\.\. - pass diff --git a/setup.py b/setup.py deleted file mode 100755 index 6068493..0000000 --- a/setup.py +++ /dev/null @@ -1,3 +0,0 @@ -from setuptools import setup - -setup() diff --git a/tox.ini b/tox.ini index 074d309..b9829e3 100644 --- a/tox.ini +++ b/tox.ini @@ -38,7 +38,7 @@ deps = django42: Django~=4.2 oidcenabled: psycopg commands = - py.test tests \ + pytest tests \ --cov --cov-report xml:reports/coverage-{envname}.xml \ {posargs} @@ -63,6 +63,6 @@ extras = deps = psycopg commands= - py.test check_sphinx.py -v \ + pytest check_sphinx.py -v \ --tb=auto \ {posargs}