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

pdm venv create does not default to venv.location when .venv exists. #2395

Closed
1 task done
laenan8466 opened this issue Nov 11, 2023 · 3 comments
Closed
1 task done
Labels
🐛 bug Something isn't working

Comments

@laenan8466
Copy link

  • I have searched the issue tracker and believe that this is not a duplicate.

Steps to reproduce

  1. Project creation
pdm init # Create a new project

with parameters resulting in this pyproject.toml:

[project]
name = ""
version = ""
description = ""
authors = [
    {name = "", email = ""},
]
dependencies = []
requires-python = ">=3.10"
readme = "README.md"
license = {text = "MIT"}

and creating a new venv with the pyenv global setting on 3.11 during the init command.

  1. 2nd venv
    Now creating another venv:
pdm venv create -v 3.10

Actual behavior

STATUS: Creating virtualenv using virtualenv...
[VirtualenvCreateError]: The location /path/to/project/.venv is not empty, add --force to overwrite it.

No creation of 2nd venv.

Expected behavior

I would have expected pdm to create the 2nd venv in venv.location, like described in the documentation.

Environment Information

PDM version:
  2.10.1
Python Interpreter:
  /path/to/project/.venv/bin/python (3.11)
Project Root:
  /path/to/project
Local Packages:
  
{
  "implementation_name": "cpython",
  "implementation_version": "3.11.6",
  "os_name": "posix",
  "platform_machine": "x86_64",
  "platform_release": "5.15.90.1-microsoft-standard-WSL2",
  "platform_system": "Linux",
  "platform_version": "#1 SMP Fri Jan 27 02:56:13 UTC 2023",
  "python_full_version": "3.11.6",
  "platform_python_implementation": "CPython",
  "python_version": "3.11",
  "sys_platform": "linux"
}
@frostming
Copy link
Collaborator

It seems like a mistake not implemented as desired. But I am not sure if anyone is relying on this behavior.

@laenan8466
Copy link
Author

laenan8466 commented Nov 12, 2023

This would have been a feature for test-automation and creation of multiple venvs for a project.
Solved this for me by using a setup script (pawamoy/copier-pdm#36).

Would recommend to clarify in docs, that this is not the actual behavior. Can be tracked here or closed, your decision.

@frostming
Copy link
Collaborator

Okay, I will update the docs to reflect the actual behavior.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants