You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
python -m installer supports several options for controlling the paths in the output when they don't match the Python system that is running:
--destdir puts everything relative to a system root
--prefix overrides sys.prefix for the installation prefix within that system root where files are installed
But there appears to be no way to control the path that is stored in #! lines of entry points that installer creates. In contrast, for example, historically with setuptools, python setup.py install would respect [build] executable = '/path/to/python' in setup.cfg; this functionality doesn't appear to be available through installer. It would be nice if python -m installer additionally supported:
--executable overrides sys.executable for the Python executable path within that system root used in #! lines generated for entry points
This is important for cross-compilation into a fixed file system layout in the destdir that is independent of where Python happened to be installed on a development machine. For example, if I set up a virtualenv in /home/riastradh/venv for a cross-compilation toolchain, sys.executable will be /home/riastradh/venv/bin/python, but the scripts installed in the destdir need to start with #!/opt/pkg/bin/python -- just like files installed in the destdir need to go under /opt/pkg/lib/python3.12/site-packages according to --prefix, rather than under /home/riastradh/venv/lib/python3.12/site-packages according to sys.prefix.
The text was updated successfully, but these errors were encountered:
riastradh
pushed a commit
to riastradh/pypa-installer
that referenced
this issue
Jan 15, 2025
python -m installer
supports several options for controlling the paths in the output when they don't match the Python system that is running:--destdir
puts everything relative to a system root--prefix
overridessys.prefix
for the installation prefix within that system root where files are installedBut there appears to be no way to control the path that is stored in
#!
lines of entry points thatinstaller
creates. In contrast, for example, historically with setuptools,python setup.py install
would respect[build] executable = '/path/to/python'
in setup.cfg; this functionality doesn't appear to be available through installer. It would be nice ifpython -m installer
additionally supported:--executable
overridessys.executable
for the Python executable path within that system root used in#!
lines generated for entry pointsThis is important for cross-compilation into a fixed file system layout in the destdir that is independent of where Python happened to be installed on a development machine. For example, if I set up a virtualenv in /home/riastradh/venv for a cross-compilation toolchain,
sys.executable
will be /home/riastradh/venv/bin/python, but the scripts installed in the destdir need to start with#!/opt/pkg/bin/python
-- just like files installed in the destdir need to go under /opt/pkg/lib/python3.12/site-packages according to--prefix
, rather than under /home/riastradh/venv/lib/python3.12/site-packages according tosys.prefix
.The text was updated successfully, but these errors were encountered: