Skip to content

[fix] Cap server dependency major versions - #15948

Merged
lukasmasuch merged 3 commits into
developfrom
lukasmasuch/pin-server-deps
Jul 14, 2026
Merged

lukasmasuch merged 3 commits into
developfrom
lukasmasuch/pin-server-deps

Conversation

@lukasmasuch

@lukasmasuch lukasmasuch commented Jul 12, 2026 •

Copy link
Copy Markdown
Collaborator

Describe your changes

Adds upper version bounds to previously-uncapped runtime dependencies in lib/pyproject.toml, to minimize breakage from future major releases:

  • Server-related deps capped at the next unreleased major version: starlette<2, uvicorn<1, httptools<1, anyio<5, python-multipart<1, websockets<17, itsdangerous<3. All caps sit above the currently-resolved latest versions, so no existing install is affected.
  • pyarrow capped at <25.0.0 as a documented exemption: pyarrow 25.0.0 crashes in Streamlit's script-thread import pattern (see apache/arrow#50471). To be relaxed once the upstream issue is resolved.
  • Documents the dependency-capping policy in the Python agent guides (lib/AGENTS.md, and the generated .cursor/rules/python.mdc / .github/instructions/python.instructions.md).

GitHub Issue Link (if applicable)

Testing Plan

  • No tests needed: dependency metadata + internal docs change. The server-dep caps are above the currently-installed versions, so resolution is unaffected; the pyarrow cap intentionally excludes the broken 25.0.0 release.

Cap the previously-uncapped server-related runtime dependencies
(starlette, uvicorn, httptools, anyio, python-multipart, websockets,
itsdangerous) at the next unreleased major version to minimize breaks
from future major releases. Document the dependency-capping policy in
the Python agent guides.
Copilot AI review requested due to automatic review settings July 12, 2026 12:34
@lukasmasuch
lukasmasuch requested a review from a team as a code owner July 12, 2026 12:34
@lukasmasuch lukasmasuch added impact:internal PR changes only affect internal code change:chore PR contains maintenance or housekeeping change labels Jul 12, 2026

Copilot AI left a comment

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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@snyk-io

snyk-io Bot commented Jul 12, 2026 •

Copy link
Copy Markdown
Contributor

✅ Snyk checks have passed. No issues have been found so far.

Status Scan Engine Critical High Medium Low Total (0)
✅ Open Source Security 0 0 0 0 0 issues
✅ Licenses 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

@github-actions

github-actions Bot commented Jul 12, 2026 •

Copy link
Copy Markdown
Contributor

✅ PR preview is ready!

Name Link
📦 Wheel file https://core-previews.s3-us-west-2.amazonaws.com/pr-15948/streamlit-1.58.0-py3-none-any.whl
📦 @streamlit/component-v2-lib Download from artifacts
🕹️ Preview app pr-15948.streamlit.app (☁️ Deploy here if not accessible)

@lukasmasuch

Copy link
Copy Markdown
Collaborator Author

Note on labeling: I labeled this impact:internal for consistency with prior dependency-management PRs (e.g. dependency bumps, "[chore] Pin pytest to 9.0.3"). The change only adds upper bounds above the currently-resolved versions, so no runtime behavior or existing install is affected. Happy to switch to impact:users if reviewers consider tightening the installable dependency set to be user-facing.

@lukasmasuch lukasmasuch added the ai-review If applied to PR or issue will run AI review workflow label Jul 12, 2026
@greptile-apps

greptile-apps Bot commented Jul 12, 2026 •

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR tightens Streamlit's dependency metadata and documents the policy. The main changes are:

  • Added upper bounds for server-related runtime dependencies.
  • Capped pyarrow below the crashing major release.
  • Added dependency-capping guidance to Python agent instruction files.

Confidence Score: 5/5

This looks safe to merge.

  • No blocking issues found in the changed code.

Important Files Changed

