Skip to content

modernize packaging using pyproject.toml #1461

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Aug 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,11 @@ jobs:

- name: Install dependencies
run: |
python -m pip install -U pip
python -m pip install -U setuptools twine wheel
python -m pip install -U pip build twine
- name: Build package
run: |
python setup.py --version
python setup.py sdist --format=gztar bdist_wheel
python -m build
twine check dist/*
- name: Upload packages to Jazzband
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ jobs:
with:
path: ${{ steps.pip-cache.outputs.dir }}
key:
${{ matrix.python-version }}-v1-${{ hashFiles('**/setup.py') }}-${{ hashFiles('**/tox.ini') }}
${{ matrix.python-version }}-v1-${{ hashFiles('**/pyproject.toml') }}-${{ hashFiles('**/tox.ini') }}
restore-keys: |
${{ matrix.python-version }}-v1-
Expand Down
49 changes: 49 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,52 @@
[build-system]
requires = ["setuptools >= 61.0"]
build-backend = "setuptools.build_meta"

[project]
name = "django-oauth-toolkit"
dynamic = ["version"]
requires-python = ">= 3.8"
authors = [
{name = "Federico Frenguelli"},
{name = "Massimiliano Pippi"},
{email = "[email protected]"},
]
description = "OAuth2 Provider for Django"
keywords = ["django", "oauth", "oauth2", "oauthlib"]
license = {file = "LICENSE"}
readme = "README.rst"
classifiers = [
"Development Status :: 5 - Production/Stable",
"Environment :: Web Environment",
"Framework :: Django",
"Framework :: Django :: 4.2",
"Framework :: Django :: 5.0",
"Framework :: Django :: 5.1",
"Intended Audience :: Developers",
"License :: OSI Approved :: BSD License",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3",
"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",
"Topic :: Internet :: WWW/HTTP",
]
dependencies = [
"django >= 4.2",
"requests >= 2.13.0",
"oauthlib >= 3.1.0",
"jwcrypto >= 0.8.0",
]

[project.urls]
Homepage = "https://django-oauth-toolkit.readthedocs.io/"
Repository = "https://github.com/jazzband/django-oauth-toolkit"

[tool.setuptools.dynamic]
version = {attr = "oauth2_provider.__version__"}

# Ref: https://github.com/codespell-project/codespell#using-a-config-file
[tool.codespell]
skip = '.git,package-lock.json,locale,AUTHORS,tox.ini'
Expand Down
45 changes: 0 additions & 45 deletions setup.cfg

This file was deleted.

6 changes: 0 additions & 6 deletions setup.py

This file was deleted.

7 changes: 4 additions & 3 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -117,12 +117,13 @@ commands =

[testenv:build]
deps =
setuptools>=39.0
wheel
build
twine
allowlist_externals = rm
commands =
rm -rf dist
python setup.py sdist bdist_wheel
python -m build
twine check dist/*

[coverage:run]
source = oauth2_provider
Expand Down
Loading