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 = [
|
|
|
|
|
# All `SUPPORTED_PYTHONS` listed here are automatically
|
|
|
|
|
# loaded by `nox`, our task runner, and made available
|
|
|
|
|
# for testing in isolated environments
|
|
|
|
|
"Programming Language :: Python :: 3.13",
|
|
|
|
|
]
|
|
|
|
|
|
2026-11-25 11:29:50 +01:00
|
|
|
requires-python = ">=3.13,<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)",
|
|
|
|
|
"black (>=25.12.0,<26.0.0)",
|
|
|
|
|
"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)",
|
|
|
|
|
"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)",
|
|
|
|
|
"flake8-pyproject (>=1.2.4,<2.0.0)",
|
|
|
|
|
"flake8-pytest-style (>=2.2.0,<3.0.0)",
|
|
|
|
|
"mypy (>=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-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-11-25 16:03:14 +01:00
|
|
|
[tool.autoflake]
|
|
|
|
|
# Source: https://github.com/PyCQA/autoflake#configuration
|
|
|
|
|
|
|
|
|
|
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-11-25 12:31:26 +01:00
|
|
|
target-version = ["py313"]
|
2026-11-24 11:58:26 +01:00
|
|
|
|
|
|
|
|
line-length = 88
|
|
|
|
|
|
|
|
|
|
skip-string-normalization = true # `wemake-python-styleguide` enforces single quotes
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2026-11-25 14:38:14 +01:00
|
|
|
[tool.coverage]
|
|
|
|
|
# Source: https://coverage.readthedocs.io/en/latest/config.html
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[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]
|
|
|
|
|
# Source: https://flake8.pycqa.org/en/latest/user/configuration.html
|
|
|
|
|
|
|
|
|
|
# Include error classes only explicitly
|
|
|
|
|
# to avoid forward compatibility issues.
|
|
|
|
|
select = [
|
|
|
|
|
# =============
|
|
|
|
|
# flake8's base
|
|
|
|
|
# =============
|
|
|
|
|
# mccabe => cyclomatic complexity
|
|
|
|
|
"C901",
|
|
|
|
|
# pycodestyle => PEP8 compliance
|
|
|
|
|
"E", "W",
|
|
|
|
|
# pyflakes => basic errors
|
|
|
|
|
"F4", "F5", "F6", "F7", "F8", "F9",
|
|
|
|
|
# ========================
|
|
|
|
|
# wemake-python-styleguide
|
|
|
|
|
# Source: https://wemake-python-stylegui.de/en/latest/pages/usage/violations/index.html
|
|
|
|
|
# ========================
|
|
|
|
|
# darglint => docstring matches implementation
|
|
|
|
|
"DAR0", "DAR1", "DAR2", "DAR3", "DAR4", "DAR5",
|
|
|
|
|
# flake8-bandit => common security issues
|
|
|
|
|
"S1", "S2", "S3", "S4", "S5", "S6", "S7",
|
|
|
|
|
# flake8-broken-line => no \ to end a line
|
|
|
|
|
"N400",
|
|
|
|
|
# flake8-bugbear => opinionated bugs and design flaws
|
|
|
|
|
"B0", "B3", "B9",
|
|
|
|
|
# flake8-commas => better comma placements
|
|
|
|
|
"C8",
|
|
|
|
|
# flake8-comprehensions => better comprehensions
|
|
|
|
|
"C4",
|
|
|
|
|
# flake8-debugger => no debugger usage
|
|
|
|
|
"T100",
|
|
|
|
|
# flake8-docstrings => PEP257 compliance
|
|
|
|
|
"D1", "D2", "D3", "D4",
|
|
|
|
|
# flake8-quotes => use double quotes everywhere (complying with black)
|
|
|
|
|
"Q0",
|
|
|
|
|
# pep8-naming
|
|
|
|
|
"N8",
|
|
|
|
|
# =====
|
|
|
|
|
# other
|
|
|
|
|
# =====
|
|
|
|
|
# flake8-annotations => enforce type checking for functions
|
|
|
|
|
"ANN0", "ANN2", "ANN3",
|
|
|
|
|
# flake8-black => complain if black would make changes
|
|
|
|
|
"BLK1", "BLK9",
|
|
|
|
|
# flake8-pytest-style => enforce a consistent style with pytest
|
|
|
|
|
"PT0",
|
|
|
|
|
]
|
|
|
|
|
|
|
|
|
|
# By default, flake8 ignores some errors.
|
|
|
|
|
# Instead, do not ignore anything.
|
|
|
|
|
ignore = []
|
|
|
|
|
|
|
|
|
|
# If --ignore is passed on the command
|
|
|
|
|
# line, still ignore the following:
|
|
|
|
|
extend-ignore = [
|
|
|
|
|
# Too long line => duplicate with E501.
|
|
|
|
|
"B950",
|
|
|
|
|
# Comply with black's style.
|
|
|
|
|
# Source: https://github.com/psf/black/blob/master/docs/compatible_configs.md#flake8
|
2026-11-28 02:01:12 +01:00
|
|
|
"E203", "W503",
|
2026-11-25 14:55:43 +01:00
|
|
|
# Let's not do `@pytest.mark.no_cover()` instead of `@pytest.mark.no_cover`.
|
|
|
|
|
"PT023",
|
|
|
|
|
]
|
|
|
|
|
|
|
|
|
|
per-file-ignores = [
|
|
|
|
|
# Top-levels of a sub-packages are intended to import a lot.
|
2026-11-28 02:01:12 +01:00
|
|
|
"**/__init__.py:F401",
|
2026-11-25 14:55:43 +01:00
|
|
|
# Type annotations are not strictly enforced.
|
|
|
|
|
"migrations/env.py:ANN0,ANN2",
|
|
|
|
|
# - 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",
|
|
|
|
|
# Type annotations are not strictly enforced.
|
|
|
|
|
"noxfile.py:ANN0,ANN2",
|
2026-11-25 14:55:43 +01:00
|
|
|
# - ANN0, ANN2 => 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 02:01:12 +01:00
|
|
|
"tests/*.py:ANN0,ANN2,D106,S101,S311",
|
2026-11-25 14:55:43 +01:00
|
|
|
]
|
|
|
|
|
|
|
|
|
|
# Explicitly set mccabe's maximum complexity to 10 as recommended by
|
|
|
|
|
# Thomas McCabe, the inventor of the McCabe complexity, and the NIST.
|
|
|
|
|
# Source: https://en.wikipedia.org/wiki/Cyclomatic_complexity#Limiting_complexity_during_development
|
|
|
|
|
max-complexity = 10
|
|
|
|
|
|
|
|
|
|
# Comply with black's style.
|
|
|
|
|
# Source: https://github.com/psf/black/blob/master/docs/the_black_code_style.md#line-length
|
|
|
|
|
max-line-length = 88
|
|
|
|
|
|
|
|
|
|
# Preview the code lines that cause errors.
|
|
|
|
|
show-source = true
|
|
|
|
|
|
|
|
|
|
# darglint
|
|
|
|
|
strictness = "long"
|
|
|
|
|
# flake8-docstrings
|
|
|
|
|
docstring-convention = "google"
|
|
|
|
|
|
|
|
|
|
# ==============================
|
|
|
|
|
# flake8-pytest-style's settings
|
|
|
|
|
# ==============================
|
|
|
|
|
# Prefer @pytest.fixture over @pytest.fixture().
|
|
|
|
|
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]
|
|
|
|
|
# Source: https://pycqa.github.io/isort/docs/configuration/options.html
|
|
|
|
|
|
|
|
|
|
atomic = true
|
|
|
|
|
case_sensitive = true
|
|
|
|
|
combine_star = true
|
|
|
|
|
force_alphabetical_sort_within_sections = true
|
|
|
|
|
lines_after_imports = 2
|
|
|
|
|
remove_redundant_aliases = true
|
|
|
|
|
|
|
|
|
|
# Comply with black's style
|
|
|
|
|
# Source: https://github.com/psf/black/blob/master/docs/compatible_configs.md#isort
|
|
|
|
|
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
|
|
|
|
|
# => All imports go on a single line except the ones from the typing module
|
|
|
|
|
# Source: https://google.github.io/styleguide/pyguide.html#313-imports-formatting
|
|
|
|
|
force_single_line = true
|
|
|
|
|
single_line_exclusions = ["typing"]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2026-11-25 14:46:02 +01:00
|
|
|
[tool.mypy]
|
|
|
|
|
# Source: https://mypy.readthedocs.io/en/stable/config_file.html
|
|
|
|
|
|
|
|
|
|
cache_dir = ".cache/mypy"
|
|
|
|
|
|
|
|
|
|
# Check the interior of functions without type annotations
|
|
|
|
|
check_untyped_defs = true
|
|
|
|
|
|
|
|
|
|
# Disallow generic types without explicit type parameters
|
|
|
|
|
disallow_any_generics = true
|
|
|
|
|
|
|
|
|
|
# Disallow functions with incomplete type annotations
|
|
|
|
|
disallow_incomplete_defs = true
|
|
|
|
|
|
|
|
|
|
# Disallow calling functions without type annotations
|
|
|
|
|
disallow_untyped_calls = true
|
|
|
|
|
|
|
|
|
|
# Disallow functions without type annotations (or incomplete annotations)
|
|
|
|
|
disallow_untyped_defs = true
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[[tool.mypy.overrides]]
|
|
|
|
|
|
|
|
|
|
module = [
|
|
|
|
|
"folium.*",
|
|
|
|
|
"geopy.*",
|
|
|
|
|
"googlemaps.*",
|
|
|
|
|
"matplotlib.*",
|
|
|
|
|
"nox.*",
|
|
|
|
|
"numpy.*",
|
|
|
|
|
"ordered_set.*",
|
|
|
|
|
"packaging",
|
|
|
|
|
"pandas",
|
|
|
|
|
"pytest",
|
|
|
|
|
"rpy2.*",
|
|
|
|
|
"sqlalchemy.*",
|
|
|
|
|
"statsmodels.*",
|
|
|
|
|
"utm.*",
|
|
|
|
|
]
|
|
|
|
|
|
|
|
|
|
ignore_missing_imports = true
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2026-11-25 14:43:31 +01:00
|
|
|
[tool.pytest.ini_options]
|
|
|
|
|
# Source: https://docs.pytest.org/en/stable/reference/reference.html#ini-options-ref
|
|
|
|
|
|
|
|
|
|
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 = [
|
|
|
|
|
"ignore:::patsy.*",
|
|
|
|
|
]
|
|
|
|
|
|
|
|
|
|
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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[tool.uv]
|
|
|
|
|
# Source: https://docs.astral.sh/uv/reference/settings/
|
|
|
|
|
|
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" },
|
|
|
|
|
]
|