diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 0f399c1..bd99c74 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -14,7 +14,7 @@ repos: - id: mixed-line-ending - id: trailing-whitespace - repo: https://github.com/adamchainz/django-upgrade - rev: 1.16.0 + rev: 1.18.0 hooks: - id: django-upgrade args: [--target-version, "3.2"] @@ -23,7 +23,7 @@ repos: hooks: - id: absolufy-imports - repo: https://github.com/astral-sh/ruff-pre-commit - rev: "v0.4.1" + rev: "v0.4.7" hooks: - id: ruff - id: ruff-format @@ -34,10 +34,10 @@ repos: args: [--list-different, --no-semi] exclude: "^conf/|.*\\.html$" - repo: https://github.com/tox-dev/pyproject-fmt - rev: 1.8.0 + rev: 2.1.3 hooks: - id: pyproject-fmt - repo: https://github.com/abravalheri/validate-pyproject - rev: v0.16 + rev: v0.18 hooks: - id: validate-pyproject diff --git a/.readthedocs.yaml b/.readthedocs.yaml new file mode 100644 index 0000000..b2da4c0 --- /dev/null +++ b/.readthedocs.yaml @@ -0,0 +1,17 @@ +# Read the Docs configuration file +# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details + +version: 2 + +build: + os: ubuntu-22.04 + tools: + python: "3.11" + +sphinx: + configuration: docs/conf.py +# python: +# install: +# - requirements: docs/requirements.txt +# - method: pip +# path: . diff --git a/pyproject.toml b/pyproject.toml index a5d782d..83051bd 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -8,9 +8,9 @@ requires = [ name = "django-tree-queries" description = "Tree queries with explicit opt-in, without configurability" readme = "README.rst" -license = {text = "BSD-3-Clause"} +license = { text = "BSD-3-Clause" } authors = [ - { name = "Matthias Kestenholz", email = "mk@feinheit.ch" }, + { name = "Matthias Kestenholz", email = "mk@feinheit.ch" }, ] requires-python = ">=3.8" classifiers = [ @@ -32,82 +32,79 @@ classifiers = [ dynamic = [ "version", ] -[project.optional-dependencies] -tests = [ +optional-dependencies.tests = [ "coverage", ] -[project.urls] -Homepage = "https://github.com/matthiask/django-tree-queries/" +urls.Homepage = "https://github.com/matthiask/django-tree-queries/" [tool.hatch.build] -include = ["tree_queries/"] +include = [ + "tree_queries/", +] [tool.hatch.version] path = "tree_queries/__init__.py" [tool.ruff] -fix = true -preview = true -show-fixes = true target-version = "py38" -[tool.ruff.lint] -extend-select = [ - # pyflakes, pycodestyle - "F", "E", "W", - # mmcabe - "C90", - # isort - "I", - # pep8-naming - "N", - # pyupgrade - "UP", - # flake8-2020 - "YTT", - # flake8-boolean-trap - "FBT", - # flake8-bugbear - "B", +preview = true +fix = true +show-fixes = true +lint.extend-select = [ # flake8-builtins "A", + # flake8-bugbear + "B", # flake8-comprehensions "C4", + # mmcabe + "C90", # flake8-django "DJ", + "E", + # pyflakes, pycodestyle + "F", + # flake8-boolean-trap + "FBT", # flake8-logging-format "G", - # flake8-pie - "PIE", - # flake8-simplify - "SIM", + # isort + "I", # flake8-gettext "INT", + # pep8-naming + "N", # pygrep-hooks "PGH", + # flake8-pie + "PIE", # pylint - "PLC", "PLE", "PLW", + "PLC", + "PLE", + "PLW", # unused noqa "RUF100", + # flake8-simplify + "SIM", + # pyupgrade + "UP", + "W", + # flake8-2020 + "YTT", ] -extend-ignore = [ +lint.extend-ignore = [ # Allow zip() without strict= "B905", # No line length errors "E501", ] - -[tool.ruff.lint.isort] -combine-as-imports = true -lines-after-imports = 2 - -[tool.ruff.lint.mccabe] -max-complexity = 15 - -[tool.ruff.lint.per-file-ignores] -"*/migrat*/*" = [ +lint.per-file-ignores."*/migrat*/*" = [ # Allow using PascalCase model names in migrations "N806", # Ignore the fact that migration files are invalid module names "N999", ] +lint.isort.combine-as-imports = true +lint.isort.lines-after-imports = 2 +lint.mccabe.max-complexity = 15 diff --git a/tests/testapp/settings.py b/tests/testapp/settings.py index aaa413a..774591f 100644 --- a/tests/testapp/settings.py +++ b/tests/testapp/settings.py @@ -3,7 +3,7 @@ DATABASES = { "default": { - "ENGINE": "django.db.backends.%s" % os.getenv("DB_BACKEND", "sqlite3"), + "ENGINE": f'django.db.backends.{os.getenv("DB_BACKEND", "sqlite3")}', "NAME": os.getenv("DB_NAME", ":memory:"), "USER": os.getenv("DB_USER"), "PASSWORD": os.getenv("DB_PASSWORD"),