python-poetry / python-poetry/poetry

Virtual environments should include python patch version

Open
#2,619 1 comment 8 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

kind/feature status/triage
Dominant language
Python
Stars
34.3k
Forks
2.5k
Avg merge
2d 19h
Merged PRs (30d)
30

Description

  • [x ] I have searched the issues of this repo and believe that this is not a duplicate.
  • [ x] I have searched the documentation and believe that my question is not covered.

Feature Request

I think this is somewhat related to #2282 but perhaps framed differently

I am using pyenv with poetry. It looks like poetry creates/uses virtual environments strictly based on the python major version.
eg it will distinguish between 3.7 vs 3.8 but not between 3.8.2 vs 3.8.3
This makes switching between two different minor versions of python difficult.

pyenv shell 3.7.8
poetry env info # displays virtual env created with python 3.7.8
pyenv shell 3.8.2
poetry env info  # displays virtual env created with python 3.8.2
pyenv shell 3.8.3
poetry env info  # still displays python 3.8.2 virtual env

It is not difficult to work around this using pyenv virtualenv and disabling poetry's virtualenv handling.
However, I think it makes more sense for poetry to include the minor version when determining the virtual environment.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the pyenv and poetry env info sequence described in the issue with Python 3.8.2 and 3.8.3. Trace how Poetry selects virtual environments, then verify that changing the Python patch version selects a distinct environment while existing major-version behavior remains intact.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
tooling
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.