`pip.parse` drops extras declared on the wheel's dependency (`package[extra]`)
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 72/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- python
- Lĩnh vực
- build-system
Hướng nghiên cứu
Start in python/private/pypi/pep508_deps.bzl, then read pep508_requirement.bzl to trace how extras are parsed and resolved for transitive requirements. Reproduce with fastmcp==4.0.5 using the documented uv and Bazel commands. Done means the fastmcp_slim target preserves the client and server extras and its gated dependencies are available in the resulting importable environment.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
🐞 bug report
Affected Rule
pip.parse
Is this a regression?
Not really, it's caused by upgrading fastmcp from v3 to v4
Description
fastmcp==4.0.5 declares fastmcp-slim[client,server]==4.0.5 unconditionally
in its Requires-Dist, and fastmcp-slim gates its client and server
dependencies (httpx2, authlib, mcp, starlette, and others) behind those
extras. When fastmcp is pulled in through pip.parse, rules_python does not
enable the client and server extras on the fastmcp_slim target, so those
gated dependencies are never wired into the dependency graph. Depending on
@pypi//fastmcp therefore produces a different importable environment than
pip install fastmcp: import fastmcp.client fails at runtime with
ModuleNotFoundError: No module named 'httpx2', even though httpx2 and the
other extra dependencies are pinned in the lock and exist as @pypi//… targets.
The cause is in python/private/pypi/pep508_deps.bzl. The
fastmcp-slim[client,server] edge is parsed into a requirement with
.name == "fastmcp-slim" and .extras == ["client", "server"]
(pep508_requirement.bzl), but _resolve_extras() only consults req.extras
for self-edges (if req.name != self_name: continue), and the dependency label
is built from req.name alone, so the [client,server] qualifier is discarded.
Whether a package's extra == '...' dependencies are wired is then decided
solely by the extras passed to that package's own whl_library, which is
populated from how the package appears as a requirement line in the lock.
fastmcp-slim appears only as a plain transitive pin with no extras, so its
whl_library receives extras = [] and the client and server dependencies are
dropped.
🔬 Minimal Reproduction
uv add fastmcp==4.0.5
uv export --format requirements.txt > ./requirements.txt
bazel build //...
🔥 Exception or Error
ImportError: FastMCP client support is not installed. Install `fastmcp` or `fastmcp-slim[client]`.
🌍 Your Environment
Operating System:
ubuntu 24.04
Output of bazel version:
Build label: 8.6.0
Build target: @@//src/main/java/com/google/devtools/build/lib/bazel:BazelServer
Build time: Thu Feb 26 19:55:20 2026 (1772135720)
Build timestamp: 1772135720
Build timestamp as int: 1772135720
Rules_python version:
1.9.2
Anything else relevant?
- Ngôn ngữ chính
- Starlark
- Star
- 690
- Fork
- 722
- Merge trung bình
- 1 ngày 55 phút
- Pull request đã merge (30 ngày)
- 38
Hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của bazel-contrib/rules_python
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
bazel-contrib/rules_python#4179 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
bazel-contrib/rules_python#4164 · 1 bình luận ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
bazel-contrib/rules_python#3821 ·
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 45/100
bazel-contrib/rules_python#4181 ·
-
Release 2.4.0 Đang mởtype: release
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 25/100
bazel-contrib/rules_python#4175 · 3 bình luận ·
Tất cả issue của bazel-contrib/rules_python
Issue tương tự
-
nix: vendorHash is outdated Đang mở
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 90/100
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
typelevel/sbt-typelevel#929 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
openSUSE/python-rpm-macros#219 ·
-
HMR stops working Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 90/100
Qiskit/mcp-servers#221 ·