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

Switch to pyproject.toml, drop support for Django 4.1 #87

Merged
merged 10 commits into from
Feb 26, 2024
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
18 changes: 0 additions & 18 deletions .bumpversion.cfg

This file was deleted.

4 changes: 4 additions & 0 deletions .flake8
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[flake8]
ignore=W293,W291,E501,E261
max-line-length=88
exclude=env,.tox
8 changes: 4 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
strategy:
matrix:
python: ['3.10', '3.11']
django: ['3.2', '4.1', '4.2']
django: ['3.2', '4.2']
exclude:
- python: '3.11'
django: '3.2'
Expand Down Expand Up @@ -76,10 +76,10 @@ jobs:
with:
python-version: '3.10'

- name: Build sdist and wheel
- name: Build wheel
run: |
pip install pip setuptools wheel --upgrade
python setup.py sdist bdist_wheel
pip install build --upgrade
python -m build

- name: Publish a Python distribution to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright {% now "Y" %} Maykin Media
Copyright 2022 Maykin Media

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

Expand Down
1 change: 0 additions & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ Requirements
------------

* Python 3.10 or newer
* setuptools 30.3.0 or newer
* Django 3.2 or newer


Expand Down
132 changes: 132 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,132 @@
[build-system]
requires = ["setuptools>=61.0.0"]
build-backend = "setuptools.build_meta"

[project]
name = "zgw-consumers"
version = "0.30.0"
description = "Configuration for service (OpenAPI 3 or other) consumers"
authors = [
{name = "Maykin Media", email = "[email protected]"}
]
readme = "README.rst"
license = {file = "LICENSE"}
keywords = ["Django", "ZGW", "Common Ground", "VNG", "API", "OpenAPI", "OAS", "mTLS"]
classifiers = [
"Development Status :: 5 - Production/Stable",
"Framework :: Django",
"Framework :: Django :: 3.2",
"Framework :: Django :: 4.2",
"Intended Audience :: Developers",
"Operating System :: Unix",
"Operating System :: MacOS",
"Operating System :: Microsoft :: Windows",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Topic :: Software Development :: Libraries :: Python Modules",
]
requires-python = ">=3.10"
dependencies = [
"django>=3.2",
"django-relativedelta>=2.0.0",
"django-solo",
"gemma-zds-client>=2.0.0",
"django-simple-certmanager>=1.4.1",
"requests",
"ape-pie",
]

[project.urls]
Homepage = "https://github.com/maykinmedia/zgw-consumers"
Documentation = "https://zgw-consumers.readthedocs.io/en/latest/"
"Bug Tracker" = "https://github.com/maykinmedia/zgw-consumers/issues"
"Source Code" = "https://github.com/maykinmedia/zgw-consumers"
Changelog = "https://github.com/maykinmedia/zgw-consumers/blob/main/CHANGELOG.rst"

[project.optional-dependencies]
db = [
"psycopg2",
]
drf = [
"djangorestframework",
]
# These are not the test requirements! They are extras to be installed when making use of `zgw_consumers.test`
testutils = [
"Faker>=0.7.0",
"factory-boy",
"requests-mock",
]
tests = [
"django-redis",
"pytest",
"pytest-django",
"requests-mock",
"freezegun",
"tox",
"isort",
"black",
"flake8",
"tabulate",
"pyquery",
]
coverage = [
"pytest-cov",
]
docs = [
"sphinx",
"sphinx-rtd-theme",
]
release = [
"bump-my-version",
]

[tool.setuptools.packages.find]
include = ["zgw_consumers*"]
namespaces = false

[tool.isort]
profile = "black"
combine_as_imports = true
known_django = "django"
known_first_party="zgw_consumers"
sections=["FUTURE", "STDLIB", "DJANGO", "THIRDPARTY", "FIRSTPARTY", "LOCALFOLDER"]
Viicos marked this conversation as resolved.
Show resolved Hide resolved
skip = ["env", ".tox", ".history"]

[tool.pytest.ini_options]
testpaths = ["tests"]
DJANGO_SETTINGS_MODULE = "testapp.settings"

[tool.bumpversion]
current_version = "0.30.0"
files = [
{filename = "pyproject.toml"},
{filename = "README.rst"},
{filename = "zgw_consumers/locale/nl/LC_MESSAGES/django.po"},
{filename = "docs/conf.py"},
]

[tool.coverage.run]
branch = true
source = [
"zgw_consumers"
]
omit = [
"zgw_consumers/migrations/*",
]

[tool.coverage.report]
exclude_also = [
"if (typing\\.)?TYPE_CHECKING:",
"@(typing\\.)?overload",
"class .*\\(.*Protocol.*\\):",
"@(abc\\.)?abstractmethod",
"raise NotImplementedError",
"\\.\\.\\.",
"pass",
]
omit = [
"zgw_consumers/migrations/*",
]

[tool.coverage.html]
directory = "cover"
134 changes: 0 additions & 134 deletions setup.cfg

This file was deleted.

3 changes: 0 additions & 3 deletions setup.py

This file was deleted.

16 changes: 6 additions & 10 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[tox]
envlist =
py{310,311}-django{32,41,42}
py311-django{41,42}
py310-django{32,42}
py311-django42
isort
black
flake8
Expand All @@ -16,7 +16,6 @@ python =
[gh-actions:env]
DJANGO =
3.2: django32
4.1: django41
4.2: django42

[testenv]
Expand All @@ -36,11 +35,9 @@ extras =
coverage
deps =
django32: Django~=3.2.0
django41: Django~=4.1.0
django42: Django~=4.2.0
commands =
py.test -s tests \
--junitxml=reports/junit.xml \
pytest -s tests \
--cov --cov-report xml:reports/coverage-{envname}.xml \
{posargs}

Expand All @@ -52,12 +49,12 @@ commands = isort --check-only --diff .
[testenv:black]
extras = tests
skipsdist = True
commands = black --check --diff zgw_consumers tests testapp setup.py
commands = black --check --diff zgw_consumers tests testapp

[testenv:flake8]
extras = tests
skipsdist = True
commands = flake8 zgw_consumers tests testapp setup.py
commands = flake8 zgw_consumers tests testapp

[testenv:docs]
basepython=python
Expand All @@ -70,7 +67,6 @@ extras =
drf
docs
commands=
py.test check_sphinx.py -v \
--junitxml=../reports/junit-{envname}.xml \
pytest check_sphinx.py -v \
--tb=auto \
{posargs}
2 changes: 1 addition & 1 deletion zgw_consumers/legacy/service.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def get_paginated_results(
minimum: Optional[int] = None,
test_func: Optional[callable] = None,
*args,
**kwargs
**kwargs,
) -> list:
request_kwargs = kwargs.get("request_kwargs", {})
request_params = request_kwargs.get("params", {})
Expand Down