Filename Overview
lib/pyproject.toml Adds upper bounds to required runtime dependencies.
lib/AGENTS.md Documents the required dependency bound policy.
.cursor/rules/python.mdc Mirrors the dependency policy in generated Cursor guidance.
.github/instructions/python.instructions.md Mirrors the dependency policy in generated GitHub instructions.

Reviews (3): Last reviewed commit: "Merge remote-tracking branch 'origin/dev..." | Re-trigger Greptile

@github-actions github-actions Bot removed the ai-review If applied to PR or issue will run AI review workflow label Jul 12, 2026

@github-actions github-actions Bot left a comment

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.

Summary

This PR adds upper version bounds (capped at the next unreleased major version) to seven previously-uncapped server-related runtime dependencies in lib/pyproject.toml: starlette<2, uvicorn<1, httptools<1, anyio<5, python-multipart<1, websockets<17, itsdangerous<3. It also documents the dependency-capping policy in the agent guide files (lib/AGENTS.md, .cursor/rules/python.mdc, .github/instructions/python.instructions.md).

Code Quality

Both reviewers agree the changes are clean and well-structured:

  • The new caps follow the established >=lower,<next_major pattern already used by other capped dependencies (e.g., blinker>=1.5.0,<2, requests>=2.27,<3).
  • Documentation additions are consistent across all three agent guide files.
  • Existing exemptions (packaging>=20, pyarrow>=7.0) already have explanatory comments, aligning with the newly codified policy.

No structural or maintainability issues were identified.

Test Coverage

Both reviewers agree no tests are needed. These are purely dependency metadata changes with no runtime behavior impact. All upper bounds sit above the currently-resolved latest versions, so dependency resolution is unaffected and existing test coverage remains applicable.

Backwards Compatibility

Both reviewers confirm no breaking changes. All upper bounds are above currently-installed versions, meaning existing installations will continue to resolve the same versions. The caps only prevent future major-version upgrades from being automatically pulled in — the intended protective behavior.

Security & Risk

Both reviewers agree there are no security concerns. The dependency caps are a risk-reduction measure that prevents untested major version upgrades of server-critical packages (ASGI framework, HTTP server, WebSocket library, cookie signing) from being automatically installed. No runtime code is touched.

External test recommendation

  • Recommend external_test: No
  • Triggered categories: None
  • Key evidence:
    • lib/pyproject.toml: Dependency version caps only — no changes to routing, auth, WebSocket handling, embedding, assets, CORS, security headers, or any runtime code.
    • lib/AGENTS.md, .cursor/rules/python.mdc, .github/instructions/python.instructions.md: Internal developer documentation/policy text only.
  • Suggested external test focus areas: None for this PR. When these dependencies are later bumped to new majors, validate external deployments for websocket/session continuity, uploads, and embedded/proxied routing behavior.
  • Confidence: High
  • Assumptions/gaps: Assessment assumes no unpublished companion PR modifies runtime server code in tandem.

Accessibility

Not applicable — no frontend or UI changes.

Recommendations

  1. (Optional) Consider adding a lightweight CI check that enforces upper bounds for required runtime dependencies in lib/pyproject.toml (with explicit exemptions) to keep this policy automatically enforced over time. (Raised by gpt-5.3-codex-high)
  2. (Optional) Several optional dependencies (httpx>=0.24.1, matplotlib>=3.0.0, plotly>=4.0.0, etc.) also lack upper bounds. These are outside the scope of this server-focused PR but could be addressed in a follow-up for full policy consistency. (Raised by claude-4.6-opus-high-thinking)

Reviewer Agreement

Both reviewers (claude-4.6-opus-high-thinking and gpt-5.3-codex-high) are in full agreement:

  • Verdict: Both approve unconditionally.
  • Risk assessment: Both rate the PR as low-risk with no blocking issues.
  • External test: Both recommend no external test coverage is needed.
  • No disagreements were identified between the two reviews.

Verdict

APPROVED: Clean, low-risk change that adds protective upper version bounds to server dependencies and documents the capping policy. All caps are above currently-installed versions with no runtime impact. Both reviewers approve unanimously with no blocking issues.


