Open magnusviri opened 9 months ago
It looks like "+brewing" is in all of the venv/bin files.
hm. python-venv.py might need an update (or a deprecation).
if you compare the stub python-venv.py writes with the one made by python-venv-stubber.sh, you can see it introduces a hard-dependency on the build-time $VIRTUAL_ENV
.
Perhaps even better, you might want to switch to the newer bkpyvenv
command. It works like this:
- bkpyvenv stage {{prefix}} {{version}}
- # do any install steps, pip install, poetry install, etc
- bkpyvenv seal {{prefix}} name_of_binary
it's more flexible, and allows for finer-grained control of the python interior install processes.
edited to add:
in particular, complex problems can be more easily solved, such as in OCRmyPDF
:
- bkpyvenv stage {{prefix}} {{version}}
- ${{prefix}}/venv/bin/pip install .
# pikepdf libs are compiled for MACOSX_DEPLOYMENT_TARGET=12.0
- run: '{{prefix}}/venv/bin/pip install --no-cache-dir --force-reinstall --no-binary :all: pikepdf'
if: darwin
- bkpyvenv seal {{prefix}} ocrmypdf
Yeah that script needs an update, though probs just use the new two part system since it made the reason you created the .py
version obsolete since you can control the pip instantiation now.
When building (
bk build ...
) a python project using python-venv.py, I see this output in the terminal.The activate file (/opt/pkgx/github.com/univ-of-utah-marriott-library-apple/jctl/v1.1.21+brewing/venv/bin/activate) points to the path
/opt/pkgx/github.com/univ-of-utah-marriott-library-apple/jctl/v1.1.21+brewing/venv/
But the file system path is
/opt/pkgx/github.com/univ-of-utah-marriott-library-apple/jctl/v1.1.21/venv/ (without the "+brewing").
Thus the venv never activates.