Skip to content

Commit 1d7a097

Browse files
authored
Migrate metadata from setup.py and setup.cfg to pyproject.toml (#475)
1 parent 88ab289 commit 1d7a097

File tree

6 files changed

+67
-57
lines changed

6 files changed

+67
-57
lines changed

setup.cfg renamed to .flake8

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,3 @@ max-line-length = 120
66
# - docs: contains autogenerated code that doesn't need a check
77
exclude = */migrations/*,docs
88
ignore = E731
9-
10-
[mypy]
11-
python_version = 3.7
12-
exclude = waffle/tests
13-
disallow_incomplete_defs = True
14-
disallow_untyped_calls = True
15-
disallow_untyped_decorators = True
16-
strict_equality = True
17-
[mypy-django.*]
18-
ignore_missing_imports = True

RELEASING.rst

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,13 @@ These are the steps necessary to release a new version of Django Waffle.
55

66
1. Update the version number in the following files:
77

8-
a. `setup.py`
9-
b. `docs/conf.py`
10-
c. `waffle/__init__.py`
8+
a. `docs/conf.py`
9+
b. `waffle/__init__.py`
1110

1211
2. Update the changelog in `CHANGES`.
1312

1413
3. Merge these changes to the `master` branch.
1514

16-
4. Create a new release on GitHub. This will also create a Git tag, and trigger a push to PyPI.
15+
4. Create a new release on GitHub. This will also create a git tag, and trigger a push to PyPI.
1716

1817
5. Ensure the documentation build passes: https://readthedocs.org/projects/waffle/

pyproject.toml

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
[build-system]
2+
requires = ["setuptools>=61.2"]
3+
build-backend = "setuptools.build_meta"
4+
5+
[project]
6+
name = "django-waffle"
7+
dynamic = ["version"]
8+
authors = [{name = "James Socol", email = "me@jamessocol.com"}]
9+
license = {text = "BSD"}
10+
description = "A feature flipper for Django."
11+
readme = "README.rst"
12+
classifiers = [
13+
"Development Status :: 5 - Production/Stable",
14+
"Environment :: Web Environment",
15+
"Framework :: Django",
16+
"Intended Audience :: Developers",
17+
"License :: OSI Approved :: BSD License",
18+
"Operating System :: OS Independent",
19+
"Framework :: Django",
20+
"Framework :: Django :: 3.2",
21+
"Framework :: Django :: 4.0",
22+
"Framework :: Django :: 4.1",
23+
"Programming Language :: Python",
24+
"Programming Language :: Python :: 3",
25+
"Programming Language :: Python :: 3 :: Only",
26+
"Programming Language :: Python :: 3.7",
27+
"Programming Language :: Python :: 3.8",
28+
"Programming Language :: Python :: 3.9",
29+
"Programming Language :: Python :: 3.10",
30+
"Topic :: Software Development :: Libraries :: Python Modules",
31+
]
32+
requires-python = ">=3.7"
33+
dependencies = ["django>=3.2"]
34+
35+
[project.urls]
36+
Homepage = "http://github.com/django-waffle/django-waffle"
37+
38+
[tool.setuptools]
39+
zip-safe = false
40+
include-package-data = true
41+
42+
[tool.setuptools.dynamic]
43+
version = {attr = "waffle.__version__"}
44+
45+
[tool.setuptools.packages.find]
46+
exclude = ["test_app"] # test_settings
47+
namespaces = false
48+
49+
[tool.setuptools.package-data]
50+
waffle = ["py.typed"]
51+
52+
[tool.mypy]
53+
python_version = "3.7"
54+
exclude = "waffle/tests"
55+
disallow_incomplete_defs = true
56+
disallow_untyped_calls = true
57+
disallow_untyped_decorators = true
58+
strict_equality = true
59+
60+
[[tool.mypy.overrides]]
61+
module = ["django.*"]
62+
ignore_missing_imports = true

setup.py

Lines changed: 0 additions & 41 deletions
This file was deleted.

tox.ini

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
envlist =
33
py{37,38,39,310}-django{32}
44
py{38,39,310}-django{40,41}
5+
isolated_build = True
56

67
[gh-actions]
78
python =

waffle/__init__.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,7 @@
1212
if TYPE_CHECKING:
1313
from waffle.models import AbstractBaseFlag, AbstractBaseSample, AbstractBaseSwitch
1414

15-
VERSION = (3, 0, 0)
16-
__version__ = '.'.join(map(str, VERSION))
15+
__version__ = '3.0.0'
1716

1817

1918
def flag_is_active(request: HttpRequest, flag_name: str, read_only: bool = False) -> bool | None:

0 commit comments

Comments
 (0)