Skip to content

Commit

Permalink
Switch to pyproject.toml
Browse files Browse the repository at this point in the history
  • Loading branch information
Viicos committed Jun 24, 2024
1 parent e868e8f commit 4b66e4e
Show file tree
Hide file tree
Showing 8 changed files with 134 additions and 127 deletions.
10 changes: 0 additions & 10 deletions .bumpversion.cfg

This file was deleted.

3 changes: 3 additions & 0 deletions .flake8
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[flake8]
max-line-length=88
exclude=env,.tox,doc
17 changes: 9 additions & 8 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
exclude:
- python: '3.11'
django: '3.2'
- python: '3.12'
- python: 3.12'
django: '3.2'
# support for django 4.2 was added in 4.0
- django: '4.2'
Expand Down Expand Up @@ -64,6 +64,9 @@ jobs:
name: Publish package to PyPI
runs-on: ubuntu-latest
needs: tests
environment: release
permissions:
id-token: write

if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')

Expand All @@ -73,12 +76,10 @@ jobs:
with:
python-version: '3.10'

- name: Build sdist and wheel
- name: Build 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@v1.4.1
with:
user: __token__
password: ${{ secrets.PYPI_TOKEN }}
uses: pypa/gh-action-pypi-publish@release/v1
2 changes: 1 addition & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
# -- Project information -----------------------------------------------------

project = "mozilla_django_oidc_db"
copyright = "2024, Maykin Media"
copyright = "2021, Maykin Media"
author = "Maykin Media"

# The full version, including alpha/beta/rc tags
Expand Down
119 changes: 119 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
[build-system]
requires = ["setuptools>=61.0.0"]
build-backend = "setuptools.build_meta"

[project]
name = "mozilla-django-oidc-db"
version = "0.15.0"
description = "A database-backed configuration for mozilla-django-oidc"
authors = [
{name = "Maykin Media", email = "support@maykinmedia.nl"}
]
readme = "README.rst"
license = {file = "LICENSE"}
keywords = ["OIDC", "django", "database", "authentication"]
classifiers = [
"Development Status :: 5 - Production/Stable",
"Framework :: Django",
"Framework :: Django :: 3.2",
"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 = [
"django>=3.2",
"django-jsonform",
"django-solo",
"glom",
"mozilla-django-oidc>=3.0.0",
]

[project.urls]
Homepage = "/~https://github.com/maykinmedia/mozilla-django-oidc-db"
Documentation = "https://mozilla-django-oidc-db.readthedocs.io/en/latest/"
"Bug Tracker" = "/~https://github.com/maykinmedia/mozilla-django-oidc-db/issues"
"Source Code" = "/~https://github.com/maykinmedia/mozilla-django-oidc-db"
Changelog = "/~https://github.com/maykinmedia/mozilla-django-oidc-db/blob/master/CHANGELOG.rst"

[project.optional-dependencies]
tests = [
"psycopg2",
"pytest",
"pytest-django",
"pytest-mock",
"pytest-recording",
"requests-mock",
"factory-boy",
"pyquery",
"tox",
"isort",
"black",
"flake8",
]
coverage = [
"pytest-cov",
]
docs = [
"sphinx",
"sphinx-rtd-theme",
]
release = [
"bump-my-version",
"twine",
]

[tool.setuptools.packages.find]
include = ["mozilla_django_oidc_db*"]
namespaces = false

[tool.isort]
profile = "black"
combine_as_imports = true
known_django = "django"
known_first_party="mozilla_django_oidc_db"
sections=["FUTURE", "STDLIB", "DJANGO", "THIRDPARTY", "FIRSTPARTY", "LOCALFOLDER"]

[tool.pytest.ini_options]
testpaths = ["tests"]
DJANGO_SETTINGS_MODULE = "testapp.settings"

[tool.bumpversion]
current_version = "0.15.0"
files = [
{filename = "pyproject.toml"},
{filename = "README.rst"},
{filename = "docs/conf.py"},
]

[tool.coverage.run]
branch = true
source = [
"mozilla_django_oidc_db"
]
omit = [
"mozilla_django_oidc_db/migrations/*",
]

[tool.coverage.report]
exclude_also = [
"if (typing\\.)?TYPE_CHECKING:",
"@(typing\\.)?overload",
"class .*\\(.*Protocol.*\\):",
"@(abc\\.)?abstractmethod",
"raise NotImplementedError",
"\\.\\.\\.",
"pass",
]
omit = [
"mozilla_django_oidc_db/migrations/*",
]

[tool.coverage.html]
directory = "cover"
100 changes: 0 additions & 100 deletions setup.cfg

This file was deleted.

3 changes: 0 additions & 3 deletions setup.py

This file was deleted.

7 changes: 2 additions & 5 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ skip_missing_interpreters = true

[gh-actions]
python =
3.8: py38
3.9: py39
3.10: py310
3.11: py311
3.12: py312
Expand Down Expand Up @@ -40,8 +38,7 @@ passenv =
setenv =
PYTHONPATH = {toxinidir}
commands =
py.test tests \
--junitxml=reports/junit.xml \
pytest tests \
--cov --cov-report xml:reports/coverage-{envname}.xml \
{posargs}

Expand All @@ -64,6 +61,6 @@ extras =
docs
tests
commands=
py.test check_sphinx.py -v \
pytest check_sphinx.py -v \
--tb=auto \
{posargs}

0 comments on commit 4b66e4e

Please sign in to comment.