You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We ran into a weird issue at work today when we tried upgrading from Python 3.11 to Python 3.12. When we run virtualenv-tools --update-path, we get an error:
(venv) 😿 cristina ./venv/bin/virtualenv-tools --update-path /newpath/venv venv/
Traceback (most recent call last):
File "/Users/local_nigel/cristina/./venv/bin/virtualenv-tools", line 8, in <module>
sys.exit(main())
^^^^^^
File "/Users/local_nigel/cristina/venv/lib/python3.12/site-packages/virtualenv_tools.py", line 351, in main
venv = _get_original_state(path=args.path)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/local_nigel/cristina/venv/lib/python3.12/site-packages/virtualenv_tools.py", line 317, in _get_original_state
orig_path=get_orig_path(path),
^^^^^^^^^^^^^^^^^^^
File "/Users/local_nigel/cristina/venv/lib/python3.12/site-packages/virtualenv_tools.py", line 263, in get_orig_path
raise AssertionError(
AssertionError: Could not find VIRTUAL_ENV= in activation script: venv/bin/activate
I did some investigation. The activate script installed by venv on 3.12 looks like this:
# on Windows, a path can contain colons and backslashes and has to be converted:if [ "${OSTYPE:-}"="cygwin" ] || [ "${OSTYPE:-}"="msys" ] ;then# transform D:\path\to\venv to /d/path/to/venv on MSYS# and to /cygdrive/d/path/to/venv on Cygwinexport VIRTUAL_ENV=$(cygpath "/Users/local_nigel/cristina/venv")else# use the path as-isexport VIRTUAL_ENV="/Users/local_nigel/cristina/venv"fi
When I set up a virtual environment using virtualenv, it looks like this:
We're using venv to generate our virtual environments because it's part of the standard library. I can update our build scripts to use virtualenv, but it'd be really nice if this tool worked with activate as generated by venv. 😁
Cheers!
The text was updated successfully, but these errors were encountered:
Hello!
We ran into a weird issue at work today when we tried upgrading from Python 3.11 to Python 3.12. When we run
virtualenv-tools --update-path
, we get an error:I did some investigation. The activate script installed by venv on 3.12 looks like this:
When I set up a virtual environment using virtualenv, it looks like this:
We're using venv to generate our virtual environments because it's part of the standard library. I can update our build scripts to use virtualenv, but it'd be really nice if this tool worked with
activate
as generated by venv. 😁Cheers!
The text was updated successfully, but these errors were encountered: