From 6722cfd43d466aadc04d0814f9b9369f2281f3db Mon Sep 17 00:00:00 2001 From: Hugo van Kemenade Date: Wed, 2 Nov 2022 23:56:03 +0200 Subject: [PATCH 1/3] Fix and validate pyproject.toml --- .pre-commit-config.yaml | 5 +++++ pyproject.toml | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 506b2deff..e7ac083e7 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -2,6 +2,7 @@ repos: - repo: https://github.com/pre-commit/pre-commit-hooks rev: v4.3.0 hooks: + - id: check-toml - id: check-yaml - id: end-of-file-fixer - id: trailing-whitespace @@ -58,3 +59,7 @@ repos: - id: black language_version: python3 entry: black --target-version=py37 +- repo: https://github.com/abravalheri/validate-pyproject + rev: v0.10.1 + hooks: + - id: validate-pyproject diff --git a/pyproject.toml b/pyproject.toml index 42f3c1b64..d8b287c39 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -7,7 +7,7 @@ name = "django-debug-toolbar" dynamic = ["version"] description = "A configurable set of panels that display various debug information about the current request/response." readme = "README.rst" -license = "BSD-3-Clause" +license = {text = "BSD-3-Clause"} requires-python = ">=3.7" authors = [ { name = "Rob Hudson", email = "rob@cogit8.org" }, From 9e78621446cd2d94c8160f3b9d2ef1607aed5860 Mon Sep 17 00:00:00 2001 From: Hugo van Kemenade Date: Wed, 2 Nov 2022 23:57:55 +0200 Subject: [PATCH 2/3] Format pyproject.toml with pyproject-fmt --- .pre-commit-config.yaml | 4 ++++ pyproject.toml | 22 +++++++++++++--------- 2 files changed, 17 insertions(+), 9 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index e7ac083e7..ee93dd39e 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -59,6 +59,10 @@ repos: - id: black language_version: python3 entry: black --target-version=py37 +- repo: https://github.com/tox-dev/pyproject-fmt + rev: 0.3.5 + hooks: + - id: pyproject-fmt - repo: https://github.com/abravalheri/validate-pyproject rev: v0.10.1 hooks: diff --git a/pyproject.toml b/pyproject.toml index d8b287c39..f24a27505 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,17 +1,25 @@ [build-system] -requires = ["hatchling"] build-backend = "hatchling.build" +requires = [ + "hatchling", +] [project] -name = "django-debug-toolbar" -dynamic = ["version"] +name = "django_debug_toolbar" description = "A configurable set of panels that display various debug information about the current request/response." readme = "README.rst" license = {text = "BSD-3-Clause"} -requires-python = ">=3.7" authors = [ { name = "Rob Hudson", email = "rob@cogit8.org" }, ] +requires-python = ">=3.7" +dependencies = [ + "Django>=3.2.4", + "sqlparse>=0.2", +] +dynamic = [ + "version", +] classifiers = [ "Development Status :: 5 - Production/Stable", "Environment :: Web Environment", @@ -31,15 +39,11 @@ classifiers = [ "Programming Language :: Python :: 3.10", "Topic :: Software Development :: Libraries :: Python Modules", ] -dependencies = [ - "Django >= 3.2.4", - "sqlparse >= 0.2.0", -] - [project.urls] Download = "https://pypi.org/project/django-debug-toolbar/" Homepage = "https://github.com/jazzband/django-debug-toolbar" + [tool.hatch.version] path = "debug_toolbar/__init__.py" From 609792fba3d3eb8bba526a9bc0446031720b0e6e Mon Sep 17 00:00:00 2001 From: Hugo van Kemenade Date: Thu, 3 Nov 2022 00:00:26 +0200 Subject: [PATCH 3/3] Sort [tool] sections alphabetically --- pyproject.toml | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index f24a27505..1e9ee45eb 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -44,21 +44,9 @@ Download = "https://pypi.org/project/django-debug-toolbar/" Homepage = "https://github.com/jazzband/django-debug-toolbar" -[tool.hatch.version] -path = "debug_toolbar/__init__.py" - -[tool.hatch.build.targets.wheel] -packages = ["debug_toolbar"] - -[tool.hatch.build.targets.sdist] -include = [ - "/debug_toolbar", - "/CONTRIBUTING.md", -] - -[tool.isort] -combine_as_imports = true -profile = "black" +[tool.coverage.html] +skip_covered = true +skip_empty = true [tool.coverage.run] branch = true @@ -73,6 +61,18 @@ source = ["src", ".tox/*/site-packages"] fail_under = 93 show_missing = true -[tool.coverage.html] -skip_covered = true -skip_empty = true +[tool.hatch.build.targets.sdist] +include = [ + "/debug_toolbar", + "/CONTRIBUTING.md", +] + +[tool.hatch.build.targets.wheel] +packages = ["debug_toolbar"] + +[tool.hatch.version] +path = "debug_toolbar/__init__.py" + +[tool.isort] +combine_as_imports = true +profile = "black"