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

Allow creating a virtual environment in a folder with existing files #2529

Closed
gaborbernat opened this issue Mar 18, 2024 · 2 comments · Fixed by #2548
Closed

Allow creating a virtual environment in a folder with existing files #2529

gaborbernat opened this issue Mar 18, 2024 · 2 comments · Fixed by #2548
Assignees
Labels
enhancement New feature or improvement to existing functionality

Comments

@gaborbernat
Copy link
Contributor

gaborbernat commented Mar 18, 2024

❯ lsd --tree .venv/
 .venv
└──  magic.txt
~/git/github/tox-uv on  main [!?⇕]
❯ uv venv
Using Python 3.12.1 interpreter at: /Users/bgabor8/.pyenv/versions/3.12.1/bin/python3
Creating virtualenv at: .venv
uv::venv::creation

  × Failed to create virtualenv
  ╰─▶ The directory `.venv` exists, but it's not a virtualenv

tox likes to put a few other files (tmp folder, .tox-info.json, etc) in this folder that breaks uv venv....

Is fine if is hidden behind a --allow-extra-content flag.

@zanieb
Copy link
Member

zanieb commented Mar 18, 2024

I wonder if this should just be gated by a simple --force flag.

@zanieb zanieb added the enhancement New feature or improvement to existing functionality label Mar 18, 2024
@gaborbernat
Copy link
Contributor Author

Works for me 😀

@charliermarsh charliermarsh self-assigned this Mar 19, 2024
charliermarsh added a commit that referenced this issue May 1, 2024
## Summary

Closes #2529.

## Test Plan

- `mkdir .venv`
- `touch .venv/foo`
- `cargo run venv` (ensure failure)
- `cargo run venv --force` (ensure success)
- `cargo run venv --force` (ensure success again)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or improvement to existing functionality
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants