-
Notifications
You must be signed in to change notification settings - Fork 422
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Virtual Environment location is invalid when passing an absolute path #1354
Comments
I think we should extend the check I already installed in |
It seems that the args in [1] Line 443 in 4402362
|
Ah, I wasn't aware of that. Yes, sounds good. |
Describe the bug
When passing an absolute path as
package
argument,VenvContainer.get_venv_dir()
returns the absolute path directly and brings bunch of abnormal behaviors. Esepcially when the path is normalized which gets identical result afterpackaging.util.canonicalize_name()
,reinstall
anduninstall
will remove the absolute path unexpectedly (as reported in #1324).pipx >(run_pipx_command:197): Virtual Environment location is /tmp/empty-project
pipx uninstall
andpipx reinstall
will remove the directory/tmp/empty-project
How to reproduce
The behavior can also be reproduced on Windows
Expected behavior
We should not use the invalid virtual environment in logs and the following steps.
Proposed Solution
Though #1324 is fixed by #1329, it does not seem to cover all the cases. There are two options I can think of:
package
need to be an absolute path, so we can just raise aPipxError
if thepackage
is an absolute path.paths.ctx.venvs
insideVenvContainer.get_venv_dir()
.Let me know if you have any comments or preference.
The text was updated successfully, but these errors were encountered: