--bazel not using relative path in cache files for imports
Dieses Issue hat noch niemand übernommen.
- Vorherrschende Sprache
- Python
- Sterne
- 20.6k
- Forks
- 3.3k
- PR-Merge-Kennzahlen
- PR-Kennzahlen ausstehend
Beschreibung
Bug Report
if i create a python file file_a.py and a file file_b.py and i make file_b import file_a and i the run mypy --bazel file_b.py, then the paths in the meta.json and data.json files are relative in the cache files for file_b but absolute in cache files for file_a. I would expect mypy to use relative paths everywhere in bazel mode.
If I run directly on file_a (mypy --bazel file_a.py) i get relative paths in the cache files for file_a.
To Reproduce
Create file_a.py and file_b.py as described above, run mypy --bazel file_b.py.
Expected Behavior
Relative paths in all produced cache files. Also same hash and interface hash in the cache files for file_a produced by running on file_b that imports file_a, as if I had run directly on file_a.
Actual Behavior
Absolute path on cache files for imports. Also differing hash and interface hash of the cache files, if run on as an import vs. run on directly.
Your Environment
- Mypy version used: 1.8.0 (Same behavior with other versions)
- Mypy command-line flags: --bazel
- Mypy configuration options from
mypy.ini(and other config files): N/A - Python version used: 3.11 (Same behavior with other versions)
Beitragsleitfaden
Erste Schritte
- Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
- Forke das Repository und arbeite in einem Branch.
- Öffne einen Pull Request, der die Issue-Nummer nennt.
Rechercherichtung
Reproduziere das Problem, indem du file_a.py file_b.py importieren lässt und mypy --bazel file_b.py ausführst; vergleiche anschließend die Cache-Dateien meta.json und data.json mit denen, die durch die direkte Ausführung für file_a.py erzeugt werden. Abgeschlossen ist die Aufgabe, wenn die Caches der importierten Dateien relative Pfade verwenden und denselben Hash sowie Interface-Hash wie die Caches der direkten Ausführung haben.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- python
- Bereich
- build-system
- Issue-Typ
- Bug
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Aktivitätsstatus
- Veraltet
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 45/100