The 'stdlib compileall' function writes stage directory into *.pyc files
Dieses Issue hat noch niemand übernommen.
- Vorherrschende Sprache
- Python
- Sterne
- 77.2k
- Forks
- 36k
- PR-Merge-Kennzahlen
- PR-Kennzahlen ausstehend
Beschreibung
Description
I need to install a python package into a stage directory.
The command I run from the source directory is:
pip install {my-pkg-name} --isolated --root=/tmp/stage/dir --prefix=/usr/local --ignore-installed --no-deps
This command installs the package into the right location, but *.cpython-39.pyc files have full paths to *.py files in the stage directory.
If paths of *.py are needed they should be adjusted so that they should begin with prefix (/usr/local). This is because the source directory will be deleted before the package is run.
Pip uses cpython's stdlib compileall function that inserts stage directory paths.
See the original but report for pip: https://github.com/pypa/pip/issues/11317
pip-22.1.2
Python-3.9
FreeBSD 13.1
How to Reproduce
git clone https://github.com/openqasm/openqasm-pygments.git
cd openqasm-pygments
pip install openqasm-pygments --isolated --root=/tmp/openqasm-pygments --prefix=/usr/local --ignore-installed --no-deps
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
Beginne damit, die pip-Installation mit dem openqasm-pygments-Paket, --root=/tmp/openqasm-pygments und --prefix=/usr/local zu reproduzieren, und untersuche anschließend das Verhalten von Pythons stdlib compileall. Überprüfe, wo die generierten .cpython-39.pyc-Dateien die Quellpfade speichern; als erledigt gilt die Aufgabe, wenn die Pfade des installierten Bytecodes das Staging-Verzeichnis nicht mehr enthalten, sondern stattdessen mit dem Installationspräfix beginnen.
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
- 35/100