Starting from version 2.0.0 is no longer allowed to have a package called lib in the root
Maintainer antworten meist innerhalb von 1 Tag
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 3/5
- Geschätzter Aufwand
- 1-2 Tage
- Anfängerfreundlichkeit
- 55/100
- Issue-Typ
- Bug
- Klarheit
- Größtenteils klar
- Aktivitätsstatus
- Ruhig
- Tech-Stack
- python
- Bereich
- build-system
Rechercherichtung
Beginne mit der verknüpften minimalen Reproduktion, insbesondere mit bin.py und lib.py, unter Verwendung von rules_python 2.0.0 oder 2.0.1 und dem gemeldeten Windows-Bazel-Setup. Verfolge, wie py_binary und py_library den Runfiles-Importpfad erstellen, füge anschließend einen Regressionstest hinzu, der einen Import des Root-lib.py abdeckt, und bestätige, dass das Beispiel lib nicht mehr zum Paket der generierten Umgebung auflöst.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
🐞 bug report
Affected Rule
py_binary + py_library
Is this a regression?
Yes, it started with 2.0.0, before that the problem was not there
Description
It is no longer possible to have a lib.py in the root and import it.
It seems that this colides now with some lib that is in the path. This was before not the case.
Considering that lib is not a Python library, I would not have expected having any colision.
🔬 Minimal Reproduction
You can grab this example and upgrade to rules_python 2.0.0
https://github.com/limdor/bazel-examples/tree/v1.8.0/python
🔥 Exception or Error
Traceback (most recent call last):
File "c:\b\t45fapsg\execroot\_main\bazel-out\x64_windows-fastbuild-st-591ff087943d\bin\bin.exe.runfiles\_main\_bin_stage2_bootstrap.py", line 541, in <module>
main()
File "c:\b\t45fapsg\execroot\_main\bazel-out\x64_windows-fastbuild-st-591ff087943d\bin\bin.exe.runfiles\_main\_bin_stage2_bootstrap.py", line 535, in main
_run_py_path(main_filename, args=sys.argv[1:])
File "c:\b\t45fapsg\execroot\_main\bazel-out\x64_windows-fastbuild-st-591ff087943d\bin\bin.exe.runfiles\_main\_bin_stage2_bootstrap.py", line 323, in _run_py_path
runpy.run_path(main_filename, run_name="__main__")
File "<frozen runpy>", line 291, in run_path
File "<frozen runpy>", line 98, in _run_module_code
File "<frozen runpy>", line 88, in _run_code
File "c:\b\t45fapsg\execroot\_main\bazel-out\x64_windows-fastbuild-st-591ff087943d\bin\bin.exe.runfiles\_main\bin.py", line 1, in <module>
from lib import sum
ImportError: cannot import name 'sum' from 'lib' (C:\temp\bazel._bin.venv.l8l95vit\lib\__init__.py)
bazel run failed with exit code 1
🌍 Your Environment
Operating System:
Windows
Output of bazel version:
8.7.0
Rules_python version:
2.0.0 as well as 2.0.1
Anything else relevant?
That is not a big issue for me, I workaround the problem my renaming lib.py to my_lib.py. However the bigger question would be what are the names that can have problems and the ones that not? I could have imagine names from the Python standard library to have problems with it but afaik lib is not one of them.
- Vorherrschende Sprache
- Starlark
- Sterne
- 687
- Forks
- 726
- Ø Merge
- 1 T. 6 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 17 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 3/5 1-2 Tage Anfängerfreundlichkeit 45/100
bazel-contrib/rules_python#4269 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 5/5 Über eine Woche Anfängerfreundlichkeit 20/100
bazel-contrib/rules_python#4250 ·
Maintainer antworten meist innerhalb von 1 Tag
Alle Issues in bazel-contrib/rules_python
Ähnliche Issues
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 73/100
anomalyco/opencode#56380 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 90/100
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 92/100
open-telemetry/opentelemetry-go-compile-instrumentation#1507 ·
Maintainer antworten meist innerhalb von 3 Tagen
-
build: Update rust versionEvtl. vergeben Ein verknüpfter Pull Request ist offen oder bereits gemergt. Offendependencies
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 67/100
ibm-granite-community/granite-cli#229 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 77/100
Maintainer antworten meist innerhalb von 2 Tagen