This PR introduces multiple fixups for the broken installer.
Binaries path
The bin path for virtual env is now ../env/local/bin
.
Here is one line in virtualenv tests that confirm this change:
/tests/unit/discovery/py_info/test_py_info.py#L331
Robustify virtualenv installer
The recommended zipapp way to install the latest virtualenv is given here.
__version__
injection
Fix Using exec
to import the version is anti-pattern, unpythonic, and fragile. What's more, it does not work, because the Python interpreter is looking in the CWD for the bashhub/version.py
whereas it actually needs to look in the script location. The script location is found using the ugly method below:
import os
import sys
exec (open(os.path.join(os.path.dirname(sys.argv[0]),'./bashhub/version.py')).read())