Skip to content

Bug: In-project Poetry environment is misidentified as 'Venv' #282

@lingyaochu

Description

@lingyaochu

Description

When virtualenvs.path is not set (default), but virtualenvs.in-project is set to true, the created in-project environment is incorrectly detected as a generic Venv instead of Poetry.

To Reproduce

  1. Configure the project to use in-project virtual environments. Use the CLI or manually edit poetry.toml in the project:
[virtualenvs]
in-project = true

(Ensure that virtualenvs.path is not set)
2. Run poetry install to create the .venv in the project
3. Check how pet-poetry recognizes the environment (Incorrectly detected as Venv).
4. Update poetry.toml to explicitly include virtualenvs.path:

[virtualenvs]
in-project = true
path = "{cache-dir}/virtualenvs"
  1. Check the pet-poetry recognition result again (Correctly detected as Poetry).

Expected Behavior

The environment should be recognized as Poetry. As stated in the Poetry document, virtualenvs.path should only control the storage path for global virtual environments. It should not alter the behavior or detection of local in-project environments. Therefore, I believe this is an issue with pet-poetry's detection logic.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugIssue identified by VS Code Team member as probable bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions