Merge branch 'upgrade-dependencies-py313' into develop
All checks were successful
CI / Tests (Python 3.13) (push) Successful in 1m14s

This commit is contained in:
Alexander Hess 2026-11-25 14:19:08 +01:00
commit 63c9453ce7
Signed by: alexander
GPG key ID: B46EDB4DFC26805D
11 changed files with 819 additions and 8867 deletions

View file

@ -15,7 +15,7 @@ defaults:
jobs:
test:
name: Tests (Python 3.8)
name: Tests (Python 3.13)
runs-on: debian-13
# Throwaway database, reachable from the job as host `postgres`
@ -38,11 +38,10 @@ jobs:
- uses: actions/checkout@v4
- name: Install system packages (psycopg2 and R)
- name: Install system packages (R)
run: |
apt-get update
apt-get install --no-install-recommends \
libpq-dev \
r-base-dev \
r-cran-forecast \
r-cran-zoo \
@ -52,12 +51,12 @@ jobs:
run: |
curl -LsSf https://astral.sh/uv/install.sh | sh
echo "$HOME/.local/bin" >> "$GITHUB_PATH"
"$HOME/.local/bin/uv" python install 3.8
"$HOME/.local/bin/uv" python install 3.13
"$HOME/.local/bin/uv" tool install --python 3.13 'poetry>=2'
- name: Install the project
run: |
uv venv --python 3.8 --seed .venv
uv venv --python 3.13 --seed .venv
poetry sync --no-interaction
# `TESTING=true` comes from `setup.cfg`

View file

@ -63,7 +63,7 @@ SRC_LOCATIONS = (
PYTEST_LOCATION,
)
PYTHON = '3.8'
PYTHON = '3.13'
# Use a unified .cache/ folder for all tools.
nox.options.envdir = '.cache/nox'

9307
poetry.lock generated

File diff suppressed because it is too large Load diff

View file

