Skip to content

fix: bump requests-cache dependency - #362

Open
timothykou wants to merge 1 commit into
openclimatefix:mainfrom
timothykou:fix/requests-cache-runtime
Open

fix: bump requests-cache dependency#362
timothykou wants to merge 1 commit into
openclimatefix:mainfrom
timothykou:fix/requests-cache-runtime

Conversation

@timothykou

@timothykou timothykou commented Jul 2, 2026

Copy link
Copy Markdown

Summary

  • Bump requests-cache from 1.2.0 to 1.3.2
  • Keeps the existing exact-pin dependency style used in pyproject.toml
  • Addresses the currently reproducible dependency/runtime failure discussed in Dependencies Out of Date #316
  • Addresses the same RequestsCookieJar runtime failure currently visible in the unit-test CI logs

Reproduction

With the current main dependency pin, examples/example.py fails after fetching Open-Meteo data:

NameError: name 'RequestsCookieJar' is not defined

The failure comes from requests-cache==1.2.0 serializing/deserializing cached responses with current transitive dependencies.

CI note

The currently failing visible unit-test check on this fork PR is a pull_request_target run that checks out upstream main, so it installs requests-cache==1.2.0 and reproduces the same RequestsCookieJar failure before this PR branch is actually tested. This PR addresses the underlying dependency/runtime failure; it does not change the workflow checkout behavior.

Verification

uv sync
.venv/bin/python examples/example.py
.venv/bin/python -m pytest tests/unit -q

Result:

examples/example.py -> [192 rows x 1 columns]
tests/unit -> 22 passed, 4 warnings

I also verified a clean installed-package path outside the source tree:

python3.11 -m venv /private/tmp/ocf-902-pr-venv
/private/tmp/ocf-902-pr-venv/bin/python -m pip install /path/to/Open-Source-Quartz-Solar-Forecast
/private/tmp/ocf-902-pr-venv/bin/python - <<'PY'
from datetime import datetime
from quartz_solar_forecast.forecast import run_forecast
from quartz_solar_forecast.pydantic_models import PVSite

site = PVSite(latitude=51.75, longitude=-1.25, capacity_kwp=1.25)
predictions_df = run_forecast(site=site, ts=datetime.today(), nwp_source="icon")
print(predictions_df.shape)
print(predictions_df["power_kw"].max())
PY

Result:

(192, 1)

@timothykou

Copy link
Copy Markdown
Author

CI note: the visible failing branch_ci / test-unit (3.11) check appears to be from the pull_request_target workflow, and its log shows it checked out refs/remotes/origin/main at d9b3c95, not this PR branch. It also installed requests-cache==1.2.0, which this PR changes to 1.3.2, so that failing check is not exercising the branch change. The fork pull_request workflow is currently action_required, likely waiting for maintainer approval to run. Local verification from the PR body still applies.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant