Skip to content

Fix #2089: Make Python implementation type as part of the venv name. - #2402

Closed
PetterS wants to merge 2 commits into
python-poetry:masterfrom
PetterS:pypy
Closed

Fix #2089: Make Python implementation type as part of the venv name.#2402
PetterS wants to merge 2 commits into
python-poetry:masterfrom
PetterS:pypy

Conversation

@PetterS

@PetterS PetterS commented May 10, 2020

Copy link
Copy Markdown
Contributor

Resolves: #2089. Now "pypy" is part of the venv name so that it can be used together with poetry. Virtualenvs using Cpython will not change names to ensure backwards compatibility.

  • Added tests for changed code.

@PetterS

PetterS commented May 10, 2020

Copy link
Copy Markdown
Contributor Author

Does not yet work since the "-py" prefix is still hard-coded in a few more places in env.py. I don't know enough about how Poetry fetches its config to fix it right now.

When the following command is performed:

poetry env use /path/to/pypy3

Poetry prints:

Creating virtualenv poetry-0nHquv0u-pypy3.6 in /home/petter/.cache/pypoetry/virtualenvs
Using virtualenv: /home/petter/.cache/pypoetry/virtualenvs/poetry-0nHquv0u-py3.6

So it creates the correct environment, but then still decides to use the old one. Will update the rest of the places.

@PetterS

PetterS commented May 10, 2020

Copy link
Copy Markdown
Contributor Author

It now works for me locally with pypy, so this is something that can be discussed.

@PetterS PetterS changed the title DRAFT: Make Python implementation type as part of the venv name. Fix #2089: Make Python implementation type as part of the venv name. May 10, 2020
@thedrow

thedrow commented May 12, 2020

Copy link
Copy Markdown

I'll give it a shot :)

@PetterS

PetterS commented Jul 19, 2020

Copy link
Copy Markdown
Contributor Author

@abn would be nice if we could discuss this.

@abn

abn commented Jul 19, 2020

Copy link
Copy Markdown
Member

In principle the change looks good. How would this handle reuse of an existing environment for the project?

@PetterS

PetterS commented Jul 20, 2020

Copy link
Copy Markdown
Contributor Author

Since this PR only affects the name of the directory for Python implementations other than CPython, I think it should be fine?

@finswimmer
finswimmer requested a review from a team July 27, 2020 18:04
@finswimmer finswimmer added the area/venv Related to virtualenv management label Jul 27, 2020
@Secrus

Secrus commented May 17, 2022

Copy link
Copy Markdown
Member

@PetterS are you still interested in bringing it to Poetry? If so, please merge changes from master branch and resolve potential conflicts. Whats more, please include some documentation on that matter.

@thedrow

thedrow commented May 24, 2022

Copy link
Copy Markdown

I'm still interested in this but I don't have the time to rebase it right now.

@PetterS

PetterS commented May 27, 2022

Copy link
Copy Markdown
Contributor Author

Yes, I think it would be useful.

@PetterS
PetterS changed the base branch from develop to master May 27, 2022 11:09
@PetterS

PetterS commented May 27, 2022

Copy link
Copy Markdown
Contributor Author

Well this patch does not apply anymore. It has been 2 years!
But there is some more support for pypy now it seems: interpreter_name

perhaps it works now? Otherwise, it should be easier to set the environment name since the info is already fetched.

@thedrow

thedrow commented May 29, 2022

Copy link
Copy Markdown

It behaves exactly the same according to the code but yes, it should be much easier to implement this behavior now.

@PetterS PetterS closed this Jun 1, 2022
@github-actions

Copy link
Copy Markdown

This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions Bot locked as resolved and limited conversation to collaborators Feb 29, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

area/venv Related to virtualenv management

Projects

None yet

Development

Successfully merging this pull request may close these issues.

poetry use pypy3 switches to a Python 3.6 venv if it already exists

5 participants