@ -24,25 +24,25 @@ license = "MIT"
readme = "README.md"
requires-python = ">=3.8,<4.0"
requires-python = ">=3.13,<4.0"
# Package => Code developed in *.py files and packaged under src/velofy
dependencies = [
"Shapely>=1.7.1,<3",
"alembic>=1.4.2,<2",
"click>=7.1.2,<9",
"folium>=0.12.1,<1",
"geopy>=2.1.0,<3",
"googlemaps>=4.4.2,<5",
"matplotlib>=3.3.3,<4",
"ordered-set>=4.0.2,<5",
"pandas>=1.1.0,<3",
"psycopg2>=2.8.5,<3", # Adapter for PostgreSQL
"rpy2>=3.4.1,<4",
"sqlalchemy>=1.3.18,<3",
"statsmodels>=0.12.1,<0.15",
"utm>=0.7.0,<1",
"Shapely>=2.2.0,<3",
"alembic>=1.20.1,<2",
"click>=8.5.1,<9",
"folium>=1.0.0,<2",
"geopy>=2.5.0,<3",
"googlemaps>=4.10.0,<5",
"matplotlib>=3.11.2,<4",
"ordered-set>=4.1.0,<5",
"pandas>=3.1.1,<4",
"psycopg[binary]>=3.3.9,<4", # Adapter for PostgreSQL
"rpy2>=3.6.9,<4",
"sqlalchemy>=2.1.9,<3",
"statsmodels>=0.15.0,<0.16",
"utm>=0.9.0,<0.10",
]
@ -50,9 +50,9 @@ dependencies = [
# `jupyter lab` => Notebooks with analyses using the developed package
research = [
"jupyterlab>=2.2.2",
"numpy>=1.19.1",
"pytz>=2020.1",
"jupyterlab>=4.6.6,<5",
"numpy>=2.5.5,<3",
"pytz>=2026.6",
]
@ -70,7 +70,7 @@ repository = "https://code.webartifex.de/alexander/velofy"
[tool.black]
target-version = ["py38"]
target-version = ["py313"]
line-length = 88
@ -81,33 +81,31 @@ skip-string-normalization = true # `wemake-python-styleguide` enforces single q
[tool.poetry.group.dev.dependencies]
# Task Runners
nox = ">=2020.5.24"
pre-commit = ">=2.6.0"
nox = ">=2026.10.20"
pre-commit = ">=4.7.0,<5"
# Code Formatters
autoflake = ">=1.3.1"
black = ">=19.10b0"
isort = ">=4.3.21"
autoflake = ">=2.4.0,<3"
black = ">=25.12.0,<26"
isort = ">=9.0.2,<10"
# Code Analyzers
flake8 = ">=3.8.3"
flake8-annotations = ">=2.3.0"
flake8-black = ">=0.2.1"
flake8-pytest-style = ">=1.2.2"
mypy = ">=0.782"
wemake-python-styleguide = ">=0.14.1" # `flake8` plug-in
flake8 = ">=7.5.0,<8"
flake8-annotations = ">=3.3.1,<4"
flake8-black = ">=0.5.0,<0.6"
flake8-pytest-style = ">=2.2.0,<3"
mypy = ">=2.4.1,<3"
# Test Suite
Faker = ">=5.0.1"
factory-boy = ">=3.1.0"
geopy = "^2.1.0"
packaging = ">=20.4" # Used to test the packaged version
pytest = ">=6.0.1"
pytest-cov = ">=2.10.0"
pytest-env = ">=0.6.2"
pytest-mock = ">=3.5.1"
xdoctest = { version=">=0.13.0", extras=["optional"] }
Faker = ">=40.63.0,<41"
factory-boy = ">=3.3.3,<4"
packaging = ">=26.4" # Used to test the packaged version
pytest = ">=9.2.0,<10"
pytest-cov = ">=7.1.0,<8"
pytest-env = ">=1.8.8,<2"
pytest-mock = ">=3.17.0,<4"
xdoctest = { version=">=1.3.2,<2", extras=["optional"] }
# Documentation
sphinx = ">=3.1.2"
sphinx-autodoc-typehints = ">=1.11.0"
sphinx = ">=9.2.0,<10"
sphinx-autodoc-typehints = ">=3.17.7,<4"

View file

@ -188,7 +188,7 @@ class Forecast(meta.Base):
for timestamp_idx in data.index:
start_at = timestamp_idx.to_pydatetime()
actual = int(data.loc[timestamp_idx, 'actual'])
prediction = round(data.loc[timestamp_idx, 'prediction'], 5)
prediction = float(round(data.loc[timestamp_idx, 'prediction'], 5))
# Explicit type casting. SQLAlchemy does not convert
# `float('NaN')`s into plain `None`s.
@ -201,22 +201,22 @@ class Forecast(meta.Base):
if math.isnan(low80):
low80 = None
else:
low80 = round(low80, 5)
low80 = float(round(low80, 5))
if math.isnan(high80):
high80 = None
else:
high80 = round(high80, 5)
high80 = float(round(high80, 5))
if math.isnan(low95):
low95 = None
else:
low95 = round(low95, 5)
low95 = float(round(low95, 5))
if math.isnan(high95):
high95 = None
else:
high95 = round(high95, 5)
high95 = float(round(high95, 5))
forecasts.append(
cls(

View file

@ -50,8 +50,8 @@ def predict(
# Create a point forecast by linear extrapolation
# for one or even more time steps ahead.
slope = trend[-1] - trend[-2]
prediction = trend[-1] + slope
slope = trend.iloc[-1] - trend.iloc[-2]
prediction = trend.iloc[-1] + slope
idx = observations.index.max() + seasonal_lag
while idx <= forecast_interval.max():
if idx in forecast_interval:

View file

@ -162,7 +162,7 @@ class OrderHistory:
gen = (
(pixel_id, start_at)
for pixel_id in sorted(data.index.levels[0])
for start_at in pd.date_range(start, end, freq=f'{self._time_step}T')
for start_at in pd.date_range(start, end, freq=f'{self._time_step}min')
if config.SERVICE_START <= start_at.hour < config.SERVICE_END
)

View file

@ -65,10 +65,10 @@ class TestCLIWithoutCommand:
@pytest.mark.no_cover
def test_no_options(self, cli):
"""Exit with 0 status code and no output if run without options."""
"""Exit with 2 status code (usage error) if run without options."""
result = cli.invoke(main.entry_point)
assert result.exit_code == 0
assert result.exit_code == 2
# The following test cases validate the --version / -V option.

View file

@ -18,7 +18,9 @@ def random_timespan( # noqa:WPS211
"""A randomized `timedelta` object between the specified arguments."""
total_min_seconds = min_hours * 3600 + min_minutes * 60 + min_seconds
total_max_seconds = max_hours * 3600 + max_minutes * 60 + max_seconds
return dt.timedelta(seconds=random.randint(total_min_seconds, total_max_seconds))
return dt.timedelta(
seconds=random.randint(int(total_min_seconds), int(total_max_seconds))
)
def early_in_the_morning():

View file

@ -52,7 +52,7 @@ def vertical_datetime_index():
start_ats = pd.date_range(
test_config.START,
test_config.END,
freq=f'{test_config.LONG_TIME_STEP}T',
freq=f'{test_config.LONG_TIME_STEP}min',
)
gen = (
start_at
@ -107,7 +107,7 @@ def order_totals(good_pixel_id):
start_ats = pd.date_range(
test_config.START,
test_config.END,
freq=f'{test_config.LONG_TIME_STEP}T',
freq=f'{test_config.LONG_TIME_STEP}min',
)
gen = (
(pixel_id, start_at)

View file

@ -38,7 +38,7 @@ def forecast_interval():
start_ats = pd.date_range(
first_start_at,
end_of_day,
freq=f'{test_config.LONG_TIME_STEP}T',
freq=f'{test_config.LONG_TIME_STEP}min',
)
gen = (
start_at