`pip.parse` drops extras declared on the wheel's dependency (`package[extra]`)
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Aptitud para principiantes
- 72/100
- Tipo de issue
- Error
- Claridad
- Bien especificado
- Estado de actividad
- Activo
- Stack tecnológico
- python
- Área
- build-system
Línea de trabajo
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.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
🐞 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?
- Lenguaje dominante
- Starlark
- Estrellas
- 688
- Forks
- 723
- Merge medio
- 1 d 20 h
- PR fusionados (30 d)
- 45
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de bazel-contrib/rules_python
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100
bazel-contrib/rules_python#4201 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
bazel-contrib/rules_python#4164 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
go:embed stdlib_list.txt file in gazelle/python/std_modules.go is missingPosiblemente ocupada @udaya2899 la tomó hace 6 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
bazel-contrib/rules_python#3821 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 5/5 Más de una semana Aptitud para principiantes 28/100
bazel-contrib/rules_python#4218 · 2 comentarios ·
Los mantenedores suelen responder en 1 día
-
type: toolchain
Dificultad 4/5 3-5 días Aptitud para principiantes 35/100
bazel-contrib/rules_python#4216 · 5 comentarios · 1 reacción ·
Los mantenedores suelen responder en 1 día
Todos los issues de bazel-contrib/rules_python
Issues similares
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 80/100
Devolutions/picky-rs#546 · 1 comentario ·
Los mantenedores suelen responder en 3 días
-
Add ability to augment cross environment PATH configurationsPosiblemente ocupada @bunny953 la tomó hoy. Abiertoenhancement
Dificultad 2/5 1-3 horas Aptitud para principiantes 66/100
beeware/xbuild#101 · 2 comentarios ·
Los mantenedores suelen responder en 1 día
-
Needs: Triage :mag:
Dificultad 2/5 1-3 horas Aptitud para principiantes 79/100
Los mantenedores suelen responder en 1 día
-
sync-en
Dificultad 1/5 Menos de una hora Aptitud para principiantes 88/100
Los mantenedores suelen responder en 3 días
-
area:ci bug triage:confirmed
Dificultad 2/5 1-3 horas Aptitud para principiantes 84/100
Cotal-AI/Cotal#2872 · 2 comentarios ·
Los mantenedores suelen responder en 1 día