753eaf23e4
Merge branch 'unquoted-annotations' into develop
...
CI / Tests (test-types) (push) Successful in 1m45s
CI / Tests (test) (push) Successful in 1m47s
CI / Lint (push) Successful in 1m50s
CI / Tests (test-with-3.15) (push) Successful in 1m51s
Reviewed-on: #23
2026-12-03 13:10:48 +01:00
3b52ee0525
Remove the quotes from the type annotations
...
CI / Tests (test-types) (push) Successful in 1m46s
CI / Tests (test) (push) Successful in 1m47s
CI / Tests (test-with-3.15) (push) Successful in 1m51s
CI / Lint (push) Successful in 2m8s
PEP 649 makes them unnecessary,
and `sqlalchemy` v2.1 resolves the lazy annotations of the models.
2026-12-03 13:04:17 +01:00
ed739ed756
Drop support for Python 3.13
...
Python 3.14 evaluates annotations lazily (PEP 649),
so forward references need no quotes.
We make the tool targets, the lock files,
and the CI matrix follow the new minimum.
In order to use the new features,
we must drop support for Python 3.13
2026-12-03 13:03:11 +01:00
2bfd936087
Merge branch 'lint-cleanups' into develop
...
CI / Tests (test-types) (push) Successful in 2m4s
CI / Tests (test) (push) Successful in 2m8s
CI / Tests (test-with-3.15) (push) Successful in 2m12s
CI / Tests (test-with-3.13) (push) Successful in 2m21s
CI / Lint (push) Successful in 2m25s
Reviewed-on: #22
2026-12-03 12:26:18 +01:00
f9fce093d1
Skip the per-file ignores reformatting in git blame
CI / Tests (test-types) (push) Successful in 2m8s
CI / Tests (test) (push) Successful in 2m11s
CI / Tests (test-with-3.15) (push) Successful in 2m15s
CI / Tests (test-with-3.13) (push) Successful in 2m22s
CI / Lint (push) Successful in 2m39s
2026-12-03 11:48:33 +01:00
47a22f9587
Put the ruff per-file ignores on separate lines
...
Each reason now sits next to its codes,
which reads better than a separate list.
2026-12-03 11:47:32 +01:00
7a000145a7
Lint the notebooks in the lint session
...
Only `ruff` checks them because the formatters would rewrite the cells.
The per-file ignores fit exploratory code that is never rerun.
2026-12-03 11:45:38 +01:00
a06cb5bdfb
Resolve the remaining ruff findings
...
Every change keeps the values the same, so the stored outputs stay valid.
`init_r` keeps its import because only its side effect matters.
2026-12-03 11:33:14 +01:00
f9643642b8
Use isna() and notna()
...
`isnull()` and `notnull()` are mere aliases,
so the stored outputs stay valid.
2026-12-03 11:33:10 +01:00
9c409b619e
Apply the safe ruff fixes
...
The fixes keep every value the same, so the stored outputs stay valid.
For example, `np.NaN` becomes `np.nan`, which `numpy` v2 requires.
2026-12-03 11:33:04 +01:00
50889df241
Skip the comment-only commits in git blame
2026-12-03 11:15:36 +01:00
c18fc2ba59
Refer to sources with "See:" in comments
2026-12-03 11:09:38 +01:00
f90f263dab
Explain the "why" in a few more comments
...
Comments that only repeated the code are removed.
2026-12-03 11:06:36 +01:00
51f68743e5
Reword the comments in the config files
...
Each comment is one sentence or two short ones
joined by "=>", without a final period.
2026-12-03 11:06:17 +01:00
bca4250b4d
Reword the comments in the test suite
...
Each comment is one sentence or two short ones
joined by "=>", without a final period.
2026-12-03 10:52:25 +01:00
0f69709226
Reword the comments in the rest of velofy
...
Each comment is one sentence or two short ones
joined by "=>", without a final period.
2026-12-03 10:46:42 +01:00
9b8fe8b8fd
Reword the comments in velofy.forecasts
...
Each comment is one sentence or two short ones
joined by "=>", without a final period.
2026-12-03 10:43:55 +01:00
1413d08ed9
Reword the comments in velofy.db
...
Each comment is one sentence or two short ones joined by "=>", without a final period.
2026-12-03 10:38:28 +01:00
ff7f705bc8
Put identifiers in comments into backticks
2026-12-03 10:17:12 +01:00
2f1afd459f
Break multi-line comments before conjunctions
2026-12-03 10:13:13 +01:00
049a5f6f62
Remove periods from one-sentence comments
2026-12-03 10:04:43 +01:00
454c2898a0
Remove the F401 ignore for __init__.py files
...
All re-exporting packages declare `__all__`;
so, unused imports are reported there, too.
2026-12-03 09:48:27 +01:00
732a74be1c
Declare __all__ in all re-exporting packages
...
Then, the linters know the imports are re-exports and not unused.
2026-12-03 09:44:07 +01:00
e5c7487515
Merge branch 'ci-and-infra' into develop
...
CI / Tests (test-types) (push) Successful in 2m0s
CI / Tests (test) (push) Successful in 2m2s
CI / Tests (test-with-3.15) (push) Successful in 2m4s
CI / Tests (test-with-3.13) (push) Successful in 2m16s
CI / Lint (push) Successful in 2m16s
Reviewed-on: #21
2026-12-03 01:25:32 +01:00
8b5e66d70b
Install only nox and pre-commit in CI
...
CI / Tests (test-types) (push) Successful in 2m3s
CI / Tests (test) (push) Successful in 2m6s
CI / Tests (test-with-3.15) (push) Successful in 2m10s
CI / Lint (push) Successful in 2m20s
CI / Tests (test-with-3.13) (push) Successful in 2m21s
The `nox` sessions install `velofy` and its dependencies themselves;
so, a full `uv sync` only duplicated that work.
2026-12-03 01:12:31 +01:00
53746966ac
Cache uv between CI runs
...
All jobs restore built wheels (e.g., `rpy2`) and the Python versions
instead of building or fetching them again.
Only the "lint" job saves the cache, pruned to what is expensive to rebuild,
and only when its key changed; so, five jobs do not compress the same archive
in parallel, and unchanged runs skip the 15s of packing.
2026-12-03 01:12:30 +01:00
e1cdac4cfa
Run the CI checks in parallel jobs
...
The test sessions run as a matrix, each with its own database.
This also adds the "test-with" sessions to CI;
so, the setup installs all `SUPPORTED_PYTHONS` via `uv`,
as `nox` would otherwise pick the system Python 3.13,
which lacks the headers to build `rpy2`.
2026-12-03 01:12:29 +01:00
49276bb9cf
Pull the CI setup into a composite action
...
The upcoming parallel jobs share it.
2026-12-03 01:12:28 +01:00
cc45b78e5d
Rename the CI job and add a timeout
...
The version in the name broke the required status check
when 3.14 became the `MAIN_PYTHON`.
The timeout ensures the CI server stays ready
even when something goes badly wrong.
2026-12-03 01:12:28 +01:00
9be63c3fef
Merge branch 'python-3.14' into develop
...
CI / Checks (Python 3.14) (push) Successful in 2m43s
Reviewed-on: #20
2026-12-02 22:30:07 +01:00
2a64958a93
Make Python 3.14 the MAIN_VERSION
...
CI / Checks (Python 3.14) (push) Successful in 2m46s
`requires-python` stays at ">=3.13"; so, `uv.lock` is unchanged
and 3.13 is tested with the "test-with" session.
2026-12-02 21:54:16 +01:00
df53ce7bc4
Pin MAIN_PYTHON in the "init-project" session
...
Otherwise, `uv` creates ".venv" with the newest installed Python.
2026-12-02 21:49:17 +01:00
67917ae3f6
Type check against the oldest Python version
...
Without a configured version, `mypy` and `pyright`
check against the Python that runs them.
With `MAIN_PYTHON` at 3.14, they would accept
`stdlib` APIs and `typing` features new in 3.14.
Yet, `requires-python` promises 3.13;
so, the type checkers must flag such code.
`black` and `ruff` already target 3.13 for the same reason.
2026-12-02 21:42:06 +01:00
b947337bd1
Remove flake8-return
...
It crashes on Python 3.14 (`ast.NameConstant` is gone) and is unmaintained.
`ruff` covers its rules.
2026-12-02 21:39:21 +01:00
80d2573f0d
Remove flake8-pie
...
It crashes on Python 3.14 (`ast.Str` is gone) and is unmaintained.
`ruff` covers its rules.
2026-12-02 21:27:27 +01:00
5609e8ec6e
Test with Python 3.14 and 3.15
...
The new "test-with" session runs the test suite with non-main Python versions;
yet, `MAIN_PYTHON` stays at 3.13
2026-12-02 17:43:05 +01:00
a85d426b6e
Merge branch 'alembic-api' into develop
...
CI / Checks (Python 3.13) (push) Successful in 2m47s
Reviewed-on: #19
2026-12-02 14:05:17 +01:00
35d0c7b409
Test reading the database revision
...
CI / Checks (Python 3.13) (push) Successful in 2m50s
In the "sequentially" variant of the test database,
`current_db_revision()` must return the head of the migrations;
in the "all_at_once" variant, there is no version table.
2026-12-02 13:56:04 +01:00
2add322a25
Test the revision lock of the CLI stages
...
The `@db_revision` decorator no longer skips its check under `TESTING`.
The tests replace `current_db_revision()` with the revision they need.
2026-12-02 13:42:04 +01:00
eb059c1ea5
Read the database revision with the Alembic API
...
The `@db_revision` decorator no longer runs `alembic current` in a subprocess,
which only worked from the project folder and reported any failure as a wrong revision.
Also, its docstring now explains that it locks completed stages of the data pipeline.
2026-12-02 13:35:37 +01:00
ef7b41e675
Merge branch 'directions-json' into develop
...
CI / Checks (Python 3.13) (push) Successful in 2m47s
Reviewed-on: #18
2026-12-02 11:43:02 +01:00
664dccee02
Store the directions of paths as JSON arrays
...
CI / Checks (Python 3.13) (push) Successful in 2m46s
The data migration converts the 42 existing rows
from a JSON-encoded string into a JSON array.
2026-12-02 11:23:01 +01:00
bbd7d6a279
Store Path._directions as a JSON array
...
The column is of type `JSON`,
but the code stored a JSON-encoded string in it;
so, the data was encoded twice.
A later data migration converts the existing rows.
2026-12-02 09:03:49 +01:00
2b1dd6af35
Merge branch 'sqlalchemy-select' into develop
...
CI / Checks (Python 3.13) (push) Successful in 2m46s
Reviewed-on: #17
2026-12-02 00:38:24 +01:00
fc185fa3c0
Create the engine and the session on first use
...
CI / Checks (Python 3.13) (push) Successful in 2m47s
The global `db.session` is now a `scoped_session`,
like, for example, in Flask-SQLAlchemy.
Importing the package no longer creates an engine;
so, the placeholder for the tests is obsolete.
The `db_session` fixture replaces `db.session` with `monkeypatch`
such that it is reset after each test.
Tests without the fixture get a placeholder that fails loudly
instead of opening a real session,
which would block the `DROP SCHEMA` at the end of the test run.
2026-12-02 00:23:41 +01:00
9d98021b11
Request the db_session fixture
...
The test queries the database but relied on the
global `db.session` that the previous test had left behind.
2026-12-02 00:19:51 +01:00
bc2e3f439d
Count with .scalar_one() in velofy.console.gridify
...
A `COUNT` always returns exactly one row; `.scalar_one()`
is typed as `int` and is used for all other counts as well.
2026-12-01 23:51:00 +01:00
185a37f7d4
Query with select() in the forecasting models
...
`Session.query()` is the legacy API in SQLAlchemy 2.x.
`.one_or_none()` expresses that the unique constraint
on the five filtered columns allows at most one cached `Forecast`.
2026-12-01 23:48:36 +01:00
2eb6b5769f
Query with select() in Pixel
...
`Session.query()` is the legacy API in SQLAlchemy 2.x.
The addresses with restaurants are now selected with a subquery in one statement.
The `_restaurants_mock` fixture mocks the new call chain.
2026-12-01 23:45:35 +01:00
0dc3e11a63
Query with select() in Customer
...
`Session.query()` is the legacy API in SQLAlchemy 2.x.
The delivery and pickup addresses are now selected with subqueries in one statement each.
2026-12-01 23:39:44 +01:00