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

move venv to specific directory #6746

Closed
emcek opened this issue Aug 28, 2024 · 1 comment
Closed

move venv to specific directory #6746

emcek opened this issue Aug 28, 2024 · 1 comment
Labels
duplicate This issue or pull request already exists

Comments

@emcek
Copy link

emcek commented Aug 28, 2024

I try find out in documentation is there any way to tell uv where is my venv located. (not using default .venv) I like keep all my venvs in parent directory of my projects.

So:

PS C:\Users\mplichta\Projects> mkdir new
PS C:\Users\mplichta\Projects> cd .\new\
PS C:\Users\mplichta\Projects\new> uv venv ..\venvs\new
Using Python 3.12.4 interpreter at: C:\Users\mplichta\.pyenv\pyenv-win\versions\3.12.4\python.exe
Creating virtualenv at: ..\venvs\new
PS C:\Users\mplichta\Projects\new> type .\pyproject.toml
[build-system]
requires = ['setuptools']
build-backend = 'setuptools.build_meta'

[project]
name = 'new'
license = {text = 'MIT License'}
requires-python = '>=3.9'
dynamic = ['version']
dependencies = [
    'pydantic==2.8.2',
]
Activate with: C:\Users\mplichta\Projects\venvs\new\Scripts\activate
PS C:\Users\mplichta\Projects\new> C:\Users\mplichta\Projects\venvs\new\Scripts\activate.ps1
(new) PS C:\Users\mplichta\Projects\new> uv sync
Using Python 3.12.4 interpreter at: C:\Users\mplichta\.pyenv\pyenv-win\versions\3.12.4\python.exe
Creating virtualenv at: .venv
Resolved 5 packages in 2.32s
   Built new @ file:///C:/Users/mplichta/Projects/new
Prepared 5 packages in 1.76s
Installed 5 packages in 24ms
 + annotated-types==0.7.0
 + new==0.0.0 (from file:///C:/Users/mplichta/Projects/new)
 + pydantic==2.8.2
 + pydantic-core==2.20.1
 + typing-extensions==4.12.2

It always crated .venv in local directory. I would prefere using ..\venvs\new

There is any settings in uv.toml or in pyproject.toml?

@zanieb
Copy link
Member

zanieb commented Aug 28, 2024

Please see #1495 and #5229

@zanieb zanieb closed this as not planned Won't fix, can't repro, duplicate, stale Aug 28, 2024
@zanieb zanieb added the duplicate This issue or pull request already exists label Aug 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

2 participants