Skip to content

Commit

Permalink
modernize packaging using pyproject.toml
Browse files Browse the repository at this point in the history
  • Loading branch information
dulmandakh committed Aug 15, 2024
1 parent 56149aa commit 2a1dbb5
Show file tree
Hide file tree
Showing 6 changed files with 56 additions and 59 deletions.
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 @@ -118,12 +118,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

0 comments on commit 2a1dbb5

Please sign in to comment.