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

Move package configuration to pyproject.toml #124

Merged
merged 1 commit into from
May 10, 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
6 changes: 2 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,7 @@ jobs:

- name: Install dependencies
run: |
python -m pip install -U pip
python -m pip install -U setuptools twine wheel
python -m pip install build twine

- uses: ./.github/actions/build-js
with:
Expand All @@ -37,8 +36,7 @@ jobs:

- name: Build package
run: |
python setup.py --version
python setup.py sdist --format=gztar bdist_wheel
python -m build
twine check dist/*

- name: Upload packages to Jazzband private PyPI
Expand Down
111 changes: 111 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
[build-system]
requires = ["setuptools>=61.0.0"]
build-backend = "setuptools.build_meta"

[project]
name = "django-cookie-consent"
version = "0.5.0b0"
description = "Django cookie consent application"
authors = [
{name = "Informatika Mihelac", email = "[email protected]"}
]
readme = "README.md"
license = {file = "LICENSE"}
keywords = ["cookies", "cookie-consent", "cookie bar"]
classifiers = [
"Development Status :: 4 - Beta",
"Framework :: Django",
"Framework :: Django :: 4.2",
"Framework :: Django :: 5.0",
"Intended Audience :: Developers",
"License :: OSI Approved :: BSD License",
"Operating System :: Unix",
"Operating System :: MacOS",
"Operating System :: Microsoft :: Windows",
"Operating System :: OS Independent",
"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",
"Topic :: Software Development :: Libraries :: Python Modules",
]
requires-python = ">=3.8"
dependencies = [
"django>=4.2",
"django-appconf",
]

[project.urls]
Documentation = "https://django-cookie-consent.readthedocs.io/en/latest/"
Changelog = "https://github.com/jazzband/django-cookie-consent/blob/master/docs/changelog.rst"
"Bug Tracker" = "https://github.com/jazzband/django-cookie-consent/issues"
"Source Code" = "https://github.com/jazzband/django-cookie-consent"

[project.optional-dependencies]
tests = [
"pytest",
"pytest-django",
"pytest-playwright",
"tox",
"isort",
"black",
"flake8",
]
coverage = [
"pytest-cov",
]
docs = [
"sphinx",
"sphinx-rtd-theme",
]
release = [
"tbump",
]

[tool.setuptools.packages.find]
include = ["cookie_consent*"]
namespaces = true

[tool.isort]
profile = "black"
combine_as_imports = true
skip = ["env", ".tox", ".history", ".eggs"]
known_django = "django"
known_first_party="cookie_consent"
sections=["FUTURE", "STDLIB", "DJANGO", "THIRDPARTY", "FIRSTPARTY", "LOCALFOLDER"]

[tool.pytest.ini_options]
testpaths = ["tests"]
DJANGO_SETTINGS_MODULE = "testapp.settings"
markers = [
"e2e: mark tests as end-to-end tests, using playwright (deselect with '-m \"not e2e\"')",
]

[tool.bumpversion]
current_version = "0.1.0"
files = [
{filename = "pyproject.toml"},
{filename = "README.rst"},
{filename = "docs/conf.py"},
]

[tool.coverage.run]
branch = true
source = ["cookie_consent"]
omit = [
# migrations run while django initializes the test db
"*/migrations/*",
]

[tool.coverage.report]
skip_covered = true
exclude_also = [
"if (typing\\.)?TYPE_CHECKING:",
"@(typing\\.)?overload",
"class .*\\(.*Protocol.*\\):",
"@(abc\\.)?abstractmethod",
"raise NotImplementedError",
"\\.\\.\\.",
"pass",
]
110 changes: 0 additions & 110 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -1,114 +1,4 @@
# setuptools config
# see http://setuptools.readthedocs.io/en/latest/setuptools.html#configuring-setup-using-setup-cfg-files
[metadata]
name = django-cookie-consent
version = 0.5.0b0
description = Django cookie consent application
long_description = file: README.md
long_description_content_type = text/markdown
url = https://github.com/jazzband/django-cookie-consent
project_urls =
Documentation = https://django-cookie-consent.readthedocs.io/en/latest/
Changelog = https://github.com/jazzband/django-cookie-consent/blob/master/docs/changelog.rst
Bug Tracker = https://github.com/jazzband/django-cookie-consent/issues
Source Code = https://github.com/jazzband/django-cookie-consent
license = BSD
author = Informatika Mihelac
author_email = [email protected]
keywords = cookies, cookie-consent, cookie bar
classifiers =
Development Status :: 4 - Beta
Framework :: Django
Framework :: Django :: 4.2
Framework :: Django :: 5.0
Intended Audience :: Developers
License :: OSI Approved :: BSD License
Operating System :: Unix
Operating System :: MacOS
Operating System :: Microsoft :: Windows
Operating System :: OS Independent
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
Topic :: Software Development :: Libraries :: Python Modules

[options]
zip_safe = False
include_package_data = True
packages = find:
install_requires =
django >= 4.2
django-appconf
tests_require =
pytest
pytest-django
pytest-playwright
tox
isort
black
flake8

[options.packages.find]
include =
cookie_consent
cookie_consent.*

[options.extras_require]
tests =
pytest
pytest-django
pytest-playwright
tox
isort
black
flake8
pep8 = flake8
coverage = pytest-cov
docs =
sphinx
sphinx-rtd-theme
release =
tbump
twine

# 3rd party configuration

[aliases]
test=pytest

[isort]
combine_as_imports = true
default_section = THIRDPARTY
include_trailing_comma = true
line_length = 88
multi_line_output = 3
force_grid_wrap = 0
use_parentheses = True
ensure_newline_before_comments = True
skip = env,.tox,.history,.eggs
known_django=django
known_first_party=cookie_consent
sections=FUTURE,STDLIB,DJANGO,THIRDPARTY,FIRSTPARTY,LOCALFOLDER

[tool:pytest]
testpaths = tests
DJANGO_SETTINGS_MODULE=testapp.settings
markers =
e2e: mark tests as end-to-end tests, using playwright (deselect with '-m "not e2e"')

[pep8]
[flake8]
max-line-length=88
exclude=env,.tox,docs

[coverage:run]
branch = True
source = cookie_consent
omit =
# migrations run while django initializes the test db
*/migrations/*

[coverage:report]
skip_covered = True
3 changes: 0 additions & 3 deletions setup.py

This file was deleted.

2 changes: 1 addition & 1 deletion tbump.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ message_template = ":bookmark: Bump to {new_version}"
tag_template = "{new_version}"

[[file]]
src = "setup.cfg"
src = "pyproject.toml"
version_template = "{major}.{minor}.{patch}{pre}"

[[file]]
Expand Down
2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ commands = isort --check-only --diff .
[testenv:black]
extras = tests
skipsdist = True
commands = black --check cookie_consent docs tests testapp setup.py
commands = black --check cookie_consent docs tests testapp

[testenv:flake8]
extras = tests
Expand Down
Loading