diff --git a/setup.cfg b/.flake8 similarity index 57% rename from setup.cfg rename to .flake8 index 61d986f3..5840e7ac 100644 --- a/setup.cfg +++ b/.flake8 @@ -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 diff --git a/RELEASING.rst b/RELEASING.rst index 31ed7412..50044ba4 100644 --- a/RELEASING.rst +++ b/RELEASING.rst @@ -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/ diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 00000000..6738b880 --- /dev/null +++ b/pyproject.toml @@ -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 = "me@jamessocol.com"}] +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 diff --git a/setup.py b/setup.py deleted file mode 100644 index 2925eae8..00000000 --- a/setup.py +++ /dev/null @@ -1,41 +0,0 @@ -from setuptools import setup, find_packages - -setup( - name='django-waffle', - version='3.0.0', - description='A feature flipper for Django.', - long_description=open('README.rst').read(), - author='James Socol', - author_email='me@jamessocol.com', - url='http://github.com/django-waffle/django-waffle', - license='BSD', - packages=find_packages(exclude=['test_app', 'test_settings']), - include_package_data=True, - package_data={ - '': ['README.rst'], - 'waffle': ['py.typed'], - }, - zip_safe=False, - python_requires='>=3.7', - install_requires=['django>=3.2'], - 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', - ], -) diff --git a/tox.ini b/tox.ini index 1312dfb3..f33e22b1 100644 --- a/tox.ini +++ b/tox.ini @@ -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 = diff --git a/waffle/__init__.py b/waffle/__init__.py index 8d48519e..df3745d9 100755 --- a/waffle/__init__.py +++ b/waffle/__init__.py @@ -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: