uv.lock packages from a git source do not work
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Aptitud para principiantes
- 68/100
- Tipo de issue
- Error
- Claridad
- Bastante claro
- Estado de actividad
- Activo
- Stack tecnológico
- python
- Área
- build-system
Línea de trabajo
Comienza con python/private/pypi/parse_requirements.bzl alrededor de las líneas 228-241 y python/private/pypi/pip_archive.bzl alrededor de las líneas 263-269, y luego reproduce el caso de uv.lock usando el ejemplo mínimo enlazado. Compara el manejo de las fuentes Git con el comportamiento de rules_pycross al que se hace referencia; se considera terminado cuando pip.parse ya no trata la URL Git de uv.lock como una URL de descarga literal y el paquete puede descargarse y validarse.
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 that I can tell
Description
pip.parse with uv_lock fails when the lock file contains a package with a git source entry with a rev hash due to the url in the lock file being used as the literal download url.
🔬 Minimal Reproduction
same as https://github.com/bazel-contrib/rules_python/issues/4084
pyproject.toml
...
mypackage = { git = "https://github.com/foo/bar", rev = "6323b05075dcb2347279e966a5a3b15b5ddc1d5b" }
...
uv.lock
...
[[package]]
name = "mypackage"
version = "0.0.1"
source = { git = "https://github.com/foo/bar?rev=6323b05075dcb2347279e966a5a3b15b5ddc1d5b#6323b05075dcb2347279e966a5a3b15b5ddc1d5b" }
dependencies = [
...
]
...
Resulting in https://github.com/foo/bar?rev=6323b05075dcb2347279e966a5a3b15b5ddc1d5b#6323b05075dcb2347279e966a5a3b15b5ddc1d5b being used as the download url in https://github.com/bazel-contrib/rules_python/blob/b1b9bf00f7b9af8ba8a2dab4edef68d5e6e2e536/python/private/pypi/pip_archive.bzl#L263-L269
🔥 Exception or Error
You end up getting wheel validation errors of the form:
INFO: Repo rules_python++pip+py_deps_311__mypackage defined by rule pip_archive in @@rules_python+//python/private/pypi:pip_archive.bzl
ERROR: /Users/steven/Library/Caches/bazel/_bazel_steven/6a872d6d476b57da51fdc42d46ec7cd5/external/rules_python+/python/private/repo_utils.bzl:101:16: An error occurred during the fetch of repository 'rules_python++pip+py_deps_311__mypackage':
Traceback (most recent call last):
File "/Users/steven/Library/Caches/bazel/_bazel_steven/6a872d6d476b57da51fdc42d46ec7cd5/external/rules_python+/python/private/pypi/pip_archive.bzl", line 317, column 36, in _pip_archive_impl
pypi_repo_utils.execute_checked(
File "/Users/steven/Library/Caches/bazel/_bazel_steven/6a872d6d476b57da51fdc42d46ec7cd5/external/rules_python+/python/private/pypi/pypi_repo_utils.bzl", line 140, column 38, in _execute_checked
return repo_utils.execute_checked(
File "/Users/steven/Library/Caches/bazel/_bazel_steven/6a872d6d476b57da51fdc42d46ec7cd5/external/rules_python+/python/private/repo_utils.bzl", line 247, column 29, in _execute_checked
return _execute_internal(fail_on_error = True, *args, **kwargs)
File "/Users/steven/Library/Caches/bazel/_bazel_steven/6a872d6d476b57da51fdc42d46ec7cd5/external/rules_python+/python/private/repo_utils.bzl", line 176, column 27, in _execute_internal
return logger.fail((
File "/Users/steven/Library/Caches/bazel/_bazel_steven/6a872d6d476b57da51fdc42d46ec7cd5/external/rules_python+/python/private/repo_utils.bzl", line 111, column 39, in lambda
fail = lambda message_cb: _log(-1, "FAIL", message_cb, printer or fail),
File "/Users/steven/Library/Caches/bazel/_bazel_steven/6a872d6d476b57da51fdc42d46ec7cd5/external/rules_python+/python/private/repo_utils.bzl", line 101, column 16, in _log
printer("\nrules_python:{} {}:".format(
Error in fail:
rules_python:pip_archive(@@rules_python++pip+py_deps_311__mypackage) FAIL: repo.execute: whl_library.BuildWheelFromSource(rules_python++pip+py_deps_311__mypackage, mypackage==0.0.1): end: failure:
command: /Users/steven/Library/Caches/bazel/_bazel_steven/6a872d6d476b57da51fdc42d46ec7cd5/external/rules_python++python+python_3_11_host/python -B -m python.private.pypi.whl_installer.wheel_installer --requirement mypackage==0.0.1 --isolated --extra_pip_args "{\"arg\":[\"--find-links\",\".\"]}" --pip_data_exclude "{\"arg\":[]}" --environment "{\"arg\":{}}"
return code: 1
🌍 Your Environment
Operating System:
macOS 26
Output of bazel version:
Bazelisk version: 1.29.0
Build label: 9.2.0
Build target: @@//src/main/java/com/google/devtools/build/lib/bazel:BazelServer
Build time: Mon Jul 13 18:19:39 2026 (1783966779)
Build timestamp: 1783966779
Build timestamp as int: 1783966779
Rules_python version:
2.3.2
and with latest main
Anything else relevant?
rules_pycross handles this scenario by cloning the url: https://github.com/jvolkman/rules_pycross/blob/1fb25cf1aa5019416a0ebb86d37ff1627736cf39/pycross/private/git_file.bzl#L3
- Lenguaje dominante
- Starlark
- Estrellas
- 690
- Forks
- 722
- Merge medio
- 1 d 2 h
- PR fusionados (30 d)
- 50
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 78/100
bazel-contrib/rules_python#4164 · 1 comentario ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
bazel-contrib/rules_python#3821 ·
-
Release 2.4.0 Abiertotype: release
Dificultad 4/5 3-5 días Aptitud para principiantes 25/100
bazel-contrib/rules_python#4175 ·
-
Release 2.3.4 Abiertotype: release
Dificultad 2/5 1-3 horas Aptitud para principiantes 35/100
bazel-contrib/rules_python#4173 · 2 comentarios ·
-
Dificultad 3/5 1-2 días Aptitud para principiantes 70/100
bazel-contrib/rules_python#4171 ·
Todos los issues de bazel-contrib/rules_python
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
-
agent-research-recommend agent-review-finding chore
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
jordansmall/spindrift#3717 · 1 comentario ·
-
type/automation type/tech-debt
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100
conda-forge/python-feedstock#934 ·