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

(python plugin): fixes #1134 #1135

Merged
merged 4 commits into from
Dec 11, 2023
Merged

(python plugin): fixes #1134 #1135

merged 4 commits into from
Dec 11, 2023

Conversation

gasuketsu
Copy link
Contributor

Fixes #1134 .

According to my quick dig into python core plugin impl, python_path() that is used in PythonPlugin::install_default_package() and PythonPlugin::get_virtualenv() may point outdated python path when upgrading python@latest.
With this fix python_path() returns path based on ToolVersion::install_path() to avoid pointing outdated path during upgrade.

@jdx
Copy link
Owner

jdx commented Dec 11, 2023

this won't work since it would just break the reason for adding this: #877

I think we can probably get by with using the short bin path for package installations and long form with virtualenv setup, however I'm not entirely sure if that will be enough.

@gasuketsu
Copy link
Contributor Author

this won't work since it would just break the reason for adding this: #877

I think we can probably get by with using the short bin path for package installations and long form with virtualenv setup, however I'm not entirely sure if that will be enough.

Thanks for the feedback.
#1134 can be reproduced with virtualenv config like #877.
python in venv is always symlink points to specific version x.y.z (not x.y) and default packages are installed to ~/.local/share/rtx/installs/python/<version>/ even if we have virtualenv config.
So I think that both #877 and #1134 can be solved by keepin python_path() as is and using tv.install_path().join("bin/python") for installing default package.

I will prepare the change.

@jdx jdx enabled auto-merge (squash) December 11, 2023 23:10
@jdx jdx merged commit 1f0ea9d into jdx:main Dec 11, 2023
6 checks passed
@gasuketsu gasuketsu deleted the fix/1134 branch December 11, 2023 23:20
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.

packages described in .python-default-packages are not found after upgrading python@latest
2 participants