I have a Python package with a script with the shebang #!/usr/bin/env python
. After I build a wheel of this package, I inspect the script inside the .whl and the new shebang is #!/path/to/some/virtualenv/bin/python
. It's the path to a virtualenv which is not even the one active when I build the wheel.
> which python
#!/path/to/active/virtualenv/bin/python
> which wheel
#!/path/to/active/virtualenv/bin/wheel
This breaks distribution of my package. How can I fix this?
Split process into 2 phases:
build
command createsbuild/
subdirectory; when abdist_*
command (bdist_egg
orbdist_wheel
) detects the existence of the subdirectory it doesn't runbuild
command but uses whateverbuild
put inbuild/
.I use the approach in all my release scripts. Two examples: Cheetah, SQLObject.