Description
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: pypa/pip#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

