Skip to content

Update self-venv on rye update #863

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

Merged
merged 4 commits into from
Mar 10, 2024
Merged

Update self-venv on rye update #863

merged 4 commits into from
Mar 10, 2024

Conversation

mitsuhiko
Copy link
Collaborator

@mitsuhiko mitsuhiko commented Mar 10, 2024

After update this will attempt to run rye init and the python shim in the context of that project. This under all known Rye versions should trigger a python only sync and updating of the internals.

Fixes #859

@mitsuhiko mitsuhiko merged commit 810aa94 into main Mar 10, 2024
@mitsuhiko mitsuhiko deleted the feature/update-self-venv branch March 10, 2024 11:40
@monospacedmagic
Copy link

monospacedmagic commented Mar 10, 2024

Just to clarify, doesn't rye init initialize a prohect at . if used outside of a project? I feel like that would be unintended behavior when using rye update with the intention to update just rye itself and its venv, no? Am I missing something?

@mitsuhiko
Copy link
Collaborator Author

@monospacedmagic it initializes a project in a temporary folder. This is the most portable way even when downgrading to trigger the update of the venv.

Future versions could gain a specific command to update the internal venv but since this should support downgrades too that’s not too helpful today.

@bluss
Copy link
Contributor

bluss commented Mar 10, 2024

One question I have, is it possible that pip-tools is never updated automatically - it looks that way from a few bugs reported here? It should hopefully be removed by uv soon, but still could be good to know for sure.

@mitsuhiko
Copy link
Collaborator Author

Yeah I think this might have regressed. It used to be that pip-tools was wiped together with the self venv on update:

rye/rye/src/bootstrap.rs

Lines 82 to 86 in f5525c9

fs::remove_dir_all(&venv_dir).context("could not remove self-venv for update")?;
if pip_tools_dir.is_dir() {
fs::remove_dir_all(&pip_tools_dir)
.context("could not remove pip-tools for update")?;
}

The current code does not do that:

rye/rye/src/bootstrap.rs

Lines 108 to 109 in 71166f4

fs::remove_dir_all(&venv_dir)
.path_context(&venv_dir, "could not remove self-venv for update")?;

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.

0.28.0 has ruff 0.2.2 when update
3 participants