-
Notifications
You must be signed in to change notification settings - Fork 2.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add a way to set a fixed Python version for a project #621
Comments
Hi, About adding a new command:Poetry has already many commands so adding new ones should be considered to not make the things to complicated. Why add a new command since we already have install, run config... Since you propose to create the virtualenv with the About the way of switching between env I understand the idea of a About the name of the new commandIf we go anyway with a new command, I think one word should be better : About the virtualenv name :Should we handle the micro version ? About the per-project .venvif the python version specified is different from current, we should manage to make poetry erase the current .venv and reinstall an new one. About the multiplication of virtualenv in cache with this new option :maybe we should add a command 🤣 It was a bit long sorry, thanks for taking time to question our views, its cool |
No, because this is not the purpose of Having a separate command makes the association of the current project with a specific Python version explicit.
Regarding the name of the command, it is not set yet and is just here to show the intended use case.
No, I don't think so. To me the minor version is the important one, not the patch version.
I wondered too but the cases where you have two Python projects with the same name are rare and do not warrant changing the current implementation.
This can be handled by the future |
So if I understand your mind, poetry workflow will have two entry points: I deduce : We could add |
I run into this fairly often, and have started using the venv in dir setting to mitigate this issue. It's fairly often the case when I am trying to reproduce a poetry bug with a minimal example, or even when I am working on projects for myself and for my company where the two may have the same names. |
I think this use case is not unusual : |
I also have with some regularity wanted two different local envs of the same project. For example, if I'm playing around with different sets of dependencies for different work. I think taking the path into account somehow would be wise, probably via a hash or something. I know pipenv does something like that, though I'm not sure exactly what their algorithm is. |
Why not use multiple names for the launch of Poetry to specify the desired version of Python? For example:
This is familiar to Debian, Ubuntu, and Linux Mint users. Since they are already using:
And today in last versions of Ubuntu, we can install Python 3.7 and use with command: Thanks. |
PR #731 is ready for review :-) |
I seem to not be able to get it to build the write binary version of the wheel even after using Notice that it's csv_reconcile-0.2.5-cp38-cp38-macosx_11_0_x86_64.whl. My project uses Cython. Should I open a new issue for this?
I've installed
[EDIT:] I tracked by issue down to this line in
CC: @sdispater |
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
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: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.The text was updated successfully, but these errors were encountered: