Skip to content

Commit

Permalink
Make it build
Browse files Browse the repository at this point in the history
  • Loading branch information
matthiask committed Jun 3, 2024
1 parent ec23dc1 commit a222a74
Show file tree
Hide file tree
Showing 4 changed files with 63 additions and 49 deletions.
8 changes: 4 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
Expand All @@ -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
Expand All @@ -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
17 changes: 17 additions & 0 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
@@ -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: .
85 changes: 41 additions & 44 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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 = "[email protected]" },
{ name = "Matthias Kestenholz", email = "[email protected]" },
]
requires-python = ">=3.8"
classifiers = [
Expand All @@ -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
2 changes: 1 addition & 1 deletion tests/testapp/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"),
Expand Down

0 comments on commit a222a74

Please sign in to comment.