No 0.x release of `wemake-python-styleguide` runs on Python 3.12+.
The current version pins `flake8-commas` to v2.x,
which crashes on the new f-string tokenizer.
The 1.x releases no longer bundle the `flake8` plug-ins this project uses.
The plug-ins are added back explicitly, one by one, on a separate branch.
The dependencies stay in the same series as on Python 3.8
where those support 3.13.
Only the unavoidable upgrades are taken:
- `matplotlib` to v3.9
- `numpy` to v2.1
- `pandas` to v2.2
- `scipy` (via statsmodels)
Required code changes:
- `numpy` v2.1 prints its scalars as `np.float64(...)`,
which `psycopg2` then writes into the SQL
=> Adjust `Forecast.from_dataframe()` to convert the
rounded values into plain `float`s
- Python 3.12 no longer accepts `float`s in `random.randint()`
=> The test factories now pass the seconds as `int`s
CI and `nox` use a `u`v-managed Python, which ships the C headers
needed to build `psycopg2` and `rpy2`.
`flake8` v4 does not run on Python 3.12+
and is upgraded in a future commit.
The sessions in `noxfile.py` do not work since the migration to
Poetry 2: they use `poetry install --no-dev` and `poetry export`,
which Poetry 2 removed or moved into a plugin. The sessions are
reworked together with the other development tools.
... and two flake8 plugins
On Python 3.8, the three packages stay at the newest versions that work
with `flake8` v4, which `wemake-python-styleguide` v0.17 requires.
The lock file now also records their newer releases for newer Python versions.
The actual upgrade follows together with the switch to Python 3.13.
`isort` v5 honors the `single_line_exclusions = typing` setting in
`setup.cfg`, which `isort` v4 ignored.
So, the `typing` imports that were split onto separate lines to satisfy
`isort` v4 are combined again, as the configuration originally intended.
... from the dev dependencies.
Longer queries in SQLAlchemy get flagged even though they are not
complicated. Other expressions are generally not that complicated.
- problem: because of the randomization of test cases, every once in a
while, the schema holding the test db already exists and cannot be
created a second time (background: we run all tests against a db
created with `metadate.create_all()` by SQLAlchemy at once and
a db created by running all incremental Alchemy migration scripts)
- quick fix: possible, we could find a way to run all tests against
one of the two test db's in random order and then against the other
=> in the interest of time, we simply do not randomize the test cases
- add a Jupyter notebook that allows to install all project-external
dependencies regarding R and R packages
- adjust the GitHub Action workflow to also install R and the R packages
used within the project
- add a `init_r` module that initializes all R packages globally
once the `urban_meal_delivery` package is imported
- the function queries the database and aggregates the ad-hoc orders
by pixel and time steps into a demand time series
- implement "heavy" integration tests for `aggregate_orders()`
- make `pandas` a package dependency
- streamline the `Config`
- reorganize `urban_meal_delivery.console` into a sub-package
- move `tests.db.conftest` fixtures into `tests.conftest`
=> some integration tests regarding CLI scripts need a database
- add `urban_meal_delivery.console.decorators.db_revision` decorator
to ensure the database is at a certain state before a CLI script runs
- refactor the `urban_meal_delivery.db.grids.Grid.gridify()` constructor:
- bug fix: even empty `Pixel`s end up in the database temporarily
=> create `Pixel` objects only if an `Address` is to be assigned
to it
- streamline code and docstring
- add further test cases