Skip to content

Commit 9fceef1

Browse files
authored
modernize packaging using pyproject.toml (#1461)
1 parent 779da2b commit 9fceef1

File tree

6 files changed

+56
-59
lines changed

6 files changed

+56
-59
lines changed

.github/workflows/release.yml

+2-4
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,11 @@ jobs:
2222

2323
- name: Install dependencies
2424
run: |
25-
python -m pip install -U pip
26-
python -m pip install -U setuptools twine wheel
25+
python -m pip install -U pip build twine
2726
2827
- name: Build package
2928
run: |
30-
python setup.py --version
31-
python setup.py sdist --format=gztar bdist_wheel
29+
python -m build
3230
twine check dist/*
3331
3432
- name: Upload packages to Jazzband

.github/workflows/test.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ jobs:
4444
with:
4545
path: ${{ steps.pip-cache.outputs.dir }}
4646
key:
47-
${{ matrix.python-version }}-v1-${{ hashFiles('**/setup.py') }}-${{ hashFiles('**/tox.ini') }}
47+
${{ matrix.python-version }}-v1-${{ hashFiles('**/pyproject.toml') }}-${{ hashFiles('**/tox.ini') }}
4848
restore-keys: |
4949
${{ matrix.python-version }}-v1-
5050

pyproject.toml

+49
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,52 @@
1+
[build-system]
2+
requires = ["setuptools >= 61.0"]
3+
build-backend = "setuptools.build_meta"
4+
5+
[project]
6+
name = "django-oauth-toolkit"
7+
dynamic = ["version"]
8+
requires-python = ">= 3.8"
9+
authors = [
10+
{name = "Federico Frenguelli"},
11+
{name = "Massimiliano Pippi"},
12+
{email = "[email protected]"},
13+
]
14+
description = "OAuth2 Provider for Django"
15+
keywords = ["django", "oauth", "oauth2", "oauthlib"]
16+
license = {file = "LICENSE"}
17+
readme = "README.rst"
18+
classifiers = [
19+
"Development Status :: 5 - Production/Stable",
20+
"Environment :: Web Environment",
21+
"Framework :: Django",
22+
"Framework :: Django :: 4.2",
23+
"Framework :: Django :: 5.0",
24+
"Framework :: Django :: 5.1",
25+
"Intended Audience :: Developers",
26+
"License :: OSI Approved :: BSD License",
27+
"Operating System :: OS Independent",
28+
"Programming Language :: Python :: 3",
29+
"Programming Language :: Python :: 3.8",
30+
"Programming Language :: Python :: 3.9",
31+
"Programming Language :: Python :: 3.10",
32+
"Programming Language :: Python :: 3.11",
33+
"Programming Language :: Python :: 3.12",
34+
"Topic :: Internet :: WWW/HTTP",
35+
]
36+
dependencies = [
37+
"django >= 4.2",
38+
"requests >= 2.13.0",
39+
"oauthlib >= 3.1.0",
40+
"jwcrypto >= 0.8.0",
41+
]
42+
43+
[project.urls]
44+
Homepage = "https://django-oauth-toolkit.readthedocs.io/"
45+
Repository = "https://github.com./jazzband/django-oauth-toolkit"
46+
47+
[tool.setuptools.dynamic]
48+
version = {attr = "oauth2_provider.__version__"}
49+
150
# Ref: https://github.com./codespell-project/codespell#using-a-config-file
251
[tool.codespell]
352
skip = '.git,package-lock.json,locale,AUTHORS,tox.ini'

setup.cfg

-45
This file was deleted.

setup.py

-6
This file was deleted.

tox.ini

+4-3
Original file line numberDiff line numberDiff line change
@@ -117,12 +117,13 @@ commands =
117117

118118
[testenv:build]
119119
deps =
120-
setuptools>=39.0
121-
wheel
120+
build
121+
twine
122122
allowlist_externals = rm
123123
commands =
124124
rm -rf dist
125-
python setup.py sdist bdist_wheel
125+
python -m build
126+
twine check dist/*
126127

127128
[coverage:run]
128129
source = oauth2_provider

0 commit comments

Comments
 (0)