This is a consolidated AI review by claude-4.6-opus-high-thinking, synthesizing reviews from claude-4.6-opus-high-thinking and gpt-5.3-codex-high.

@lukasmasuch

Copy link
Copy Markdown
Collaborator Author

Thanks for the review! Both optional recommendations from the consolidated AI review are intentionally left out of scope to keep this a focused dependency-hygiene chore:

  1. CI enforcement of upper bounds — Worth considering, but adding tooling/CI is a separate concern from this metadata change. Tracking as a possible follow-up rather than expanding this PR.
  2. Capping optional dependencies (httpx, matplotlib, plotly, etc.) — Deliberately scoped to the server-related runtime deps here. Optional/extra deps can be addressed in a follow-up so this PR stays minimal and easy to review.

The newly documented policy in the agent guides captures the intent so future additions get capped by default.

@lukasmasuch lukasmasuch changed the title [chore] Cap server dependency major versions [chore] Cap server dependency major versions and mitigate pyarrow crash Jul 12, 2026
@lukasmasuch lukasmasuch added type:bug Something isn't working as expected impact:users PR changes affect end users labels Jul 12, 2026
@lukasmasuch lukasmasuch changed the title [chore] Cap server dependency major versions and mitigate pyarrow crash [fix] Cap server dependency major versions and mitigate pyarrow crash Jul 12, 2026
@lukasmasuch lukasmasuch added change:bugfix PR contains bug fix implementation and removed impact:internal PR changes only affect internal code change:chore PR contains maintenance or housekeeping change type:bug Something isn't working as expected labels Jul 12, 2026

@github-actions github-actions Bot left a comment

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.

Summary

