2020-08-03 20:19:42 +02:00
|
|
|
[build-system]
|
|
|
|
|
|
2026-11-25 15:54:16 +01:00
|
|
|
build-backend = "uv_build"
|
2026-11-27 13:38:31 +01:00
|
|
|
|
|
|
|
|
requires = ["uv_build (>=0.13.10,<0.14.0)"] # Same range as in "[tool.uv]" below
|
2026-11-24 11:58:26 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[project]
|
2020-08-03 21:39:49 +02:00
|
|
|
|
2026-11-23 18:06:53 +01:00
|
|
|
name = "velofy"
|
2021-09-13 11:21:20 +02:00
|
|
|
version = "0.5.0.dev0"
|
2020-08-03 20:19:42 +02:00
|
|
|
|
2026-11-24 11:58:26 +01:00
|
|
|
authors = [{ name = "Alexander Hess", email = "alexander@webartifex.de" }]
|
|
|
|
|
|
2020-08-03 20:19:42 +02:00
|
|
|
description = "Optimizing an urban meal delivery platform"
|
2026-11-24 11:58:26 +01:00
|
|
|
|
2020-08-03 20:19:42 +02:00
|
|
|
keywords = [
|
|
|
|
|
"data-science",
|
|
|
|
|
"meal-delivery",
|
|
|
|
|
"vehicle-routing-problem",
|
|
|
|
|
]
|
2026-11-24 11:58:26 +01:00
|
|
|
|
2020-08-03 20:19:42 +02:00
|
|
|
license = "MIT"
|
|
|
|
|
|
|
|
|
|
readme = "README.md"
|
|
|
|
|
|
2026-11-25 16:47:53 +01:00
|
|
|
classifiers = [
|
2026-12-03 11:01:12 +01:00
|
|
|
# `nox` loads all `SUPPORTED_PYTHONS` listed here
|
|
|
|
|
# => The test suite runs with each of them in isolated environments
|
2026-12-02 17:42:43 +01:00
|
|
|
"Programming Language :: Python :: 3.14",
|
|
|
|
|
"Programming Language :: Python :: 3.15",
|
2026-11-25 16:47:53 +01:00
|
|
|
]
|
|
|
|
|
|
2026-12-03 13:02:41 +01:00
|
|
|
requires-python = ">=3.14,<4.0"
|
2020-08-03 20:19:42 +02:00
|
|
|
|
2026-11-24 11:58:26 +01:00
|
|
|
|
|
|
|
|
# Package => Code developed in *.py files and packaged under src/velofy
|
|
|
|
|
dependencies = [
|
2026-11-25 15:59:53 +01:00
|
|
|
"Shapely (>=2.2.0,<3.0.0)",
|
|
|
|
|
"alembic (>=1.20.1,<2.0.0)",
|
|
|
|
|
"click (>=8.5.1,<9.0.0)",
|
|
|
|
|
"folium (>=1.0.0,<2.0.0)",
|
|
|
|
|
"geopy (>=2.5.0,<3.0.0)",
|
|
|
|
|
"googlemaps (>=4.10.0,<5.0.0)",
|
|
|
|
|
"matplotlib (>=3.11.2,<4.0.0)",
|
|
|
|
|
"ordered-set (>=4.1.0,<5.0.0)",
|
|
|
|
|
"pandas (>=3.1.1,<4.0.0)",
|
|
|
|
|
"psycopg[binary] (>=3.3.9,<4.0.0)", # Adapter for PostgreSQL
|
|
|
|
|
"rpy2 (>=3.6.9,<4.0.0)",
|
|
|
|
|
"sqlalchemy (>=2.1.9,<3.0.0)",
|
|
|
|
|
"statsmodels (>=0.15.0,<0.16.0)",
|
|
|
|
|
"utm (>=0.9.0,<0.10.0)",
|
2026-11-24 11:58:26 +01:00
|
|
|
]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[project.optional-dependencies]
|
|
|
|
|
|
|
|
|
|
# `jupyter lab` => Notebooks with analyses using the developed package
|
2020-08-11 10:50:29 +02:00
|
|
|
research = [
|
2026-11-25 15:59:53 +01:00
|
|
|
"jupyterlab (>=4.6.6,<5.0.0)",
|
|
|
|
|
"numpy (>=2.5.5,<3.0.0)",
|
|
|
|
|
"pytz (>=2026.6)",
|
2020-08-11 10:50:29 +02:00
|
|
|
]
|
|
|
|
|
|
2026-11-24 11:58:26 +01:00
|
|
|
|
|
|
|
|
[project.scripts]
|
|
|
|
|
|
|
|
|
|
manage = "velofy.console:cli"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[project.urls]
|
|
|
|
|
|
|
|
|
|
homepage = "https://code.webartifex.de/alexander/velofy"
|
|
|
|
|
repository = "https://code.webartifex.de/alexander/velofy"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2026-11-25 15:54:16 +01:00
|
|
|
[dependency-groups]
|
|
|
|
|
|
|
|
|
|
dev = [
|
|
|
|
|
# Task Runners
|
2026-11-25 15:59:53 +01:00
|
|
|
"nox (>=2026.10.20)",
|
|
|
|
|
"pre-commit (>=4.7.0,<5.0.0)",
|
2026-11-25 15:54:16 +01:00
|
|
|
|
|
|
|
|
# Code Formatters
|
2026-11-25 15:59:53 +01:00
|
|
|
"autoflake (>=2.4.0,<3.0.0)",
|
2026-12-01 00:17:46 +01:00
|
|
|
"black (>=25.12.0,<26.0.0)", # v26 enforces one blank line after imports but we want two
|
2026-11-28 04:49:05 +01:00
|
|
|
"flynt (>=1.0.6,<2.0.0)",
|
2026-11-25 15:59:53 +01:00
|
|
|
"isort (>=9.0.2,<10.0.0)",
|
2026-11-25 15:54:16 +01:00
|
|
|
|
|
|
|
|
# Code Analyzers
|
2026-11-25 15:59:53 +01:00
|
|
|
"flake8 (>=7.5.0,<8.0.0)",
|
2026-11-30 23:43:49 +01:00
|
|
|
"flake8-2020 (>=1.8.1,<2.0.0)",
|
2026-11-25 15:59:53 +01:00
|
|
|
"flake8-annotations (>=3.3.1,<4.0.0)",
|
2026-11-28 02:17:51 +01:00
|
|
|
"flake8-bandit (>=4.1.1,<5.0.0)",
|
2026-11-25 15:59:53 +01:00
|
|
|
"flake8-black (>=0.5.0,<0.6.0)",
|
2026-11-30 22:43:35 +01:00
|
|
|
"flake8-boolean-trap (>=1.0.1,<2.0.0)",
|
2026-11-28 02:28:27 +01:00
|
|
|
"flake8-broken-line (>=1.0.0,<2.0.0)",
|
2026-11-28 02:39:58 +01:00
|
|
|
"flake8-bugbear (>=26.11.22,<27.0.0)",
|
2026-11-30 21:40:43 +01:00
|
|
|
"flake8-builtins (>=3.2.0,<4.0.0)",
|
2026-11-28 02:44:35 +01:00
|
|
|
"flake8-commas (>=4.0.0,<5.0.0)",
|
2026-11-28 02:49:56 +01:00
|
|
|
"flake8-comprehensions (>=3.17.0,<4.0.0)",
|
2026-11-28 02:51:04 +01:00
|
|
|
"flake8-debugger (>=4.1.2,<5.0.0)",
|
2026-11-28 03:04:38 +01:00
|
|
|
"flake8-docstrings (>=1.7.0,<2.0.0)",
|
2026-11-30 22:59:41 +01:00
|
|
|
"flake8-errmsg (>=0.7.0,<0.8.0)",
|
2026-11-30 23:37:54 +01:00
|
|
|
"flake8-executable (>=2.1.3,<3.0.0)",
|
2026-11-30 21:09:05 +01:00
|
|
|
"flake8-implicit-str-concat (>=0.7.0,<0.8.0)",
|
2026-11-30 23:38:43 +01:00
|
|
|
"flake8-logging (>=1.8.0,<2.0.0)",
|
2026-11-25 15:59:53 +01:00
|
|
|
"flake8-pyproject (>=1.2.4,<2.0.0)",
|
|
|
|
|
"flake8-pytest-style (>=2.2.0,<3.0.0)",
|
2026-11-28 03:21:46 +01:00
|
|
|
"flake8-quotes (>=3.4.0,<4.0.0)",
|
2026-11-30 23:41:00 +01:00
|
|
|
"flake8-raise (>=0.0.5,<0.1.0)",
|
2026-11-28 03:34:40 +01:00
|
|
|
"flake8-sfs (>=1.0.1,<2.0.0)",
|
2026-11-30 20:57:31 +01:00
|
|
|
"flake8-simplify (>=0.31.1,<0.32.0)",
|
2026-11-30 23:41:42 +01:00
|
|
|
"flake8-tidy-imports (>=4.12.0,<5.0.0)",
|
2026-11-28 03:37:25 +01:00
|
|
|
"flake8-todos (>=0.3.1,<0.4.0)",
|
2026-11-28 03:47:55 +01:00
|
|
|
"flake8-unused-arguments (>=0.0.14,<0.1.0)",
|
2026-11-25 15:59:53 +01:00
|
|
|
"mypy (>=2.4.1,<3.0.0)",
|
2026-12-01 00:31:21 +01:00
|
|
|
"pandas-stubs (>=3.1.0.261029,<4.0.0)",
|
2026-11-30 22:11:10 +01:00
|
|
|
"pandas-vet (>=2023.8.2)",
|
2026-11-28 03:54:17 +01:00
|
|
|
"pep8-naming (>=0.15.1,<0.16.0)",
|
2026-11-28 04:06:53 +01:00
|
|
|
"pydoclint[flake8] (>=0.12.0,<0.13.0)",
|
2026-12-01 15:00:26 +01:00
|
|
|
"pyright[nodejs] (>=1.1.414,<2.0.0)",
|
2026-11-28 04:37:02 +01:00
|
|
|
"ruff (>=0.17.6,<0.18.0)",
|
2026-11-30 23:42:08 +01:00
|
|
|
"tryceratops (>=2.4.1,<3.0.0)",
|
2026-11-25 15:54:16 +01:00
|
|
|
]
|
|
|
|
|
|
|
|
|
|
test = [
|
2026-11-25 15:59:53 +01:00
|
|
|
"factory-boy (>=3.3.3,<4.0.0)",
|
|
|
|
|
"Faker (>=40.63.0,<41.0.0)",
|
|
|
|
|
"packaging (>=26.4)", # Used to test the packaged version
|
|
|
|
|
"pytest-cov (>=7.1.0,<8.0.0)",
|
|
|
|
|
"pytest-env (>=1.8.8,<2.0.0)",
|
|
|
|
|
"pytest-mock (>=3.17.0,<4.0.0)",
|
|
|
|
|
"pytest (>=9.2.0,<10.0.0)",
|
2026-12-01 17:07:00 +01:00
|
|
|
"typeguard (>=4.6.1,<5.0.0)",
|
2026-11-27 10:45:35 +01:00
|
|
|
"xdoctest[colors] (>=1.3.2,<2.0.0)",
|
2026-11-25 15:54:16 +01:00
|
|
|
]
|
|
|
|
|
|
|
|
|
|
docs = [
|
2026-11-25 15:59:53 +01:00
|
|
|
"sphinx (>=9.2.0,<10.0.0)",
|
|
|
|
|
"sphinx-autodoc-typehints (>=3.17.7,<4.0.0)",
|
2026-11-25 15:54:16 +01:00
|
|
|
]
|
|
|
|
|
|
2026-12-01 21:46:38 +01:00
|
|
|
verify-db = [
|
|
|
|
|
"sqlalchemy-diff (>=1.2.0,<2.0.0)",
|
|
|
|
|
]
|
2026-11-25 15:54:16 +01:00
|
|
|
|
|
|
|
|
|
2026-11-25 16:03:14 +01:00
|
|
|
[tool.autoflake]
|
2026-12-03 11:09:38 +01:00
|
|
|
# See: https://github.com/PyCQA/autoflake#configuration
|
2026-11-25 16:03:14 +01:00
|
|
|
|
|
|
|
|
in-place = true
|
|
|
|
|
recursive = true
|
|
|
|
|
expand-star-imports = true
|
|
|
|
|
remove-all-unused-imports = true
|
|
|
|
|
ignore-init-module-imports = true # modifies "remove-all-unused-imports"
|
|
|
|
|
remove-duplicate-keys = true
|
|
|
|
|
remove-unused-variables = true
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2026-11-24 11:58:26 +01:00
|
|
|
[tool.black]
|
|
|
|
|
|
2026-12-03 13:02:41 +01:00
|
|
|
target-version = ["py314"]
|
2026-11-24 11:58:26 +01:00
|
|
|
|
|
|
|
|
line-length = 88
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2026-11-25 14:38:14 +01:00
|
|
|
[tool.coverage]
|
2026-12-03 11:09:38 +01:00
|
|
|
# See: https://coverage.readthedocs.io/en/latest/config.html
|
2026-11-25 14:38:14 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
[tool.coverage.paths]
|
|
|
|
|
|
|
|
|
|
source = [
|
|
|
|
|
"src/",
|
|
|
|
|
"*/site-packages/",
|
|
|
|
|
]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[tool.coverage.report]
|
|
|
|
|
|
|
|
|
|
show_missing = true
|
|
|
|
|
|
|
|
|
|
skip_covered = true
|
|
|
|
|
skip_empty = true
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[tool.coverage.run]
|
|
|
|
|
|
|
|
|
|
branch = true
|
|
|
|
|
|
|
|
|
|
data_file = ".cache/coverage/data"
|
|
|
|
|
|
|
|
|
|
source = ["velofy"]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2026-11-25 14:55:43 +01:00
|
|
|
[tool.flake8]
|
2026-12-03 11:09:38 +01:00
|
|
|
# See: https://flake8.pycqa.org/en/latest/user/configuration.html
|
2026-11-25 14:55:43 +01:00
|
|
|
|
|
|
|
|
# Include error classes only explicitly
|
2026-12-03 10:03:26 +01:00
|
|
|
# to avoid forward compatibility issues
|
2026-11-25 14:55:43 +01:00
|
|
|
select = [
|
|
|
|
|
# =============
|
|
|
|
|
# flake8's base
|
|
|
|
|
# =============
|
2026-11-30 23:27:31 +01:00
|
|
|
# mccabe => Cyclomatic complexity
|
2026-11-25 14:55:43 +01:00
|
|
|
"C901",
|
|
|
|
|
# pycodestyle => PEP8 compliance
|
|
|
|
|
"E", "W",
|
2026-11-30 23:27:31 +01:00
|
|
|
# pyflakes => Basic errors
|
2026-11-25 14:55:43 +01:00
|
|
|
"F4", "F5", "F6", "F7", "F8", "F9",
|
2026-11-28 04:08:39 +01:00
|
|
|
# =======
|
|
|
|
|
# plugins
|
|
|
|
|
# =======
|
2026-11-30 23:43:49 +01:00
|
|
|
# flake8-2020 => Correct `sys.version` checks
|
|
|
|
|
"YTT",
|
2026-11-30 23:27:31 +01:00
|
|
|
# flake8-annotations => Enforce type checking for functions
|
2026-11-28 04:08:39 +01:00
|
|
|
"ANN0", "ANN2", "ANN3",
|
2026-11-30 23:27:31 +01:00
|
|
|
# flake8-bandit => Common security issues
|
2026-11-25 14:55:43 +01:00
|
|
|
"S1", "S2", "S3", "S4", "S5", "S6", "S7",
|
2026-11-30 23:27:31 +01:00
|
|
|
# flake8-black => Complain if black would make changes
|
2026-11-28 04:08:39 +01:00
|
|
|
"BLK1", "BLK9",
|
2026-11-30 22:43:35 +01:00
|
|
|
# flake8-boolean-trap => Keyword-only flags
|
|
|
|
|
"FBT",
|
2026-11-30 23:27:31 +01:00
|
|
|
# flake8-broken-line => No \ to end a line
|
2026-11-25 14:55:43 +01:00
|
|
|
"N400",
|
2026-11-30 23:27:31 +01:00
|
|
|
# flake8-bugbear => Opinionated bugs and design flaws
|
2026-11-25 14:55:43 +01:00
|
|
|
"B0", "B3", "B9",
|
2026-11-30 21:40:43 +01:00
|
|
|
# flake8-builtins => No shadowing of builtins
|
|
|
|
|
"A0",
|
2026-11-30 23:27:31 +01:00
|
|
|
# flake8-commas => Better comma placements
|
2026-11-25 14:55:43 +01:00
|
|
|
"C8",
|
2026-11-30 23:27:31 +01:00
|
|
|
# flake8-comprehensions => Better comprehensions
|
2026-11-25 14:55:43 +01:00
|
|
|
"C4",
|
2026-11-30 23:27:31 +01:00
|
|
|
# flake8-debugger => No debugger usage
|
2026-11-25 14:55:43 +01:00
|
|
|
"T100",
|
|
|
|
|
# flake8-docstrings => PEP257 compliance
|
|
|
|
|
"D1", "D2", "D3", "D4",
|
2026-11-30 22:59:41 +01:00
|
|
|
# flake8-errmsg => Shorter tracebacks
|
|
|
|
|
"EM",
|
2026-11-30 23:37:54 +01:00
|
|
|
# flake8-executable => Consistent shebangs and executable bits
|
|
|
|
|
"EXE",
|
2026-11-30 21:09:05 +01:00
|
|
|
# flake8-implicit-str-concat => Unified string concatenation
|
|
|
|
|
"ISC",
|
2026-11-30 23:38:43 +01:00
|
|
|
# flake8-logging => Correct use of `logging`
|
|
|
|
|
"LOG",
|
2026-11-30 23:27:31 +01:00
|
|
|
# flake8-pytest-style => Enforce a consistent style with pytest
|
2026-11-25 14:55:43 +01:00
|
|
|
"PT0",
|
2026-11-30 23:27:31 +01:00
|
|
|
# flake8-quotes => Use double quotes everywhere (complying with black)
|
2026-11-28 04:08:39 +01:00
|
|
|
"Q0",
|
2026-11-30 23:41:00 +01:00
|
|
|
# flake8-raise => No parentheses for exceptions without arguments
|
|
|
|
|
"R1",
|
2026-11-30 23:27:31 +01:00
|
|
|
# flake8-sfs => Use f-strings as the only type of string formatting
|
2026-11-28 03:34:40 +01:00
|
|
|
"SFS",
|
2026-11-30 20:57:31 +01:00
|
|
|
# flake8-simplify => Simpler code
|
|
|
|
|
"SIM",
|
2026-11-30 23:41:42 +01:00
|
|
|
# flake8-tidy-imports => No relative imports
|
|
|
|
|
"I25",
|
2026-11-30 23:27:31 +01:00
|
|
|
# flake8-todos => Unify TODOs
|
2026-11-28 03:37:25 +01:00
|
|
|
"T00",
|
2026-11-30 23:27:31 +01:00
|
|
|
# flake8-unused-arguments => Declared function arguments must be used
|
2026-11-28 03:47:55 +01:00
|
|
|
"U100",
|
2026-11-30 22:11:10 +01:00
|
|
|
# pandas-vet => Idiomatic `pandas`
|
|
|
|
|
"PD0",
|
2026-11-28 04:08:39 +01:00
|
|
|
# pep8-naming => PEP8 naming conventions
|
|
|
|
|
"N8",
|
2026-11-30 23:27:31 +01:00
|
|
|
# pydoclint => Docstring matches implementation
|
2026-11-28 04:08:39 +01:00
|
|
|
"DOC",
|
2026-11-30 23:42:08 +01:00
|
|
|
# tryceratops => Clean exception handling
|
|
|
|
|
"TRY",
|
2026-11-30 20:52:01 +01:00
|
|
|
# ========================================
|
|
|
|
|
# `ruff` only (no working `flake8` plugin)
|
|
|
|
|
# ========================================
|
2026-11-30 23:37:20 +01:00
|
|
|
# flake8-blind-except => No blind `except Exception:`
|
|
|
|
|
# "BLE",
|
2026-11-30 23:50:05 +01:00
|
|
|
# eradicate => No commented-out code
|
|
|
|
|
# "ERA",
|
2026-11-30 23:38:13 +01:00
|
|
|
# flynt => F-strings instead of `str.join()`
|
|
|
|
|
# "FLY",
|
2026-11-30 21:33:43 +01:00
|
|
|
# refurb => Modern idioms
|
|
|
|
|
# "FURB",
|
2026-11-30 23:38:28 +01:00
|
|
|
# flake8-logging-format => Lazy `logging` messages
|
|
|
|
|
# "G",
|
2026-11-30 23:50:05 +01:00
|
|
|
# isort => Imports are sorted
|
|
|
|
|
# "I",
|
|
|
|
|
# flake8-import-conventions => Unified import aliases
|
|
|
|
|
# "ICN",
|
2026-11-30 22:49:41 +01:00
|
|
|
# NumPy-specific rules => Modern `numpy` APIs
|
|
|
|
|
# "NPY",
|
2026-11-30 21:31:38 +01:00
|
|
|
# Perflint => No performance anti-patterns
|
|
|
|
|
# "PERF",
|
2026-11-30 23:39:08 +01:00
|
|
|
# pygrep-hooks => Specific "# noqa" and "# type: ignore" comments
|
|
|
|
|
# "PGH",
|
2026-12-02 21:26:01 +01:00
|
|
|
# flake8-pie => No unnecessary constructs
|
|
|
|
|
# "PIE",
|
2026-11-30 22:28:12 +01:00
|
|
|
# Pylint => Fewer bugs and simpler code
|
|
|
|
|
# "PL",
|
2026-11-30 21:11:14 +01:00
|
|
|
# flake8-use-pathlib => `pathlib` instead of `os` functions
|
|
|
|
|
# "PTH",
|
2026-12-01 11:03:56 +01:00
|
|
|
# flake8-pyi (only two codes) => `t.Self` instead of the class name
|
|
|
|
|
# "PYI019", "PYI034",
|
2026-12-02 21:39:00 +01:00
|
|
|
# flake8-return => Consistent return statements
|
|
|
|
|
# "RET",
|
2026-11-30 23:17:41 +01:00
|
|
|
# Ruff-specific rules => Fewer bugs and cleaner code
|
|
|
|
|
# "RUF",
|
2026-11-30 22:35:24 +01:00
|
|
|
# flake8-self => No access to private members from outside
|
|
|
|
|
# "SLF",
|
2026-11-30 23:50:05 +01:00
|
|
|
# flake8-print => No `print()`
|
|
|
|
|
# "T20",
|
2026-11-30 20:52:01 +01:00
|
|
|
# pyupgrade => Modern syntax for the targeted Python version
|
|
|
|
|
# "UP",
|
2026-11-25 14:55:43 +01:00
|
|
|
]
|
|
|
|
|
|
2026-12-03 11:01:12 +01:00
|
|
|
# flake8 ignores some errors by default => Ignore nothing
|
2026-11-25 14:55:43 +01:00
|
|
|
ignore = []
|
|
|
|
|
|
|
|
|
|
# If --ignore is passed on the command
|
|
|
|
|
# line, still ignore the following:
|
|
|
|
|
extend-ignore = [
|
2026-11-30 21:40:43 +01:00
|
|
|
# `ruff`'s A003 does this better, as it only flags actual shadowing
|
|
|
|
|
"A003",
|
2026-12-03 10:03:26 +01:00
|
|
|
# Too long line => Duplicate with E501
|
2026-11-25 14:55:43 +01:00
|
|
|
"B950",
|
2026-12-03 10:03:26 +01:00
|
|
|
# PEP 257 documents the arguments of `__init__()` in its own docstring
|
2026-11-28 04:06:53 +01:00
|
|
|
"DOC301",
|
2026-12-03 11:01:12 +01:00
|
|
|
# Comply with black's style
|
2026-12-03 11:09:38 +01:00
|
|
|
# See: https://github.com/psf/black/blob/master/docs/compatible_configs.md#flake8
|
2026-11-28 02:01:12 +01:00
|
|
|
"E203", "W503",
|
2026-12-03 10:03:26 +01:00
|
|
|
# `ruff`'s FBT003 does this better, as it allows builtins like `setattr()`
|
2026-11-30 22:43:35 +01:00
|
|
|
"FBT003",
|
2026-12-03 10:03:26 +01:00
|
|
|
# Every `.add()` looks like `pandas` to this rule (`ruff` omits it)
|
2026-11-30 22:11:10 +01:00
|
|
|
"PD005",
|
2026-12-03 10:03:26 +01:00
|
|
|
# Let's not do `@pytest.mark.no_cover()` instead of `@pytest.mark.no_cover`
|
2026-11-25 14:55:43 +01:00
|
|
|
"PT023",
|
2026-12-03 10:03:26 +01:00
|
|
|
# Allow f-strings as the only type of string formatting
|
2026-11-28 03:34:40 +01:00
|
|
|
"SFS301",
|
2026-12-03 10:03:26 +01:00
|
|
|
# `bool()` around a comparison can be deliberate (`ruff` omits this rule)
|
2026-11-30 20:57:31 +01:00
|
|
|
"SIM901",
|
2026-12-03 10:03:26 +01:00
|
|
|
# TODOs need neither an author nor an issue
|
2026-11-28 03:37:25 +01:00
|
|
|
"T002", "T003",
|
2026-12-03 10:03:26 +01:00
|
|
|
# Messages are written where the exceptions are raised
|
2026-11-30 23:42:08 +01:00
|
|
|
"TRY003",
|
2026-11-25 14:55:43 +01:00
|
|
|
]
|
|
|
|
|
|
|
|
|
|
per-file-ignores = [
|
2026-12-03 10:03:26 +01:00
|
|
|
# Type annotations are not strictly enforced
|
2026-11-25 14:55:43 +01:00
|
|
|
"migrations/env.py:ANN0,ANN2",
|
2026-12-03 10:03:26 +01:00
|
|
|
# - ANN0, ANN2 => Type annotations are not strictly enforced
|
|
|
|
|
# - S608 => Do not worry about SQL injection here
|
2026-11-28 02:01:12 +01:00
|
|
|
"migrations/versions/*.py:ANN0,ANN2,S608",
|
2026-12-03 10:03:26 +01:00
|
|
|
# Type annotations are not strictly enforced
|
2026-11-28 02:01:12 +01:00
|
|
|
"noxfile.py:ANN0,ANN2",
|
2026-12-03 10:03:26 +01:00
|
|
|
# - ANN0, ANN2, DOC106, DOC107 => Type annotations are not strictly enforced
|
|
|
|
|
# - D106 => The `Meta` class inside the factory_boy models do not need a docstring
|
|
|
|
|
# - S101 => `assert` statements are ok in the test suite
|
|
|
|
|
# - S311 => The `random` module is not used for cryptography
|
2026-11-28 04:06:53 +01:00
|
|
|
"tests/*.py:ANN0,ANN2,D106,DOC106,DOC107,S101,S311",
|
2026-11-25 14:55:43 +01:00
|
|
|
]
|
|
|
|
|
|
2026-12-03 11:01:12 +01:00
|
|
|
# 10 as recommended by Thomas McCabe, the metric's inventor, and the NIST
|
2026-12-03 11:09:38 +01:00
|
|
|
# See: https://en.wikipedia.org/wiki/Cyclomatic_complexity#Limiting_complexity_during_development
|
2026-11-25 14:55:43 +01:00
|
|
|
max-complexity = 10
|
|
|
|
|
|
2026-12-03 11:01:12 +01:00
|
|
|
# Comply with black's style
|
2026-12-03 11:09:38 +01:00
|
|
|
# See: https://github.com/psf/black/blob/master/docs/the_black_code_style.md#line-length
|
2026-11-25 14:55:43 +01:00
|
|
|
max-line-length = 88
|
|
|
|
|
|
2026-12-03 10:03:26 +01:00
|
|
|
# Preview the code lines that cause errors
|
2026-11-25 14:55:43 +01:00
|
|
|
show-source = true
|
|
|
|
|
|
2026-11-28 04:06:53 +01:00
|
|
|
# pydoclint
|
|
|
|
|
style = "google"
|
|
|
|
|
arg-type-hints-in-docstring = false
|
|
|
|
|
check-return-types = false
|
|
|
|
|
check-yield-types = false
|
2026-11-25 14:55:43 +01:00
|
|
|
# flake8-docstrings
|
|
|
|
|
docstring-convention = "google"
|
2026-11-28 03:21:46 +01:00
|
|
|
# flake8-quotes
|
2026-12-03 11:09:38 +01:00
|
|
|
# See: https://github.com/zheller/flake8-quotes#configuration
|
2026-11-28 03:21:46 +01:00
|
|
|
avoid-escape = true
|
|
|
|
|
docstring-quotes = "double"
|
|
|
|
|
inline-quotes = "double"
|
|
|
|
|
multiline-quotes = "double"
|
2026-11-28 03:47:55 +01:00
|
|
|
# flake8-unused-arguments
|
|
|
|
|
unused-arguments-ignore-abstract-functions = true
|
2026-11-25 14:55:43 +01:00
|
|
|
|
|
|
|
|
# ==============================
|
|
|
|
|
# flake8-pytest-style's settings
|
|
|
|
|
# ==============================
|
2026-12-03 10:03:26 +01:00
|
|
|
# Prefer @pytest.fixture over @pytest.fixture()
|
2026-11-25 14:55:43 +01:00
|
|
|
pytest-fixture-no-parentheses = true
|
|
|
|
|
# Prefer @pytest.mark.parametrize(['param1', 'param2'], [(1, 2), (3, 4)])
|
|
|
|
|
# over @pytest.mark.parametrize(('param1', 'param2'), ([1, 2], [3, 4]))
|
|
|
|
|
pytest-parametrize-names-type = "list"
|
|
|
|
|
pytest-parametrize-values-row-type = "tuple"
|
|
|
|
|
pytest-parametrize-values-type = "list"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2026-11-25 14:49:12 +01:00
|
|
|
[tool.isort]
|
2026-12-03 11:09:38 +01:00
|
|
|
# See: https://pycqa.github.io/isort/docs/configuration/options.html
|
2026-11-25 14:49:12 +01:00
|
|
|
|
|
|
|
|
atomic = true
|
2026-11-28 04:37:02 +01:00
|
|
|
case_sensitive = false # Implied by "force_alphabetical_sort_within_sections"
|
2026-11-25 14:49:12 +01:00
|
|
|
combine_star = true
|
|
|
|
|
force_alphabetical_sort_within_sections = true
|
|
|
|
|
lines_after_imports = 2
|
|
|
|
|
remove_redundant_aliases = true
|
|
|
|
|
|
|
|
|
|
# Comply with black's style
|
2026-12-03 11:09:38 +01:00
|
|
|
# See: https://github.com/psf/black/blob/master/docs/compatible_configs.md#isort
|
2026-11-25 14:49:12 +01:00
|
|
|
ensure_newline_before_comments = true
|
|
|
|
|
force_grid_wrap = 0
|
|
|
|
|
include_trailing_comma = true
|
|
|
|
|
line_length = 88
|
|
|
|
|
multi_line_output = 3
|
|
|
|
|
use_parentheses = true
|
|
|
|
|
|
|
|
|
|
# Comply with Google's Python Style Guide
|
2026-11-30 17:09:39 +01:00
|
|
|
# => All imports go on a single line
|
2026-12-03 11:09:38 +01:00
|
|
|
# See: https://google.github.io/styleguide/pyguide.html#313-imports-formatting
|
2026-11-25 14:49:12 +01:00
|
|
|
force_single_line = true
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2026-11-25 14:46:02 +01:00
|
|
|
[tool.mypy]
|
2026-12-03 11:09:38 +01:00
|
|
|
# See: https://mypy.readthedocs.io/en/stable/config_file.html
|
2026-11-25 14:46:02 +01:00
|
|
|
|
|
|
|
|
cache_dir = ".cache/mypy"
|
|
|
|
|
|
2026-12-02 21:41:00 +01:00
|
|
|
# Check against the oldest supported Python version, not the one running `mypy`
|
2026-12-03 13:02:41 +01:00
|
|
|
python_version = "3.14"
|
2026-12-02 21:41:00 +01:00
|
|
|
|
2026-11-25 14:46:02 +01:00
|
|
|
# Check the interior of functions without type annotations
|
|
|
|
|
check_untyped_defs = true
|
|
|
|
|
|
|
|
|
|
# Disallow generic types without explicit type parameters
|
|
|
|
|
disallow_any_generics = true
|
|
|
|
|
|
2026-12-01 12:35:24 +01:00
|
|
|
# Disallow types that become `Any` because their library is untyped
|
|
|
|
|
disallow_any_unimported = true
|
|
|
|
|
|
2026-11-25 14:46:02 +01:00
|
|
|
# Disallow functions with incomplete type annotations
|
|
|
|
|
disallow_incomplete_defs = true
|
|
|
|
|
|
2026-12-01 09:43:23 +01:00
|
|
|
# Disallow subclassing classes typed `Any`
|
|
|
|
|
disallow_subclassing_any = true
|
2026-12-01 09:29:08 +01:00
|
|
|
|
2026-11-30 11:32:05 +01:00
|
|
|
# Disallow calling functions without type annotations ...
|
2026-11-25 14:46:02 +01:00
|
|
|
disallow_untyped_calls = true
|
2026-11-30 11:32:05 +01:00
|
|
|
# ... except for libraries without type annotations
|
|
|
|
|
untyped_calls_exclude = [
|
2026-12-01 13:37:49 +01:00
|
|
|
"folium.vector_layers",
|
2026-11-30 11:32:05 +01:00
|
|
|
]
|
2026-11-25 14:46:02 +01:00
|
|
|
|
2026-12-01 09:29:08 +01:00
|
|
|
# Disallow decorators without type annotations
|
|
|
|
|
disallow_untyped_decorators = true
|
|
|
|
|
|
2026-11-25 14:46:02 +01:00
|
|
|
# Disallow functions without type annotations (or incomplete annotations)
|
|
|
|
|
disallow_untyped_defs = true
|
|
|
|
|
|
2026-12-01 13:11:30 +01:00
|
|
|
# Enable error codes that are off by default
|
|
|
|
|
enable_error_code = [
|
|
|
|
|
# Report usages of APIs marked with `@deprecated`
|
|
|
|
|
"deprecated",
|
|
|
|
|
# Require an error code in all "# type: ignore" comments
|
|
|
|
|
"ignore-without-code",
|
2026-12-01 13:11:31 +01:00
|
|
|
# Report overrides of mutable attributes with incompatible types
|
|
|
|
|
"mutable-override",
|
2026-12-01 13:11:32 +01:00
|
|
|
# Report variables that may be used before they are assigned
|
|
|
|
|
"possibly-undefined",
|
2026-12-01 13:11:45 +01:00
|
|
|
# Report conditions that are always true or always false
|
|
|
|
|
"redundant-expr",
|
2026-12-01 13:11:46 +01:00
|
|
|
# Report truthiness checks on objects that are always true
|
|
|
|
|
"truthy-bool",
|
2026-12-01 13:11:47 +01:00
|
|
|
# Report truthiness checks on `Iterable`s that are always true
|
|
|
|
|
"truthy-iterable",
|
2026-12-01 13:11:30 +01:00
|
|
|
]
|
2026-11-30 13:15:19 +01:00
|
|
|
|
2026-12-01 09:29:08 +01:00
|
|
|
# Check further edge cases that are rarely an issue in practice
|
|
|
|
|
extra_checks = true
|
|
|
|
|
|
2026-12-01 09:30:07 +01:00
|
|
|
# Treat only names listed in `__all__` as re-exported
|
|
|
|
|
no_implicit_reexport = true
|
2026-12-01 09:29:08 +01:00
|
|
|
|
|
|
|
|
# Disallow comparisons of non-overlapping types (e.g., `str` and `int`)
|
|
|
|
|
strict_equality = true
|
|
|
|
|
|
|
|
|
|
# Report `t.cast()` calls that are not needed
|
|
|
|
|
warn_redundant_casts = true
|
|
|
|
|
|
2026-12-01 11:42:34 +01:00
|
|
|
# Report functions returning `Any` despite a non-`Any` return type
|
|
|
|
|
warn_return_any = true
|
2026-12-01 09:29:08 +01:00
|
|
|
|
2026-12-01 13:02:57 +01:00
|
|
|
# Report code that can never be reached
|
|
|
|
|
warn_unreachable = true
|
|
|
|
|
|
2026-12-01 09:29:08 +01:00
|
|
|
# Report "[[tool.mypy.overrides]]" sections that match no module
|
|
|
|
|
warn_unused_configs = true
|
|
|
|
|
|
2026-11-30 13:15:19 +01:00
|
|
|
# Report "# type: ignore" comments that are not needed anymore
|
|
|
|
|
warn_unused_ignores = true
|
|
|
|
|
|
2026-11-25 14:46:02 +01:00
|
|
|
|
|
|
|
|
[[tool.mypy.overrides]]
|
|
|
|
|
|
|
|
|
|
module = [
|
|
|
|
|
"geopy.*",
|
|
|
|
|
"googlemaps.*",
|
|
|
|
|
"rpy2.*",
|
2026-12-01 21:46:38 +01:00
|
|
|
"sqlalchemydiff.*",
|
2026-11-25 14:46:02 +01:00
|
|
|
"statsmodels.*",
|
|
|
|
|
"utm.*",
|
|
|
|
|
]
|
|
|
|
|
|
|
|
|
|
ignore_missing_imports = true
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2026-12-01 15:00:26 +01:00
|
|
|
[tool.pyright]
|
2026-12-03 11:09:38 +01:00
|
|
|
# See: https://microsoft.github.io/pyright/#/configuration
|
2026-12-01 15:00:26 +01:00
|
|
|
|
2026-12-02 21:41:00 +01:00
|
|
|
# Check against the oldest supported Python version, not the one running `pyright`
|
2026-12-03 13:02:41 +01:00
|
|
|
pythonVersion = "3.14"
|
2026-12-02 21:41:00 +01:00
|
|
|
|
2026-12-01 15:00:26 +01:00
|
|
|
# Treat libraries without type annotations as `Any`, like `mypy` does
|
|
|
|
|
useLibraryCodeForTypes = false
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2026-11-25 14:43:31 +01:00
|
|
|
[tool.pytest.ini_options]
|
2026-12-03 11:09:38 +01:00
|
|
|
# See: https://docs.pytest.org/en/stable/reference/reference.html#ini-options-ref
|
2026-11-25 14:43:31 +01:00
|
|
|
|
|
|
|
|
cache_dir = ".cache/pytest"
|
|
|
|
|
|
2026-11-27 09:50:31 +01:00
|
|
|
testpaths = ["tests"]
|
|
|
|
|
|
|
|
|
|
# "-ra" => Summarize skipped and `xfailed tests at the end
|
|
|
|
|
addopts = "-ra --strict-config --strict-markers"
|
2026-11-25 14:43:31 +01:00
|
|
|
|
|
|
|
|
console_output_style = "count"
|
|
|
|
|
|
2026-11-27 09:50:31 +01:00
|
|
|
xfail_strict = true
|
|
|
|
|
|
|
|
|
|
required_plugins = [
|
|
|
|
|
"pytest-cov",
|
|
|
|
|
"pytest-env",
|
|
|
|
|
"pytest-mock",
|
|
|
|
|
]
|
|
|
|
|
|
2026-11-25 14:43:31 +01:00
|
|
|
env = [
|
|
|
|
|
"TESTING=true",
|
|
|
|
|
]
|
|
|
|
|
|
|
|
|
|
filterwarnings = [
|
2026-11-30 10:56:46 +01:00
|
|
|
"error", # Turn all warnings into errors
|
2026-11-25 14:43:31 +01:00
|
|
|
]
|
|
|
|
|
|
|
|
|
|
markers = [
|
|
|
|
|
"db: (integration) tests touching the database",
|
|
|
|
|
"e2e: non-db and non-r integration tests",
|
|
|
|
|
"r: (integration) tests using rpy2",
|
|
|
|
|
]
|
2026-11-25 15:54:16 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2026-11-28 04:37:02 +01:00
|
|
|
[tool.ruff]
|
2026-12-03 11:09:38 +01:00
|
|
|
# See: https://docs.astral.sh/ruff/
|
2026-11-28 04:37:02 +01:00
|
|
|
|
|
|
|
|
cache-dir = ".cache/ruff"
|
|
|
|
|
|
|
|
|
|
src = ["src"]
|
|
|
|
|
|
2026-12-03 13:02:41 +01:00
|
|
|
target-version = "py314"
|
2026-11-28 04:37:02 +01:00
|
|
|
|
|
|
|
|
line-length = 88
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[tool.ruff.format]
|
|
|
|
|
|
|
|
|
|
# Align with black
|
|
|
|
|
quote-style = "double"
|
|
|
|
|
skip-magic-trailing-comma = false
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[tool.ruff.lint] # aligned with [tool.flake8] above
|
|
|
|
|
|
|
|
|
|
select = [
|
|
|
|
|
# ===================================
|
|
|
|
|
# Violations also covered by `flake8`
|
|
|
|
|
# ===================================
|
2026-11-30 21:40:43 +01:00
|
|
|
# flake8-builtins => No shadowing of builtins
|
|
|
|
|
"A",
|
2026-11-30 23:27:31 +01:00
|
|
|
# flake8-annotations => Enforce type checking for functions
|
2026-11-28 04:37:02 +01:00
|
|
|
"ANN0", "ANN2",
|
2026-11-30 23:27:31 +01:00
|
|
|
# flake8-unused-arguments ("U100") => Declared function arguments must be used
|
2026-11-28 04:37:02 +01:00
|
|
|
"ARG",
|
2026-11-30 23:27:31 +01:00
|
|
|
# flake8-bugbear => Opinionated bugs and design flaws
|
2026-11-28 04:37:02 +01:00
|
|
|
"B",
|
2026-11-30 23:27:31 +01:00
|
|
|
# flake8-comprehensions => Better comprehensions
|
2026-11-28 04:37:02 +01:00
|
|
|
"C4",
|
2026-11-30 23:27:31 +01:00
|
|
|
# mccabe => Cyclomatic complexity
|
2026-11-28 04:37:02 +01:00
|
|
|
"C90",
|
2026-11-30 23:27:31 +01:00
|
|
|
# flake8-commas ("C8") => Better comma placements
|
2026-11-28 04:37:02 +01:00
|
|
|
"COM",
|
|
|
|
|
# flake8-docstrings => PEP257 compliance
|
|
|
|
|
"D",
|
|
|
|
|
# pycodestyle => PEP8 compliance
|
|
|
|
|
"E", "W",
|
2026-11-30 22:59:41 +01:00
|
|
|
# flake8-errmsg => Shorter tracebacks
|
|
|
|
|
"EM",
|
2026-11-30 23:37:54 +01:00
|
|
|
# flake8-executable => Consistent shebangs and executable bits
|
|
|
|
|
"EXE",
|
2026-11-30 23:27:31 +01:00
|
|
|
# pyflakes => Basic errors
|
2026-11-28 04:37:02 +01:00
|
|
|
"F",
|
2026-11-30 22:43:35 +01:00
|
|
|
# flake8-boolean-trap => Keyword-only flags
|
|
|
|
|
"FBT",
|
2026-11-30 21:09:05 +01:00
|
|
|
# flake8-implicit-str-concat => Unified string concatenation
|
|
|
|
|
"ISC",
|
2026-11-30 23:38:43 +01:00
|
|
|
# flake8-logging => Correct use of `logging`
|
|
|
|
|
"LOG",
|
2026-11-28 04:37:02 +01:00
|
|
|
# pep8-naming => PEP8 naming conventions
|
|
|
|
|
"N",
|
2026-11-30 22:11:10 +01:00
|
|
|
# pandas-vet => Idiomatic `pandas`
|
|
|
|
|
"PD",
|
2026-11-30 23:27:31 +01:00
|
|
|
# flake8-pytest-style => Enforce a consistent style with pytest
|
2026-11-28 04:37:02 +01:00
|
|
|
"PT",
|
2026-11-30 23:27:31 +01:00
|
|
|
# flake8-quotes => Use double quotes everywhere
|
2026-11-28 04:37:02 +01:00
|
|
|
"Q",
|
2026-11-30 23:41:00 +01:00
|
|
|
# flake8-raise ("R1") => No parentheses for exceptions without arguments
|
|
|
|
|
"RSE",
|
2026-11-30 23:27:31 +01:00
|
|
|
# flake8-bandit => Common security issues
|
2026-11-28 04:37:02 +01:00
|
|
|
"S",
|
2026-11-30 20:57:31 +01:00
|
|
|
# flake8-simplify => Simpler code
|
|
|
|
|
"SIM",
|
2026-11-30 23:27:31 +01:00
|
|
|
# flake8-debugger => No debugger usage
|
2026-11-28 04:37:02 +01:00
|
|
|
"T10",
|
2026-11-30 23:27:31 +01:00
|
|
|
# flake8-todos => Unify TODOs
|
2026-11-28 04:37:02 +01:00
|
|
|
"TD",
|
2026-11-30 23:41:42 +01:00
|
|
|
# flake8-tidy-imports ("I25") => No relative imports
|
|
|
|
|
"TID",
|
2026-11-30 23:42:08 +01:00
|
|
|
# tryceratops => Clean exception handling
|
|
|
|
|
"TRY",
|
2026-11-30 23:43:49 +01:00
|
|
|
# flake8-2020 => Correct `sys.version` checks
|
|
|
|
|
"YTT",
|
2026-11-28 04:37:02 +01:00
|
|
|
# =======================================
|
|
|
|
|
# Violations not covered by `flake8` above
|
|
|
|
|
# =======================================
|
2026-11-30 23:37:20 +01:00
|
|
|
# flake8-blind-except => No blind `except Exception:`
|
|
|
|
|
"BLE",
|
2026-11-30 23:27:31 +01:00
|
|
|
# eradicate => No commented-out code
|
2026-11-28 04:55:19 +01:00
|
|
|
"ERA",
|
2026-11-30 23:38:13 +01:00
|
|
|
# flynt => F-strings instead of `str.join()`
|
|
|
|
|
"FLY",
|
2026-11-30 21:33:43 +01:00
|
|
|
# refurb => Modern idioms
|
|
|
|
|
"FURB",
|
2026-11-30 23:27:31 +01:00
|
|
|
# isort => Imports are sorted
|
2026-11-28 04:37:02 +01:00
|
|
|
"I",
|
2026-11-30 20:50:21 +01:00
|
|
|
# flake8-import-conventions => Unified import aliases
|
|
|
|
|
"ICN",
|
2026-11-30 22:49:41 +01:00
|
|
|
# NumPy-specific rules => Modern `numpy` APIs
|
|
|
|
|
"NPY",
|
2026-11-30 21:31:38 +01:00
|
|
|
# Perflint => No performance anti-patterns
|
|
|
|
|
"PERF",
|
2026-11-30 23:39:08 +01:00
|
|
|
# pygrep-hooks => Specific "# noqa" and "# type: ignore" comments
|
|
|
|
|
"PGH",
|
2026-12-02 21:26:01 +01:00
|
|
|
# flake8-pie => No unnecessary constructs
|
|
|
|
|
"PIE",
|
2026-11-30 22:28:12 +01:00
|
|
|
# Pylint => Fewer bugs and simpler code
|
|
|
|
|
"PL",
|
2026-11-30 21:11:14 +01:00
|
|
|
# flake8-use-pathlib => `pathlib` instead of `os` functions
|
|
|
|
|
"PTH",
|
2026-12-01 11:03:56 +01:00
|
|
|
# flake8-pyi (only two codes) => `t.Self` instead of the class name
|
|
|
|
|
"PYI019", "PYI034",
|
2026-12-02 21:39:00 +01:00
|
|
|
# flake8-return => Consistent return statements
|
|
|
|
|
"RET",
|
2026-11-30 23:17:41 +01:00
|
|
|
# Ruff-specific rules => Fewer bugs and cleaner code
|
|
|
|
|
"RUF",
|
2026-11-30 22:35:24 +01:00
|
|
|
# flake8-self => No access to private members from outside
|
|
|
|
|
"SLF",
|
2026-11-30 23:27:31 +01:00
|
|
|
# flake8-print => No `print()`
|
2026-11-28 04:37:02 +01:00
|
|
|
"T20",
|
2026-11-30 20:52:01 +01:00
|
|
|
# pyupgrade => Modern syntax for the targeted Python version
|
|
|
|
|
"UP",
|
2026-11-30 23:50:12 +01:00
|
|
|
# =====================================
|
|
|
|
|
# `flake8` only (no `ruff` counterpart)
|
|
|
|
|
# =====================================
|
|
|
|
|
# flake8-black => Complain if black would make changes
|
|
|
|
|
# "BLK",
|
|
|
|
|
# pydoclint => Docstring matches implementation
|
|
|
|
|
# "DOC",
|
|
|
|
|
# flake8-broken-line => No \ to end a line
|
|
|
|
|
# "N400",
|
|
|
|
|
# flake8-sfs => Use f-strings as the only type of string formatting
|
|
|
|
|
# "SFS",
|
2026-11-28 04:37:02 +01:00
|
|
|
]
|
|
|
|
|
|
|
|
|
|
extend-ignore = [
|
2026-12-03 10:03:26 +01:00
|
|
|
# Let the formatter handle trailing commas
|
2026-11-28 04:37:02 +01:00
|
|
|
"COM812",
|
2026-12-03 10:03:26 +01:00
|
|
|
# Thresholds like the ones in the maps read better as literals
|
2026-11-28 04:57:25 +01:00
|
|
|
"PLR2004",
|
2026-12-03 10:03:26 +01:00
|
|
|
# Let's not do `@pytest.mark.no_cover()` instead of `@pytest.mark.no_cover`
|
2026-11-28 04:37:02 +01:00
|
|
|
"PT023",
|
2026-12-03 10:03:26 +01:00
|
|
|
# An `elif` after a `return` keeps a case distinction together
|
2026-11-30 21:03:23 +01:00
|
|
|
"RET505",
|
2026-12-03 10:03:26 +01:00
|
|
|
# Some "# noqa" comments are only for `flake8`, which `ruff` cannot know
|
2026-11-30 23:17:41 +01:00
|
|
|
"RUF100",
|
2026-12-03 10:03:26 +01:00
|
|
|
# TODOs need neither an author nor an issue
|
2026-11-28 04:37:02 +01:00
|
|
|
"TD002", "TD003",
|
2026-12-03 10:03:26 +01:00
|
|
|
# Messages are written where the exceptions are raised
|
2026-11-30 23:42:08 +01:00
|
|
|
"TRY003",
|
2026-11-28 04:37:02 +01:00
|
|
|
]
|
|
|
|
|
|
|
|
|
|
|
2026-11-30 23:17:41 +01:00
|
|
|
# Codes only `flake8` knows, kept in "# noqa" comments
|
|
|
|
|
external = [
|
|
|
|
|
"B902",
|
|
|
|
|
"DOC",
|
|
|
|
|
]
|
|
|
|
|
|
|
|
|
|
|
2026-11-28 04:37:02 +01:00
|
|
|
[tool.ruff.lint.per-file-ignores]
|
|
|
|
|
|
2026-12-03 11:47:26 +01:00
|
|
|
"migrations/env.py" = [
|
|
|
|
|
"ANN0", "ANN2", # Type annotations are not strictly enforced
|
|
|
|
|
]
|
|
|
|
|
|
|
|
|
|
"migrations/versions/*.py" = [
|
|
|
|
|
"ANN0", "ANN2", # Type annotations are not strictly enforced
|
|
|
|
|
"S608", # Do not worry about SQL injection here
|
|
|
|
|
]
|
|
|
|
|
|
|
|
|
|
"noxfile.py" = [
|
|
|
|
|
"ANN0", "ANN2", # Type annotations are not strictly enforced
|
|
|
|
|
]
|
|
|
|
|
|
2026-12-03 11:45:15 +01:00
|
|
|
"research/*.ipynb" = [
|
|
|
|
|
"ANN0", "ANN2", # Type annotations are not strictly enforced
|
|
|
|
|
"E501", # Exploratory cells read better unwrapped
|
|
|
|
|
"E712", # `== True` filters `pandas` columns element-wise
|
|
|
|
|
"PTH", # Paths stay `str`s as in the stored outputs
|
|
|
|
|
"S101", # `assert` statements document expectations
|
|
|
|
|
"S605", "S608", # No untrusted input
|
|
|
|
|
"T20", # `print()` shows results
|
|
|
|
|
]
|
2026-12-03 11:47:26 +01:00
|
|
|
|
|
|
|
|
"scripts/**" = [
|
|
|
|
|
"T20", # `print()` is ok in ad-hoc scripts
|
|
|
|
|
]
|
|
|
|
|
|
|
|
|
|
"tests/**/*.py" = [
|
|
|
|
|
"ANN0", "ANN2", # Type annotations are not strictly enforced
|
|
|
|
|
"D106", # The `Meta` class inside the factory_boy models do not need a docstring
|
|
|
|
|
"PLR0913", "PLR0917", # `pytest` passes fixtures as arguments
|
|
|
|
|
"S101", # `assert` statements are ok in the test suite
|
|
|
|
|
"S311", # The `random` module is not used for cryptography
|
|
|
|
|
"SLF001", # Tests may set up and inspect private members
|
|
|
|
|
]
|
2026-11-28 04:37:02 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
[tool.ruff.lint.flake8-pytest-style] # aligned with [tool.flake8] above
|
|
|
|
|
|
|
|
|
|
fixture-parentheses = false
|
|
|
|
|
parametrize-names-type = "list"
|
|
|
|
|
parametrize-values-row-type = "tuple"
|
|
|
|
|
parametrize-values-type = "list"
|
|
|
|
|
|
|
|
|
|
|
2026-11-30 17:09:39 +01:00
|
|
|
[tool.ruff.lint.flake8-import-conventions]
|
|
|
|
|
|
|
|
|
|
# Import modules instead of objects from these modules
|
|
|
|
|
banned-from = [
|
|
|
|
|
"collections.abc",
|
|
|
|
|
"nox.sessions",
|
|
|
|
|
"typing",
|
|
|
|
|
]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[tool.ruff.lint.flake8-import-conventions.extend-aliases]
|
|
|
|
|
|
2026-11-30 20:08:16 +01:00
|
|
|
"alembic.command" = "alembic_cmd"
|
2026-11-30 20:13:46 +01:00
|
|
|
"alembic.config" = "alembic_config"
|
2026-11-30 19:56:58 +01:00
|
|
|
"click.core" = "cli_core"
|
|
|
|
|
"click.testing" = "cli_testing"
|
2026-11-30 17:09:39 +01:00
|
|
|
"collections.abc" = "cabc"
|
2026-11-30 19:55:34 +01:00
|
|
|
"geopy.distance" = "geo_distance"
|
2026-11-30 19:53:15 +01:00
|
|
|
"googlemaps" = "gm"
|
2026-11-30 20:21:43 +01:00
|
|
|
"logging.config" = "log_config"
|
|
|
|
|
"packaging.version" = "pkg_version"
|
2026-11-30 20:04:44 +01:00
|
|
|
"rpy2.rinterface_lib.callbacks" = "r_callbacks"
|
2026-11-30 20:06:09 +01:00
|
|
|
"rpy2.robjects.packages" = "r_packages"
|
2026-11-30 17:09:39 +01:00
|
|
|
"sqlalchemy" = "sa"
|
|
|
|
|
"sqlalchemy.dialects.postgresql" = "psql"
|
2026-11-30 20:21:43 +01:00
|
|
|
"sqlalchemy.exc" = "sa_exc"
|
2026-11-30 17:09:39 +01:00
|
|
|
"sqlalchemy.ext.hybrid" = "sa_hybrid"
|
2026-11-30 20:03:25 +01:00
|
|
|
"statsmodels.tsa.api" = "tsa"
|
2026-11-30 20:21:43 +01:00
|
|
|
"tests.config" = "test_config"
|
2026-11-30 17:09:39 +01:00
|
|
|
"typing" = "t"
|
2026-11-30 20:19:35 +01:00
|
|
|
"velofy.config" = "pkg_config"
|
2026-11-30 17:09:39 +01:00
|
|
|
|
|
|
|
|
|
2026-11-28 04:37:02 +01:00
|
|
|
[tool.ruff.lint.isort] # aligned with [tool.isort] above
|
|
|
|
|
|
|
|
|
|
case-sensitive = false # Same as `isort`
|
|
|
|
|
force-single-line = true
|
|
|
|
|
lines-after-imports = 2
|
|
|
|
|
order-by-type = false
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[tool.ruff.lint.mccabe]
|
|
|
|
|
|
|
|
|
|
max-complexity = 10
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[tool.ruff.lint.pydocstyle]
|
|
|
|
|
|
|
|
|
|
convention = "google"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2026-11-25 15:54:16 +01:00
|
|
|
[tool.uv]
|
2026-12-03 11:09:38 +01:00
|
|
|
# See: https://docs.astral.sh/uv/reference/settings/
|
2026-11-25 15:54:16 +01:00
|
|
|
|
2026-11-27 13:38:31 +01:00
|
|
|
required-version = ">=0.13.10,<0.14.0" # Same range as "uv_build" above
|
|
|
|
|
|
2026-11-25 15:54:16 +01:00
|
|
|
# `uv sync` installs all [dependency-groups] into the local develop environment
|
|
|
|
|
# whereas the `nox` sessions install only the groups they need
|
|
|
|
|
default-groups = "all"
|
2026-11-25 16:57:50 +01:00
|
|
|
|
|
|
|
|
# Rebuild the package when its source files change;
|
|
|
|
|
# by default, `uv` only watches the pyproject.toml file
|
|
|
|
|
cache-keys = [
|
|
|
|
|
{ file = "pyproject.toml" },
|
|
|
|
|
{ file = "src/**/*.py" },
|
|
|
|
|
]
|