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

Check whether pip module exists in shared lib before performing any actions #1111

Merged
merged 7 commits into from
Dec 2, 2023

Conversation

dukecat0
Copy link
Member

@dukecat0 dukecat0 commented Nov 20, 2023

  • I have added an entry to docs/changelog.md

Summary of changes

Check whether pip module exists in shared lib before performing any actions.
Closes #1110

Test plan

Tested by running

nox -s test-3.11

@asyncon
Copy link

asyncon commented Nov 25, 2023

Will this actually solve the issue of post fedora upgrade with a new minor version 3.X of python?

If the file ~/.local/pipx/shared/bin/python3 points to a now updated version of python, it stands to reason that some of ~/.local/pipx/venvs/*/bin/python3 might also do the same. Which would then result in the same outcome of a python version mismatch and not finding the pip module in ~/.local/pipx/shared/lib/python3.X/site-packages because it's in python3.$((X-1)).

An alternate idea is to move the new the new pip module detection logic into the pipx.shared_libs._SharedLibs.is_valid property.

This solution would also work for all other commands as well such as install and upgrade.

Copy link
Contributor

@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.

An alternate idea is to move the new the new pip module detection logic into the pipx.shared_libs._SharedLibs.is_valid property.

This solution would also work for all other commands as well such as install and upgrade.

@dukecat0 dukecat0 changed the title Use venv Python to check pip's availability Check whether pip module exists in shared lib before performing any actions Dec 2, 2023
Copy link
Contributor

@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.

Merge conflicts.

Copy link
Contributor

@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.

Copy link
Contributor

@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.

Ah, new merge conflicts.

@dukecat0
Copy link
Member Author

dukecat0 commented Dec 2, 2023

Fixed

Copy link
Contributor

@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.

@dukecat0 dukecat0 merged commit f130306 into pypa:main Dec 2, 2023
9 checks passed
@dukecat0 dukecat0 deleted the use-correct-py branch December 2, 2023 05:56
@dukecat0 dukecat0 mentioned this pull request Dec 3, 2023
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.

pipx reinstall-all deleted everything
3 participants