unable to override https://pypi.org/simple starting in rules_python 2.0.0
Maintainer antworten meist innerhalb von 1 Tag
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Anfängerfreundlichkeit
- 52/100
- Issue-Typ
- Bug
- Klarheit
- Größtenteils klar
- Aktivitätsstatus
- Aktiv
- Tech-Stack
- python
- Bereich
- build-system
Rechercherichtung
Beginne mit python/extensions:pip.bzl und den Einstiegspunkten pip.default.index_url und pip.parse und reproduziere dann den Fehler mit bazel clean --expunge gefolgt von bazel mod graph. Vergleiche rules_python 1.9.1 mit 2.3.2 und konzentriere dich dabei auf envsubst und die konfigurierte URL https://pypi.org/simple. Erledigt ist die Aufgabe, wenn der konfigurierte Index PyPI überschreibt oder die veralteten Parameter eine eindeutige Diagnose erzeugen.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
🐞 bug report
Affected Rule
The issue is caused by the rule:pip.parse.experimental_index_url
pip.parse.experimental_extra_index_urls
pip.default.index_url
Is this a regression?
Yes, the previous version in which this bug was not present was: 1.9.1Description
In rules_python 1.9.1 and earlier, I was able to override the use of https://pypi.org/simple as follows:
pip.parse(
envsubst = ["EXAMPLE_PIP_INDEX_URL"],
experimental_extra_index_urls = [
"${EXAMPLE_PIP_INDEX_URL}",
],
experimental_index_url = "${EXAMPLE_PIP_INDEX_URL}",
...
)
where EXAMPLE_PIP_INDEX_URL is an environment variable that we set to our local pypi index.
We also have a --downloader_config set up which blocks access to pypi.org.
Starting with rules_python 2.0.0 and continuing through 2.3.2, the experimental_extra_index_urls and experimental_index_url parameters silently no longer work, and do not generate any diagnostic to say what the new mechanism is.
Per the documentation at https://rules-python.readthedocs.io/en/2.3.2/api/rules_python/python/extensions/pip.html#pip.default.index_url I would expect the following to work starting with rules_python 2.0.0:
pip.default(
index_url = "${EXAMPLE_PIP_INDEX_URL}",
)
pip.parse(
envsubst = ["EXAMPLE_PIP_INDEX_URL"],
...
)
However, it appears that index_url is not used at all, or at least does not override all uses of https://pypi.org/simple. The docs state that
This value is going to be subject to envsubst substitutions if necessary
I do need it to be subject to envsubst substitutions. It would be clearer if the docs said
This value is subject to envsubst substitutions
🔬 Minimal Reproduction
I can provide a small reproduction if necessary, but the user would need to supply some alternative to pypi.org to configure it with.
🔥 Exception or Error
When I run bazel clean --expunge; bazel mod graph in a repo configured as I described above, I get a diagnostic like
Error in wait: java.io.IOException: Configured URL rewriter blocked all URLs: [https://pypi.org/simple/]
ERROR: error evaluating module extension @@rules_python+//python/extensions:pip.bzl%pip
ERROR: Results may be incomplete as 1 extension failed.
starting with rules_python 2.0.0 due to pypi.org/simple not being overridden any more, either by the old mechanism with experimental_index_url and experimental_extra_index_urls, or by the new mechanism with index_url.
🌍 Your Environment
Operating System:
Ubuntu 24.04
Output of bazel version:
$ bazelisk version
Bazelisk version: v1.19.0
Build label: 9.2.0
Build target: @@//src/main/java/com/google/devtools/build/lib/bazel:BazelServer
Build time: Mon Jul 13 18:15:04 2026 (1783966504)
Build timestamp: 1783966504
Build timestamp as int: 1783966504
Rules_python version:
2.3.2
Anything else relevant?
I'd be happy to attempt a fix, given some guidance as to what needed to be done where.
I'm also happy to test prospective fixes if my particular computing environment can be of some help.
It would be nice if experimental_extra_index_urls and experimental_index_url continued to work. But if they are not going to work, their use should at a minimum trigger some sort of clear diagnostic about what to use instead.
Posted on the bazel slack at https://bazelbuild.slack.com/archives/CA306CEV6/p1787963436682509
- Vorherrschende Sprache
- Starlark
- Sterne
- 687
- Forks
- 726
- Ø Merge
- 1 T. 3 Std.
- Gemergte PRs (30 T.)
- 83
Entwicklungsumgebung
- Kein Dockerfile und keine Docker-Compose-Datei
- Hat eine Pull-Request-Vorlage
- Beitragsleitfaden lesen
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus bazel-contrib/rules_python
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 68/100
bazel-contrib/rules_python#4251 · 1 Reaktion ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
bazel-contrib/rules_python#4164 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag
-
go:embed stdlib_list.txt file in gazelle/python/std_modules.go is missingEvtl. vergeben @udaya2899 hat das vor 20 Tagen übernommen. Offen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
bazel-contrib/rules_python#3821 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 38/100
bazel-contrib/rules_python#4278 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 3/5 1-2 Tage Anfängerfreundlichkeit 45/100
bazel-contrib/rules_python#4269 ·
Maintainer antworten meist innerhalb von 1 Tag
Alle Issues in bazel-contrib/rules_python
Ähnliche Issues
-
maintenance
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 75/100
alphagov/accessible-autocomplete#826 ·
Maintainer antworten meist innerhalb von 4 Tagen
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 77/100
olahol/react-tagsinput#229 ·
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 86/100
google-ai-edge/litert-torch#1346 ·
Maintainer antworten meist innerhalb von 1 Tag
-
status:waiting-for-triage type:bug
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 84/100
microsoftgraph/msgraph-sdk-dotnet#3194 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 75/100
Maintainer antworten meist innerhalb von 1 Tag