Add a way to set a fixed Python version for a project
See original GitHub issue- I have searched the issues of this repo and believe that this is not a duplicate.
Issue
Since this is an issue that has arisen before (see #522) and there is some confusion around which Python version Poetry uses, introducing a more explicit way to tell which Python version to use seems reasonable.
Before we go into more details of what it would look like, it’s important to note that the default behavior (using the currently activated Python) will remain. This new feature will only make it more convenient for people to choose explicitly what they want to use.
So, with that being said, here is what a possible implementation could look like.
This requires the introduction of a new command which would accept a python executable as an argument. The argument must be a full path to a Python executable or a python
command that is in the path:
poetry project use --python python
poetry project use --python python3
poetry project use --python /full/path/to/python
What this command would do is create a virtualenv like the ones currently created in the form {project_name}-py3.6
, and write the association of the virtualenv and the project to a file so that Poetry knows what to use.
If the virtualenv already exists and it is not currently associated with the project, it will be associated. This makes switching between virtualenvs easier.
This will likely be implemented for the release of the first stable 1.0.0
release.
Issue Analytics
- State:
- Created 5 years ago
- Reactions:16
- Comments:9 (6 by maintainers)
Top GitHub Comments
PR #731 is ready for review 😃
I think this use case is not unusual : you clone a repo : do somethings you decide to fork it and then clone your fork you got two project with same name.