Skip to content

Commit a222a74

Browse files
committed
Make it build
1 parent ec23dc1 commit a222a74

File tree

4 files changed

+63
-49
lines changed

4 files changed

+63
-49
lines changed

.pre-commit-config.yaml

+4-4
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ repos:
1414
- id: mixed-line-ending
1515
- id: trailing-whitespace
1616
- repo: https://github.com/adamchainz/django-upgrade
17-
rev: 1.16.0
17+
rev: 1.18.0
1818
hooks:
1919
- id: django-upgrade
2020
args: [--target-version, "3.2"]
@@ -23,7 +23,7 @@ repos:
2323
hooks:
2424
- id: absolufy-imports
2525
- repo: https://github.com/astral-sh/ruff-pre-commit
26-
rev: "v0.4.1"
26+
rev: "v0.4.7"
2727
hooks:
2828
- id: ruff
2929
- id: ruff-format
@@ -34,10 +34,10 @@ repos:
3434
args: [--list-different, --no-semi]
3535
exclude: "^conf/|.*\\.html$"
3636
- repo: https://github.com/tox-dev/pyproject-fmt
37-
rev: 1.8.0
37+
rev: 2.1.3
3838
hooks:
3939
- id: pyproject-fmt
4040
- repo: https://github.com/abravalheri/validate-pyproject
41-
rev: v0.16
41+
rev: v0.18
4242
hooks:
4343
- id: validate-pyproject

.readthedocs.yaml

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Read the Docs configuration file
2+
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details
3+
4+
version: 2
5+
6+
build:
7+
os: ubuntu-22.04
8+
tools:
9+
python: "3.11"
10+
11+
sphinx:
12+
configuration: docs/conf.py
13+
# python:
14+
# install:
15+
# - requirements: docs/requirements.txt
16+
# - method: pip
17+
# path: .

pyproject.toml

+41-44
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ requires = [
88
name = "django-tree-queries"
99
description = "Tree queries with explicit opt-in, without configurability"
1010
readme = "README.rst"
11-
license = {text = "BSD-3-Clause"}
11+
license = { text = "BSD-3-Clause" }
1212
authors = [
13-
{ name = "Matthias Kestenholz", email = "[email protected]" },
13+
{ name = "Matthias Kestenholz", email = "[email protected]" },
1414
]
1515
requires-python = ">=3.8"
1616
classifiers = [
@@ -32,82 +32,79 @@ classifiers = [
3232
dynamic = [
3333
"version",
3434
]
35-
[project.optional-dependencies]
36-
tests = [
35+
optional-dependencies.tests = [
3736
"coverage",
3837
]
39-
[project.urls]
40-
Homepage = "https://github.com/matthiask/django-tree-queries/"
38+
urls.Homepage = "https://github.com/matthiask/django-tree-queries/"
4139

4240
[tool.hatch.build]
43-
include = ["tree_queries/"]
41+
include = [
42+
"tree_queries/",
43+
]
4444

4545
[tool.hatch.version]
4646
path = "tree_queries/__init__.py"
4747

4848
[tool.ruff]
49-
fix = true
50-
preview = true
51-
show-fixes = true
5249
target-version = "py38"
5350

54-
[tool.ruff.lint]
55-
extend-select = [
56-
# pyflakes, pycodestyle
57-
"F", "E", "W",
58-
# mmcabe
59-
"C90",
60-
# isort
61-
"I",
62-
# pep8-naming
63-
"N",
64-
# pyupgrade
65-
"UP",
66-
# flake8-2020
67-
"YTT",
68-
# flake8-boolean-trap
69-
"FBT",
70-
# flake8-bugbear
71-
"B",
51+
preview = true
52+
fix = true
53+
show-fixes = true
54+
lint.extend-select = [
7255
# flake8-builtins
7356
"A",
57+
# flake8-bugbear
58+
"B",
7459
# flake8-comprehensions
7560
"C4",
61+
# mmcabe
62+
"C90",
7663
# flake8-django
7764
"DJ",
65+
"E",
66+
# pyflakes, pycodestyle
67+
"F",
68+
# flake8-boolean-trap
69+
"FBT",
7870
# flake8-logging-format
7971
"G",
80-
# flake8-pie
81-
"PIE",
82-
# flake8-simplify
83-
"SIM",
72+
# isort
73+
"I",
8474
# flake8-gettext
8575
"INT",
76+
# pep8-naming
77+
"N",
8678
# pygrep-hooks
8779
"PGH",
80+
# flake8-pie
81+
"PIE",
8882
# pylint
89-
"PLC", "PLE", "PLW",
83+
"PLC",
84+
"PLE",
85+
"PLW",
9086
# unused noqa
9187
"RUF100",
88+
# flake8-simplify
89+
"SIM",
90+
# pyupgrade
91+
"UP",
92+
"W",
93+
# flake8-2020
94+
"YTT",
9295
]
93-
extend-ignore = [
96+
lint.extend-ignore = [
9497
# Allow zip() without strict=
9598
"B905",
9699
# No line length errors
97100
"E501",
98101
]
99-
100-
[tool.ruff.lint.isort]
101-
combine-as-imports = true
102-
lines-after-imports = 2
103-
104-
[tool.ruff.lint.mccabe]
105-
max-complexity = 15
106-
107-
[tool.ruff.lint.per-file-ignores]
108-
"*/migrat*/*" = [
102+
lint.per-file-ignores."*/migrat*/*" = [
109103
# Allow using PascalCase model names in migrations
110104
"N806",
111105
# Ignore the fact that migration files are invalid module names
112106
"N999",
113107
]
108+
lint.isort.combine-as-imports = true
109+
lint.isort.lines-after-imports = 2
110+
lint.mccabe.max-complexity = 15

tests/testapp/settings.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
DATABASES = {
55
"default": {
6-
"ENGINE": "django.db.backends.%s" % os.getenv("DB_BACKEND", "sqlite3"),
6+
"ENGINE": f'django.db.backends.{os.getenv("DB_BACKEND", "sqlite3")}',
77
"NAME": os.getenv("DB_NAME", ":memory:"),
88
"USER": os.getenv("DB_USER"),
99
"PASSWORD": os.getenv("DB_PASSWORD"),

0 commit comments

Comments
 (0)