Closed jkugler closed 1 year ago
I made sure both virtualenv
and virtualenv-tools
where installed by python3.11, and re-ran but then got this:
Error in ./lib/python3.11/site-packages/prometheus_client/openmetrics/__pycache__/parser.cpython-310.pyc {:level=>:info}
Traceback (most recent call last): {:level=>:info}
File "/home/jkugler/.local/bin/virtualenv-tools", line 8, in <module> {:level=>:info}
sys.exit(main()) {:level=>:info}
^^^^^^ {:level=>:info}
File "/home/jkugler/.local/lib/python3.11/site-packages/virtualenv_tools.py", line 357, in main {:level=>:info}
update_paths(venv, update_path) {:level=>:info}
File "/home/jkugler/.local/lib/python3.11/site-packages/virtualenv_tools.py", line 230, in update_paths {:level=>:info}
update_pycs(lib_dir, new_path) {:level=>:info}
File "/home/jkugler/.local/lib/python3.11/site-packages/virtualenv_tools.py", line 180, in update_pycs {:level=>:info}
update_pyc(filename, local_path) {:level=>:info}
File "/home/jkugler/.local/lib/python3.11/site-packages/virtualenv_tools.py", line 122, in update_pyc {:level=>:info}
code = marshal.load(f) {:level=>:info}
^^^^^^^^^^^^^^^ {:level=>:info}
ValueError: bad marshal data (unknown type code) {:level=>:info}
Process failed: virtualenv-tools failed (exit code 1). Full command was:["virtualenv-tools", "--update-path", "/path/to/my.whl"] {:level=>:error}
Something in the chain is still invoking python 3.10...and I'm not sure what. I believe the $PYTHON_BINARY -m
suggestion would help with this.
OK...while the above suggestions would be spiffy (as would the ability to specify the Python version of the virtualenv to create), it appears something is pulling in 3.10 pyc files even though I'm running in a 3.11 virtualenv. I was able to replicate this with a bare pip3 install
in a virtualenv. I'll close this for now. Might open a new issue about adding some options to the virutalenv module. :)
I'm working on getting a virtualenv package built.
Virtualenv-tools ran, but failed with:
Looking through the verbose output, it can be seen that it used Python 3.11 to invoke the
virtualenv
command because$(which virtualenv)
is:However,
$(which virtualenv-tools)
is:I am guessing FPM shells out to those command, hence the issue. A few suggestions for improvements/fixes.
--virtualenv-python-binary
option so the binary to be used for the virtualenv operation can be specified.virtualenv
but$PYTHON_BINARY -m venv /path/to/venv
$PYTHON_BINARY -m virtualenv-tools [options go here]
That would accomplish (at least) two things.
$PYTHON_BINARY
's lib pathpyc
by the desired $PYTHON_BINARY, etc.