Skip to content
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

Migrate metadata from setup.py and setup.cfg to pyproject.toml #475

Merged
merged 7 commits into from
Oct 2, 2022
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
10 changes: 0 additions & 10 deletions setup.cfg → .flake8
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,3 @@ max-line-length = 120
# - docs: contains autogenerated code that doesn't need a check
exclude = */migrations/*,docs
ignore = E731

[mypy]
python_version = 3.7
exclude = waffle/tests
disallow_incomplete_defs = True
disallow_untyped_calls = True
disallow_untyped_decorators = True
strict_equality = True
[mypy-django.*]
ignore_missing_imports = True
7 changes: 3 additions & 4 deletions RELEASING.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,13 @@ These are the steps necessary to release a new version of Django Waffle.

1. Update the version number in the following files:

a. `setup.py`
b. `docs/conf.py`
c. `waffle/__init__.py`
a. `docs/conf.py`
b. `waffle/__init__.py`

2. Update the changelog in `CHANGES`.

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

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

5. Ensure the documentation build passes: https://readthedocs.org/projects/waffle/
62 changes: 62 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
[build-system]
requires = ["setuptools>=61.2"]
build-backend = "setuptools.build_meta"

[project]
name = "django-waffle"
dynamic = ["version"]
authors = [{name = "James Socol", email = "[email protected]"}]
license = {text = "BSD"}
description = "A feature flipper for Django."
readme = "README.rst"
classifiers = [
"Development Status :: 5 - Production/Stable",
"Environment :: Web Environment",
"Framework :: Django",
"Intended Audience :: Developers",
"License :: OSI Approved :: BSD License",
"Operating System :: OS Independent",
"Framework :: Django",
"Framework :: Django :: 3.2",
"Framework :: Django :: 4.0",
"Framework :: Django :: 4.1",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Topic :: Software Development :: Libraries :: Python Modules",
]
requires-python = ">=3.7"
dependencies = ["django>=3.2"]

[project.urls]
Homepage = "http://github.com/django-waffle/django-waffle"

[tool.setuptools]
zip-safe = false
include-package-data = true

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

[tool.setuptools.packages.find]
exclude = ["test_app"] # test_settings
namespaces = false

[tool.setuptools.package-data]
waffle = ["py.typed"]

[tool.mypy]
python_version = "3.7"
exclude = "waffle/tests"
disallow_incomplete_defs = true
disallow_untyped_calls = true
disallow_untyped_decorators = true
strict_equality = true

[[tool.mypy.overrides]]
module = ["django.*"]
ignore_missing_imports = true
41 changes: 0 additions & 41 deletions setup.py

This file was deleted.

1 change: 1 addition & 0 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
envlist =
py{37,38,39,310}-django{32}
py{38,39,310}-django{40,41}
isolated_build = True

[gh-actions]
python =
Expand Down
3 changes: 1 addition & 2 deletions waffle/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@
if TYPE_CHECKING:
from waffle.models import AbstractBaseFlag, AbstractBaseSample, AbstractBaseSwitch

VERSION = (3, 0, 0)
__version__ = '.'.join(map(str, VERSION))
__version__ = '3.0.0'


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