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

Add interpreter command #1261

Merged
merged 7 commits into from
Feb 26, 2024
Merged

Add interpreter command #1261

merged 7 commits into from
Feb 26, 2024

Conversation

Gitznik
Copy link
Contributor

@Gitznik Gitznik commented Feb 22, 2024

  • I have added a news fragment under changelog.d/ (if the patch affects the end users)

Summary of changes

Add a interpreter command with list and prune subcommand. They can be used to list the installed standalone interpreters and prune unused standalone interpreters.
Resolves #1248

Test plan

Tested by running

pipx install --fetch-missing-python --python 3.7 pycowsay
pipx interpreter list
pipx uninstall pycowsay
pipx interpreter prune

Copy link
Member

@dukecat0 dukecat0 left a comment

Choose a reason for hiding this comment

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

Besides, running pipx interpreter without any arguments will result in an error:

Unknown interpreter command None

src/pipx/commands/interpreter.py Outdated Show resolved Hide resolved
@Gitznik
Copy link
Contributor Author

Gitznik commented Feb 25, 2024

Besides, running pipx interpreter without any arguments will result in an error:

Unknown interpreter command None

I've now adapted the logic from running pipx without a subcommand. Unfortunately that means passing around the subparser, to be able to call print_help on it. There is no public API to retrieve the subparsers from the main parser unfortunately.

@Gitznik Gitznik enabled auto-merge (squash) February 26, 2024 07:03
@Gitznik Gitznik merged commit 6eb7773 into pypa:main Feb 26, 2024
12 checks passed
@chrysle
Copy link
Contributor

chrysle commented Feb 26, 2024

Thank you for this, good work! Sorry for the lack of review here.

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.

Command for cleanup of installed standalone python versions
3 participants