This PR adds upper version bounds (<NEXT_MAJOR) to seven previously-uncapped server/runtime dependencies in lib/pyproject.toml (starlette, uvicorn, httptools, anyio, python-multipart, websockets, itsdangerous) and pins pyarrow<25.0.0 to avoid a known crash (apache/arrow#50471). It also documents the dependency-capping policy in lib/AGENTS.md and its mirrored agent-instruction files (.cursor/rules/python.mdc, .github/instructions/python.instructions.md).

Reviewer consensus: Both reviewers (claude-4.6-opus-high-thinking, gpt-5.3-codex-high) approved unanimously with no merge-blocking issues identified.

Code Quality

Both reviewers confirmed the changes are clean, focused, and internally consistent:

  • All three documentation files contain identical policy text. (agreed by both)
  • The pyproject.toml comment header already documents the capping convention, and the new AGENTS.md policy aligns with it. (agreed by both)
  • Each dependency cap includes a comment explaining its purpose, and the packaging exemption has the required explanatory comment. (noted by claude-4.6-opus)

No code-structure or maintainability issues were identified.

Test Coverage

No tests are needed. Both reviewers agreed that these are purely dependency metadata and internal documentation changes with no runtime behavior changes. The version caps do not alter any code paths.

Backwards Compatibility

Both reviewers agreed the compatibility risk is low and acceptable:

  • Server dependency caps: All caps are set above the current latest PyPI versions (e.g., starlette 1.3.1 < 2, uvicorn 0.51.0 < 1, websockets 16.1 < 17), so no existing installations will be affected. (agreed by both)
  • pyarrow <25.0.0 cap: Users on pyarrow 25.0.0 will be forced to downgrade, but since that version causes a crash in Streamlit, this is intentional and protective. Environments requiring pyarrow >= 25 alongside Streamlit may need dependency reconciliation. (agreed by both)

Security & Risk

No security concerns. Both reviewers confirmed the changes are protective in nature — adding upper bounds reduces exposure to unreviewed future major dependency releases, and the pyarrow pin avoids a known crash. No auth, websocket, routing, or file-serving code was modified.

External test recommendation

  • Recommend external_test: No (unanimous)
  • Triggered categories: None
  • Evidence:
    • lib/pyproject.toml: Dependency bounds only, no code changes
    • lib/AGENTS.md, .cursor/rules/python.mdc, .github/instructions/python.instructions.md: Documentation-only updates
  • Suggested external_test focus areas: None
  • Confidence: High
  • Assumptions and gaps: None. Changes are purely declarative with no runtime, routing, auth, embedding, or networking impact.

Accessibility

No frontend changes. Not applicable. (unanimous)

Recommendations

No merge-blocking issues. Two optional follow-up suggestions from reviewers:

  1. Track pyarrow cap for update (claude-4.6-opus): The pyarrow<25.0.0 cap is a workaround for a specific crash, not a standard major-version cap. Once the upstream issue is resolved (in a 25.0.x patch or 26.0.0), update the cap to follow the standard <NEXT_MAJOR pattern. The existing comment makes this easy to track.
  2. CI enforcement (gpt-5.3-codex): Consider adding a lightweight CI check in a follow-up PR to flag newly added uncapped required dependencies in lib/pyproject.toml, keeping the capping policy enforceable over time.

Verdict

APPROVED: Both reviewers unanimously approved. The PR is a clean, low-risk dependency hardening change that adds protective upper bounds to server dependencies, blocks a known pyarrow crash, and documents the capping policy consistently across all agent instruction files.


Consolidated AI review by claude-4.6-opus-high-thinking from 2 individual reviews (claude-4.6-opus-high-thinking, gpt-5.3-codex-high). All expected models completed their reviews. Please verify the feedback and use your judgment.

@lukasmasuch

Copy link
Copy Markdown
Collaborator Author

Re-ran the AI review on the full changeset (including the pyarrow<25.0.0 cap) — verdict is APPROVED with no blocking issues.

On the new optional follow-up about tracking the pyarrow cap: agreed. The inline comment already references apache/arrow#50471, so once that's fixed upstream (in a 25.0.x patch or 26.0.0) the cap can be relaxed to the standard <NEXT_MAJOR pattern. Leaving as-is for now since it's protective and low-risk; no code change needed in this PR.

@lukasmasuch lukasmasuch changed the title [fix] Cap server dependency major versions and mitigate pyarrow crash [fix] Cap server dependency major versions Jul 13, 2026
@lukasmasuch
lukasmasuch merged commit 1e461ab into develop Jul 14, 2026
41 checks passed
@lukasmasuch
lukasmasuch deleted the lukasmasuch/pin-server-deps branch July 14, 2026 12:55
@sfc-gh-lwilby-1 sfc-gh-lwilby-1 mentioned this pull request Sep 24, 2026
1 task done
@github-actions github-actions Bot mentioned this pull request Sep 24, 2026
3 of 4 tasks
sfc-gh-lwilby-1 added a commit that referenced this pull request Sep 25, 2026
## Describe your changes

Raises the published `websockets` cap from `<17` to `<18` so Streamlit
can install alongside websockets 17.x.

The `<17` bound was the unused next-major policy cap from #15948, not a
known incompatibility. Websockets 17 dropped Python 3.10, so 3.10
installs stay on 16.1.x (same pattern as pandas 3). The workspace lock
pins 17.x on Python 3.11+ so CI actually exercises the new major.

Python 3.10 + `websockets>=17` remains impossible because 17.x itself
requires Python >= 3.11.

## GitHub Issue Link (if applicable)

- Closes #17097

## Testing Plan

- No new test files: this is a dependency-range change. Existing
Starlette server/websocket, logger, and FIPS smoke tests passed locally
against websockets 17.1 on Python 3.13.
- Min-version CI still installs `websockets==12.0.0`. Python 3.10 CI
stays on 16.1.x; 3.11+ CI uses 17.1.
- Unit Tests (JS and/or Python)
- [x] Python unit tests (existing server/websocket/FIPS suite)

---

**Contribution License Agreement**

By submitting this pull request you agree that all contributions to this
project are made under the Apache 2.0 license.

Made with [Cursor](https://cursor.com)

Co-authored-by: lawilby <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

change:bugfix PR contains bug fix implementation impact:users PR changes affect end users

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants