Hello,
these two command are typically used to build and install python package from sources:
1. python3 setup.py build --executable="/usr/bin/binary"
2. python3 setup.py install -O1 --skip-build
Let's assume there is
a setup.py script of package foo, containing
a script foo.
The --executable
option of the
build command
(1) should set the
shebang of the
script foo to #!/usr/bin/binary.
Problem is that this option doesn't work for scripts listed in setup.py as entry_points, which is
the
most common way of handling scripts these days.
The idea of
the original design was probably to pass
the value of --executable to
the build_scripts
command and set shebang there, however,
this command is not executed if package contains
only entry_points.
The scripts listed as entry_points are processed during execution of
the install command (2)
(in the easy_install
command, specifically), which is completely isolated from
the build
command (1)
and doesn't have access to the
value specified in the
--executable option.
The only reasonable solution that came to my mind
was to add
the --executable option
to the install command as well, pass it to
the easy_install command and make
the ScriptWriter
class use this value.
I prepared the patch that fixes this issue in setuptools [1]. To make it work, a small patch [2]
will have to be applied to distutils as well.
Would
this or something similar
be acceptable as
a PR
in setuptools if the second patch gets merged into distutils?
Michal Cyprian