-
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
env: make pip/setuptools/wheel configurable #3920
Conversation
2c5b6aa
to
eef07aa
Compare
981b5ca
to
ce9ced2
Compare
I am on the fence here since we are starting to leak implementation details in our own config which I don't necessarily like. The fact that we use virtual environments internally – and more precisely |
This change introduces the following configuration options: - `virtualenvs.options.no-pip` (Default: `false`) - `virtualenvs.options.no-wheel` (Default: `false`) - `virtualenvs.options.no-setuptools` (Default: `false`) With these options, we allow, the user to control the inclusion of `pip`, `wheel` and `setuptools` packages in new virtual environments. The defaults used retain existing behaviour as of `1.1.5`. In addition the following now holds true. - projects can define `pip`, `wheel` and `setuptools` as dependencies - if any of these packages are in the project's dependency tree, poetry will manage their versions - all poetry internal commands will use pip embedded in virtualenv irrespective of pip beig available in the environment - if `poetry run pip` is executed, pip installed in the virtualenv will be prioritsed - `poetry install --remove-untracked` will ignore these packages if they are not present in the project's dependency tree Relates-to: python-poetry#2826 Relates-to: python-poetry#3916
Replace updates of os.environ with explicit passing of `env` to subprocess calls in `Env.execute()`. Relates-to: python-poetry#3199
Previously, pytest execution was influenced by poetry user configuration. This change ensures that a new config.toml is used each test case.
ce9ced2
to
3902965
Compare
3902965
to
66793d7
Compare
I had to chew on this one a bit myself. I would have prefered this was not required and we used empty virtual environments by default. That works well, however we hit an issue IDEs start having issues since they expect The way I see it, we do manage virtual environments whether it is via The other option is to expose this in the |
Based on the conversation above we might revisit this later and instead move some of the changes into #4011. This will mean the current behavriour is not altered, however reserved packages are still allowed to be managed as a project dependency when required. If a user requires an empty virtual envrionment, they will be expected to create one themselves or remove these packages manually after creation. |
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. |
This change introduces the following configuration options:
virtualenvs.options.no-pip
(Default:false
)virtualenvs.options.no-wheel
(Default:false
)virtualenvs.options.no-setuptools
(Default:false
)With these options, we allow, the user to control the inclusion of
pip
,wheel
andsetuptools
packages in new virtual environments.The defaults used retain existing behaviour as of
1.1.5
.In addition the following now holds true.
pip
,wheel
andsetuptools
as dependencieswill manage their versions
irrespective of pip beig available in the environment
poetry run pip
is executed, pip installed in the virtualenv willbe prioritsed
poetry install --remove-untracked
will ignore these packages ifthey are not present in the project's and the options are not set to
true
dependency treeRelates-to: #2826
Relates-to: #3916
Testing
Using pipx
Using a container (podman | docker)