question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Support multiple python versions for in-project virtual environment management

See original GitHub issue

The current scenario when virtualenvs.in-project = true is specified, is that we default to creating .venv as the virtual environment. This needs to be improved to support multiple versions of python.

Ideally we will end up having a structure similar to the one below.

.
└── .venv
    ├── 3.7
    ├── 3.8
    └── 3.9

Concensus Required

  • Directory structure and naming.
  • Should we default to this behaviour or make it opt-in only?
  • If we want to default to this behaviour, should we start by opt-in first, and then opt-out?
  • How should existing environments be handled? We can detect this and set project level config.

Tasks

  • Drive concensus, approved by members of @python-poetry/core
  • Implement new structure
  • Implement test cases that validate new environment creation(s), gracefull handling of existing environments, compatibility with existing env sub-commands.

Related issues: #2908

Issue Analytics

  • State:open
  • Created 3 years ago
  • Reactions:5
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
finswimmercommented, Sep 23, 2020

For sure @artorias111. We always appreciate contribution.

But we need to first come to a consensus on how it should look like, as @abn described in his post.

fin swimmer

0reactions
luismojenacommented, Feb 8, 2021

I don’t know if it’s on purpose, but I use this command export POETRY_VIRTUALENVS_PATH="$PWD/.venvs", and what @abn is proposing happens naturally

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to manage multiple Python versions and virtual ...
If you are using a single version of Python say version 3.3+, and want to manage different virtual environments, then venv is all...
Read more >
Python Environment management - Dev Genius
Your application needs to support multiple Python versions; Your want your virtual environment associated with your Python project and ...
Read more >
Managing environments | Documentation - Poetry
If you use a tool like pyenv to manage different Python versions, you can set the experimental virtualenvs.prefer-active-python option to true .
Read more >
Python Tools for Managing Virtual Environments
If you want to use virtualenv to manage virtual environments and also handle multiple Python versions, pyenv-virtualenv may suit you.
Read more >
Python Project Setup – Virtual Environments and Package ...
Virtual environments are helpful if you develop multiple Python ... environments; which tools help with package management in Python ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found