Skip to content
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

Implement --python auto for environment detection #366

Merged
merged 3 commits into from
May 20, 2024

Conversation

kemzeb
Copy link
Collaborator

@kemzeb kemzeb commented May 15, 2024

Resolves #362.

@kemzeb
Copy link
Collaborator Author

kemzeb commented May 15, 2024

Manually tested using venv, virtualenv, conda, and poetry environments and they appear fine. I also ran virtualenv and conda using PyPy and they also appear fine (not sure if venv can be used with pypy and poetry makes it easy for us by giving us the interpreter directly so I don't believe we have to worry about it).

Making this a draft as I want to test this on a Windows machine.

src/pipdeptree/_detect_env.py Outdated Show resolved Hide resolved
@kemzeb
Copy link
Collaborator Author

kemzeb commented May 16, 2024

Tested these environments in a Windows 10 VM and they all appear to work fine.

The next thing I'm going to do is make auto-detection fail instead of falling back to the interpreter that pipdeptree is being ran with. To me, passing anything to --python suggests that we should run an interpreter other than the one that we are using. This is what users have been doing, and I believe it would be better to just fail telling them that we weren't able to find a virtual environment.

@kemzeb kemzeb marked this pull request as ready for review May 16, 2024 23:28
Copy link
Member

@gaborbernat gaborbernat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kemzeb kemzeb merged commit 0f558b3 into tox-dev:main May 20, 2024
9 checks passed
@kemzeb kemzeb deleted the add-env-auto-detection branch May 20, 2024 22:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Respect the active virtual environment instead of the installed location
2 participants