Skip to content

fix(deps): regenerate bias-detection requirements for Python 3.14 - #6261

Merged
daggerstuff merged 1 commit into
stagingfrom
fix/bias-req-py314
Oct 6, 2026
Merged

daggerstuff merged 1 commit into
stagingfrom
fix/bias-req-py314

Conversation

@daggerstuff

Copy link
Copy Markdown
Owner

Summary

  • Regenerates apps/web/src/lib/ai/bias-detection/requirements.txt for Python 3.14 (CI runs CPython 3.14.7 since 83fa697)
  • Root cause of the persistent Python ML Tests failure: tensorflow==2.21.0rc0 has no cp314 wheels, so Install Python dependencies could never resolve
  • Chain of fixes: tensorflow→2.22.0rc0 (only cp314-capable release), h5py→3.15.1, fairlearn→0.14.0 (unblocks scipy), scipy→1.17.1 (first cp314 stable), keras-nightly pinned to the April-2026 era dev build matching keras 3.15.0, torch 2.13.0 CUDA family added per current Linux wheel metadata

Test plan

  • Clean-env CI-equivalent install succeeds on CPython 3.14.8 (uv pip install -r requirements.txt with numpy/pandas binary constraints)
  • Imports verified: tensorflow 2.22.0-rc0, keras 3.15.0.dev, h5py 3.15.1, scipy 1.17.1, fairlearn 0.14.0
  • Exact CI test command passes: uv run python -m pytest tests/test_bias_detection_service.py --cov=... --cov-fail-under=25 → 22/22 passed, coverage 39.95%
  • This PR's own Python ML Tests should go green for the first time since Sep 28

🤖 Generated with Claude Code

The Python 3.13.13 -> 3.14.7 CI bump (83fa697) broke resolution of
apps/web/src/lib/ai/bias-detection/requirements.txt: tensorflow==2.21.0rc0
has no cp314 wheels, so "Install Python dependencies" fails on every PR
touching the bias-detection path.

- tensorflow 2.21.0rc0 -> 2.22.0rc0 (only release with cp314 wheels)
- h5py 3.14.0 -> 3.15.1 (required by TF 2.22.0rc0 wheel metadata)
- add keras-nightly==3.15.0.dev2026040704 (required by TF RC; pinned to
  the April 2026 era build matching keras 3.15.0, not a bleeding daily)
- fairlearn 0.13.0 -> 0.14.0 (0.13 caps scipy <1.16, which has no cp314)
- scipy 1.15.3 -> 1.17.1 (first stable scipy with cp314 wheels)
- torch 2.13.0 CUDA family (cuda-toolkit, nvidia-*-13) added per current
  Linux wheel metadata
- regenerated the self-bootstrap file with `uv pip compile
  requirements.txt -o requirements.txt --python-version 3.14`

Verified in a clean environment: full CI-equivalent install succeeds on
CPython 3.14.8, imports OK (tensorflow 2.22.0-rc0, keras 3.15.0.dev,
h5py 3.15.1, scipy 1.17.1, fairlearn 0.14.0), and the exact CI test
command passes: 22/22 tests, coverage 39.95% (threshold 25%).

Co-Authored-By: Claude Code <noreply@anthropic.com>
@sourcery-ai

sourcery-ai Bot commented Oct 6, 2026

Copy link
Copy Markdown
Contributor

Sorry @daggerstuff, you've used your own review budget of 250,000 diff characters for the last 7 days.

You can request another review in 3 days and 7 hours by commenting @sourcery-ai review. Upgrade to get a review now.

@vercel

vercel Bot commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
pixelated Ready Ready Preview Oct 6, 2026 7:31am UTC

Request Review

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AutoReview

No rule-based issues detected.

@github-actions

github-actions Bot commented Oct 6, 2026

Copy link
Copy Markdown

px Advisor Review

Risk: unknown

No summary available

No findings.

@github-actions

github-actions Bot commented Oct 6, 2026

Copy link
Copy Markdown

Lighthouse CI Results

Routes audited: /, /dashboard?perf=1, /training-session

Thresholds: Performance ≥90 | Accessibility ≥90 | Best Practices ≥85

Reports

  • lhr-1791271915351
  • lhr-1791271926783
  • lhr-1791271937784
  • lhr-1791271948263
  • lhr-1791271958736
  • lhr-1791271969232
  • lhr-1791271979749
  • lhr-1791271990226
  • lhr-1791272000634

Reports are also available as workflow artifacts

# -r requirements.txt
# ipywidgets
keras==3.15.0
# via -r requirements.txt

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: The requirements.txt file lists both keras and keras-nightly. These packages conflict by installing to the same namespace, creating a fragile dependency resolution.
Severity: MEDIUM

Suggested Fix

Remove the explicit keras==3.15.0 dependency from requirements.txt. The correct version, keras-nightly, is already included as a transitive dependency of tensorflow, which is the intended package. This ensures the correct version is always installed.

Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent. Verify if this is a real issue. If it is, propose a fix; if not, explain why it's
not valid.

Location: apps/web/src/lib/ai/bias-detection/requirements.txt#L347

Potential issue: The `requirements.txt` file specifies both `keras==3.15.0` and
`keras-nightly==3.15.0.dev2026040704`. Both packages install to the same `keras/` module
directory, causing one to overwrite the other. Since `tensorflow` is used in the
application and requires the nightly version, the application's behavior becomes
dependent on the non-deterministic installation order of the package manager. If the
stable `keras` package is installed last, it will overwrite the required `keras-nightly`
and cause runtime failures when TensorFlow's internal Keras APIs are called.

Also affects:

  • apps/web/src/lib/ai/bias-detection/requirements.txt:333~333

Did we get this right? 👍 / 👎 to inform future reviews.

@daggerstuff
daggerstuff merged commit 9077d67 into staging Oct 6, 2026
52 checks passed
@daggerstuff
daggerstuff deleted the fix/bias-req-py314 branch October 6, 2026 08:03
@linear-code

linear-code Bot commented Oct 6, 2026

Copy link
Copy Markdown
Contributor

PIX-4760

This branch was successfully deployed

1 active deployment
Preview — d50051ab Deployed Oct 6, 2026 by vercel[bot]
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.

2 participants