diff --git a/.bumpversion.cfg b/.bumpversion.cfg index 5dbf26b..42a7c07 100644 --- a/.bumpversion.cfg +++ b/.bumpversion.cfg @@ -1,6 +1,5 @@ [bumpversion] current_version = 1.2.0 -files = setup.cfg README.rst +files = src/verification/__init__.py README.rst commit = False tag = False - diff --git a/.github/workflows/tox.yml b/.github/workflows/tox.yml index ad33c4c..740a85f 100644 --- a/.github/workflows/tox.yml +++ b/.github/workflows/tox.yml @@ -3,19 +3,36 @@ name: CI on: [push, pull_request] jobs: + lint: + name: Lint with flake8 + runs-on: ubuntu-latest + + steps: + - uses: "actions/checkout@v4" + + - uses: "actions/setup-python@v4" + with: + python-version: "3.10" + + - run: | + pip install flake8 + # stop the build if there are Python syntax errors or undefined names + flake8 --count --select=E9,F63,F7,F82 --show-source --statistics src/ + tests: name: "Python ${{ matrix.python-version }}" + needs: lint runs-on: ubuntu-latest strategy: matrix: - python-version: [3.8,3.9] + python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] steps: - - uses: actions/checkout@v2 + - uses: "actions/checkout@v4" - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v2 + uses: "actions/setup-python@v4" with: python-version: ${{ matrix.python-version }} @@ -24,15 +41,9 @@ jobs: set -xe python -VV python -m site - python -m pip install --upgrade pip "setuptools<46" wheel + python -m pip install --upgrade pip wheel python -m pip install --upgrade virtualenv tox tox-gh-actions - - name: Lint with flake8 - run: | - pip install flake8 - # stop the build if there are Python syntax errors or undefined names - flake8 --count --select=E9,F63,F7,F82 --show-source --statistics src/ - - name: Test with tox run: | python -m tox @@ -42,16 +53,16 @@ jobs: runs-on: "ubuntu-latest" steps: - - uses: "actions/checkout@v2" - - uses: "actions/setup-python@v2" + - uses: "actions/checkout@v4" + - uses: "actions/setup-python@v4" with: - python-version: "3.8" + python-version: "3.10" - name: "Install build, check-wheel-content, and twine" run: | python -m pip install build twine check-wheel-contents - name: "Build package" - run: "python -m build --sdist --wheel ." + run: "python -m build" - name: "List result" run: "ls -l dist" - name: "Check wheel contents" diff --git a/.gitignore b/.gitignore index 2b8622f..9a3205b 100644 --- a/.gitignore +++ b/.gitignore @@ -1,11 +1,14 @@ +.* +!.bumpversion.cfg +!.github +!.gitignore +!.pre-commit-config.yaml *.pyc *.pyo *.swp *.sqlite *.egg-info *~ -.coverage -.tox htmlcov dist build diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 4adbf3b..f562b21 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -1,10 +1,21 @@ Changelog ========= +Release 1.3.0 +------------- + +Adds support for Django 4.2 and 5.0. + +Add support for Python 3.10, 3.11 and 3.12. + +Drops support for Python older than 3.8. + +Switched from setup.cfg to pyproject.toml. + Release 1.2.0 ------------- -Adds support for Django 3.2 +Adds support for Django 3.2. Drops support for Django 2.2 or older, as well as Python 3.5 or older. @@ -12,6 +23,8 @@ Shims to support Python 2.x and Django < 3.2 have been removed. Sundry modernizing of package building and testing. +Last version to support Python 3.6 and 3.7. + Release 1.1.0 ------------- diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..73de3c0 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,62 @@ +[build-system] +requires = ["hatchling"] +build-backend = "hatchling.build" + +[project] +name = "django-verification" +description = "Generalized app for two-step verification" +authors = [{name = "kaleissin", email = "kaleissin@gmail.com"}] +classifiers = [ + "Development Status :: 4 - Beta", + "Environment :: Web Environment", + "Framework :: Django", + "Intended Audience :: Developers", + "License :: OSI Approved :: MIT License", + "Operating System :: OS Independent", + "Programming Language :: Python", + "Topic :: Software Development :: Libraries :: Application Frameworks", + "Topic :: Software Development :: Libraries :: Python Modules", + "Framework :: Django :: 3.2", + "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", +] +requires-python = ">=3.8" +dependencies = ["Django>=3.2,<5.1"] +dynamic = ["version"] +readme = "README.rst" + +[project.urls] +Homepage = "https://github.com/kaleissin/django-verification" + +[tool.hatch.build.targets.wheel] +only-packages = true +sources = ["src"] +only-include = ["src/verification"] + +[tool.hatch.version] +path = "src/verification/__init__.py" + +[tool.coverage.run] +branch = true + +[tool.coverage.report] +skip_empty = true +exclude_lines = [ + "pragma: no cover", + "def __repr__", + "if settings.DEBUG", + "assert False", + "raise AssertionError", + "raise NotImplemented", + "if 0:", + "if False:", + "if None:", + "if __name__ == .__main__.:", +] + +[tool.flake8] +exclude = ".*,__pycache__,docs,migrations,*.py?,static,templates,*.csv,*.json,build,dist" diff --git a/setup.cfg b/setup.cfg deleted file mode 100644 index 2b6d14b..0000000 --- a/setup.cfg +++ /dev/null @@ -1,62 +0,0 @@ -[metadata] -name = django-verification -version = 1.2.0 -description = Generalized app for two-step verification -long_description = file: README.rst -long_description_content_type = text/x-rst -url = https://github.com/kaleissin/django-verification -author_email = kaleissin@gmail.com -author = kaleissin -classifiers = - Development Status :: 4 - Beta - Environment :: Web Environment - Framework :: Django - Intended Audience :: Developers - License :: OSI Approved :: MIT License - Operating System :: OS Independent - Programming Language :: Python - Topic :: Software Development :: Libraries :: Application Frameworks - Topic :: Software Development :: Libraries :: Python Modules - Framework :: Django :: 3.2 - Programming Language :: Python :: 3 - Programming Language :: Python :: 3.6 - Programming Language :: Python :: 3.7 - Programming Language :: Python :: 3.8 - Programming Language :: Python :: 3.9 - -[options] -zip_safe = False -include_package_data = True -packages = verification -package_dir = - = src/ -platforms = ['any'], -install_requires = Django>=3.2,<4.0 -python_requires = >=3.6 - -[options.package_data] -* = *.rst - -[options.packages.find] -exclude = tests -where = ./src/ - -[coverage:run] -branch = True - -[coverage:report] -skip_empty = True -exclude_lines = - pragma: no cover - def __repr__ - if settings.DEBUG - assert False - raise AssertionError - raise NotImplemented - if 0: - if False: - if None: - if __name__ == .__main__.: - -[flake8] -exclude = .*,__pycache__,docs,migrations,*.py?,static,templates,*.csv,*.json,build,dist diff --git a/setup.py b/setup.py deleted file mode 100644 index dd4e63e..0000000 --- a/setup.py +++ /dev/null @@ -1,6 +0,0 @@ -#!/usr/bin/env python - -from setuptools import setup - - -setup() diff --git a/src/verification/__init__.py b/src/verification/__init__.py index 9c7d02b..c68196d 100644 --- a/src/verification/__init__.py +++ b/src/verification/__init__.py @@ -1 +1 @@ -default_app_config = 'verification.apps.VerificationConfig' +__version__ = "1.2.0" diff --git a/src/verification/signals.py b/src/verification/signals.py index f235943..6476736 100644 --- a/src/verification/signals.py +++ b/src/verification/signals.py @@ -4,4 +4,5 @@ __all__ = ['key_claimed'] -key_claimed = django.dispatch.Signal(providing_args=["claimant", "group"]) +# provides args "claimant", "group" +key_claimed = django.dispatch.Signal() diff --git a/tox.ini b/tox.ini index 21cf76e..7b0da1c 100644 --- a/tox.ini +++ b/tox.ini @@ -1,16 +1,24 @@ [tox] +isolated_build = true envlist = - py{36,37,38,39}-django{32} + py{38,39,310}-django{32} + py{38,39,310,311,312}-django{42} + py{310,311,312}-django{50} [gh-actions] python = 3.8: py38 3.9: py39 + 3.10: py310 + 3.11: py311 + 3.12: py312 [testenv] -setenv = - PYTHONPATH = {toxinidir}/src +# setenv = +# PYTHONPATH = {toxinidir}/src commands = python runtests.py deps = - django32: django>=3.2,<4.0 + django32: django>=3.2,<4 + django42: django>=4.2,<5 + django50: django>=5.0,<5.1