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

rye list overwrites .venv #940

Closed
bluss opened this issue Mar 24, 2024 · 4 comments · Fixed by #942
Closed

rye list overwrites .venv #940

bluss opened this issue Mar 24, 2024 · 4 comments · Fixed by #942

Comments

@bluss
Copy link
Contributor

bluss commented Mar 24, 2024

Steps to Reproduce

  1. Enter a non-rye managed project that has pyproject.toml and .venv
  2. rye list

(for example with PDM: mkdir project; cd project; pdm init -n; pdm add jinja2; pdm list; rye list; pdm list; )

Expected Result

rye list should error or make a best effort to list the packages in the project.

rye list should not wipe out .venv directories that rye is not managing. rye list should preferably never do any modifications at all, it's a query command.

Actual Result

It overwrites .venv with a fresh venv (created with uv venv), wiping anything that was there before.

Using Python 3.10.12 interpreter at: .venv/bin/python
Creating virtualenv at: .venv
Activate with: source .venv/bin/activate

Version Info

rye 0.31.0
commit: 0.31.0 (72e239b 2024-03-22)
platform: linux (x86_64)
self-python: cpython@3.12.2
symlink support: true
uv enabled: true

Stacktrace

No response

@ischaojie
Copy link
Contributor

It seems that PDM does a good job in this regard. If it is a project created by rye, pdm list will still output the correct content.

@bluss
Copy link
Contributor Author

bluss commented Aug 25, 2024

When I try the pdm command in the report now, it gives something like this error instead of overwrite, from rye list:

error: unable to freeze venv at /home/user/rye-overwrite-test/project/.venv

Caused by:
    Permission denied (os error 13)

but other sequences like rm -r .venv; uv sync; rye list still lead to overwriting the existing .venv.

@bluss
Copy link
Contributor Author

bluss commented Aug 25, 2024

This permission denied error cannot be reproduced, that's bad. Now I'm puzzled!

@bluss
Copy link
Contributor Author

bluss commented Aug 25, 2024

The follow-up is #1352. It's more contrived, but maybe still a bug.

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 a pull request may close this issue.

2 participants