Replies: 8 comments 11 replies
-
Would it make sense, perhaps controlled by config option, for new projects to include I'm not sure if and how we could handle this behaviour for existing projects... Perhaps if the mooted |
Beta Was this translation helpful? Give feedback.
-
I note that VS Code's Python documentation countenances that Linux Python 3 installs may not have They're explicitly adding Poetry support right now (microsoft/vscode-python#8372)
Edit: I looked, and it appears that if a Poetry env is activated, |
Beta Was this translation helpful? Give feedback.
-
python-poetry/poetry-core#168 (comment) suggests a My concern with a config option is that different users may end up with different values, and hence see breakages that are not immediately reproducible on CI or other machines. In this case, I expect that if you take an existing project, change the Of course, the problem with a |
Beta Was this translation helpful? Give feedback.
-
Personally I think that poetry should just create a normal venv (with pip and setuptools) but always use it's embedded pip for install & removal. If a user then wishes to lock setuptools & pip to a specific version, they can do so… Even if they manage to break their venv, poetry would be able to fix it due to it's usage of the embedded pip. I guess there is just to much code out there that makes assumptions about what is present in a venv that this might cause more problems than it is worth in the longrun. That said (especially for deployment) it would be great to still be able to create a venv without pip/setuptools EDIT:// As for your suggestion of
This is highly technical and not something I'd want to have to recommend to people. Especially not if other tools have "simpler" integrations. |
Beta Was this translation helpful? Give feedback.
-
Yes and yes. Add the options to create virtual environments without pip and/or without setuptools now. Leave them by default for now, and in a later major release default to create virtual environments without them. Projects should declare explicit dependencies (dev or not) on pip and/or setuptools if they need it. I also see it as a very good thing if poetry does not use pip at all, or if pip usage is really needed poetry uses an "out-of-env" pip (virtualenv's embedded pip wheel seems like a good choice). Related: In the PyPA community there is some motivation towards making the packaging-related tools work "out-of-env", see this discussion. Pip does not have any dependencies of its own (they are "vendored" instead), so pip's presence in the virtual environment has very little influence on the dependency resolution and the possibility of conflicting dependencies. Same for setuptools. But I see it as a good practice to try to remove as much as possible from the environment so that only the actual application (or library) and its dependencies are present. Meaning we should also aim to remove all "dev" dependencies (linters, code beautifiers, testers, etc.) from the environment. |
Beta Was this translation helpful? Give feedback.
-
I wouldn't necessarily say it is overkill. Currently it is what everyone creating a venv usually expects. I am not saying that this is good but it is the status quo. Working against that might not be beneficial for poetry in the short run -- the situation might change if packaging changes a bit further but we are not there yet.
As for adding it to dev dependencies vs config I'd say that it is more portable if it doesn't require configuration. If a project doesn't need it, it can simply delete it once from project.toml. The config option on the other hand will require people to document it as part of the workflow when installing something via poetry...
…On Sun, Apr 11, 2021, at 14:32, Arun Babu Neelicattu wrote:
The issue here is that one developer might need it and another might
not. So putting them into the pyproject as a default feels a bit
overkill. And for pycharm, as an example, all it needs is pkg_resources
it'd seem.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#3916 (reply in thread)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AAAT5CZ4VZBS4ZJBQCYKIE3TIGJG5ANCNFSM42XBIURQ>.
|
Beta Was this translation helpful? Give feedback.
-
I prefer the variant to have an option that, if enabled, will install pip and setuptools within the venv. I guess we should be able to determine if this options are set to true, when running Furthermore I would prefer to set them to true by default. This let people recognize early, that there is something going on and they can start adopting their workflow or report the issue to their IDE. |
Beta Was this translation helpful? Give feedback.
-
I have added a draft version at #3920, testing would be appreicated. |
Beta Was this translation helpful? Give feedback.
-
With the changes introduced in #2826, new virtual environments created will not include
pip
norsetuptools
aspoetry
no longer assumes them to be present. You can try this by using the version ofpoetry
onmaster
.While this has many advantages (see #1584), it also has the disadvantage that majority of developer tools (PyCharm, VSCode etc.) out there makes the assumption that
pip
,pkg_resources
andsetuptools
exists in the environment. Personally, I think this assumption in itself is dangerous. Despite what I think about it, it is the common case and hence we should talk about the impact.As
poetry
users are largely using it for development, this is an issue. In order mitigate this concern, we could do the following.virtualenvs.options.with_pip
andvirtualenvs.options.with_setuptools
both defaulting totrue
to keep existing behaviour and perhaps flip it in a couple of releases.pip
embedded invirtualenv
, thus keeping it out of the unsafe packages list.The side-effects here (when options are enabled) are;
--remove-untracked
will removepip
and related packages. (We can potentially try avoiding this with the help of the values configured for the options above).Another option is to take the stance that if your development environment requires any of these packages, you explicitly add them to your project dependencies.
I would like to hear from the community;
The workaround I follow for my development environment is to use a second virtual environment with just IDE requirements and the
site-packages
added to the project interpretor's paths.WIP: #3920
Beta Was this translation helpful? Give feedback.
All reactions