-
Notifications
You must be signed in to change notification settings - Fork 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
Disallow explicitly passing install-location-related arguments in --install-options #7309
Comments
Sounds like a good idea to me. We'd have to go through a regular deprecation cycle here but I don't see any reason to not do this. |
nods I don't think this is an extension of #6606 -- that PR changed when pip used PEP 517, which is something we're still working on. This, however, affects everyone on the legacy code path. We'd be removing functionality that user might depend on directly, so we should go through the deprecation cycle for it. FWIW, I now know that basically any change in pip's build logic will affect someone (i.e. break their deployment / CI pipeline) and they're usually not happy about it. With the power of retrospect, I feel we should've gone for at least short deprecation cycle (1 release) for #6606 since that was a (minor) change in end-user-affecting behavior as well. |
OK. After thinking on it more, we can communicate the workaround in the deprecation notice. Hopefully that means currently impacted users will not have to search the issue tracker when some packages are missing, so I don't mind that approach as much as I did initially. It might even be worth including in a fix release for 19.3? Then we could also close #7240. |
Given that we've already closed that issue (which is a form of communication on our release processes), I'm inclined to say no -- but it's really an RM's decision so... pinging @xavfernandez! :P FWIW, I'm in no hurry to close #7240 but yes, even the deprecation messaging is enough to justify closing it. |
I'm on board with forbidding conflicting options in |
Note that #7002 (unreleased) will also break some usages of these options in |
After talking this over with @pradyunsg, our conclusions are:
|
For the more fine-grained option handling, I'm thinking the following: install options mapped to pip optionsif provided in any
install options that override scheme values directlyIf provided in any
unsupported install optionsThese options, which do not have an equivalent in the scheme that we install packages to, are unsupported and if they are provided in any
I think this is the minimum (in terms of user-facing impact) we can do while still being able to move forward on creating an explicit scheme for install. Just to reiterate why this is important: once the above is in place, we would be able to do the following:
|
This future-proofs this script as this form of invocation is about to go the way of dinosaurs. See pypa/pip#7309.
Added to milestone 20.2. |
Was a deprecation warning added in 19.3/20.2? Or is this an optimistic "we'll add the warning in 20.2"? |
@pradyunsg There is a deprecation warning pointing to this issue, with gone_in="20.2". No feedback was reported here so I assume it's now appropriate to convert the warning into an error. |
Awesome! |
The relevant bit of code: pip/src/pip/_internal/commands/install.py Lines 635 to 649 in 4645ecb
|
So, unfortunately, I didn't include As a result we can't do a full replacement now like I was intending. We can still take an approach like I described in #7309 (comment), and it should be quite a bit easier since there are only two values and they map directly to the scheme values we should use (overriding "scripts" and "lib_dir"). We could do that while waiting another 2 releases before disallowing |
153: Update pip to 20.2 r=duckinator a=pyup-bot This PR updates [pip](https://pypi.org/project/pip) from **20.1.1** to **20.2**. <details> <summary>Changelog</summary> ### 20.2 ``` ================= Deprecations and Removals ------------------------- - Deprecate setup.py-based builds that do not generate an ``.egg-info`` directory. (`6998 <https://github.com/pypa/pip/issues/6998>`_, `8617 <https://github.com/pypa/pip/issues/8617>`_) - Disallow passing install-location-related arguments in ``--install-options``. (`7309 <https://github.com/pypa/pip/issues/7309>`_) - Add deprecation warning for invalid requirements format "base>=1.0[extra]" (`8288 <https://github.com/pypa/pip/issues/8288>`_) - Deprecate legacy setup.py install when building a wheel failed for source distributions without pyproject.toml (`8368 <https://github.com/pypa/pip/issues/8368>`_) - Deprecate -b/--build/--build-dir/--build-directory. Its current behaviour is confusing and breaks in case different versions of the same distribution need to be built during the resolution process. Using the TMPDIR/TEMP/TMP environment variable, possibly combined with --no-clean covers known use cases. (`8372 <https://github.com/pypa/pip/issues/8372>`_) - Remove undocumented and deprecated option ``--always-unzip`` (`8408 <https://github.com/pypa/pip/issues/8408>`_) Features -------- - Log debugging information about pip, in ``pip install --verbose``. (`3166 <https://github.com/pypa/pip/issues/3166>`_) - Refine error messages to avoid showing Python tracebacks when an HTTP error occurs. (`5380 <https://github.com/pypa/pip/issues/5380>`_) - Install wheel files directly instead of extracting them to a temp directory. (`6030 <https://github.com/pypa/pip/issues/6030>`_) - Add a beta version of pip's next-generation dependency resolver. Move pip's new resolver into beta, remove the ``--unstable-feature=resolver`` flag, and enable the ``--use-feature=2020-resolver`` flag. The new resolver is significantly stricter and more consistent when it receives incompatible instructions, and reduces support for certain kinds of :ref:`Constraints Files`, so some workarounds and workflows may break. More details about how to test and migrate, and how to report issues, at :ref:`Resolver changes 2020` . Maintainers are preparing to ``` ### 20.2b1 ``` =================== Bug Fixes --------- - Correctly treat wheels containing non-ASCII file contents so they can be installed on Windows. (`5712 <https://github.com/pypa/pip/issues/5712>`_) - Prompt the user for password if the keyring backend doesn't return one (`7998 <https://github.com/pypa/pip/issues/7998>`_) Improved Documentation ---------------------- - Add GitHub issue template for reporting when the dependency resolver fails (`8207 <https://github.com/pypa/pip/issues/8207>`_) ``` </details> <details> <summary>Links</summary> - PyPI: https://pypi.org/project/pip - Changelog: https://pyup.io/changelogs/pip/ - Homepage: https://pip.pypa.io/ </details> Co-authored-by: pyup-bot <github-bot@pyup.io>
153: Update pip to 20.2 r=duckinator a=pyup-bot This PR updates [pip](https://pypi.org/project/pip) from **20.1.1** to **20.2**. <details> <summary>Changelog</summary> ### 20.2 ``` ================= Deprecations and Removals ------------------------- - Deprecate setup.py-based builds that do not generate an ``.egg-info`` directory. (`6998 <https://github.com/pypa/pip/issues/6998>`_, `8617 <https://github.com/pypa/pip/issues/8617>`_) - Disallow passing install-location-related arguments in ``--install-options``. (`7309 <https://github.com/pypa/pip/issues/7309>`_) - Add deprecation warning for invalid requirements format "base>=1.0[extra]" (`8288 <https://github.com/pypa/pip/issues/8288>`_) - Deprecate legacy setup.py install when building a wheel failed for source distributions without pyproject.toml (`8368 <https://github.com/pypa/pip/issues/8368>`_) - Deprecate -b/--build/--build-dir/--build-directory. Its current behaviour is confusing and breaks in case different versions of the same distribution need to be built during the resolution process. Using the TMPDIR/TEMP/TMP environment variable, possibly combined with --no-clean covers known use cases. (`8372 <https://github.com/pypa/pip/issues/8372>`_) - Remove undocumented and deprecated option ``--always-unzip`` (`8408 <https://github.com/pypa/pip/issues/8408>`_) Features -------- - Log debugging information about pip, in ``pip install --verbose``. (`3166 <https://github.com/pypa/pip/issues/3166>`_) - Refine error messages to avoid showing Python tracebacks when an HTTP error occurs. (`5380 <https://github.com/pypa/pip/issues/5380>`_) - Install wheel files directly instead of extracting them to a temp directory. (`6030 <https://github.com/pypa/pip/issues/6030>`_) - Add a beta version of pip's next-generation dependency resolver. Move pip's new resolver into beta, remove the ``--unstable-feature=resolver`` flag, and enable the ``--use-feature=2020-resolver`` flag. The new resolver is significantly stricter and more consistent when it receives incompatible instructions, and reduces support for certain kinds of :ref:`Constraints Files`, so some workarounds and workflows may break. More details about how to test and migrate, and how to report issues, at :ref:`Resolver changes 2020` . Maintainers are preparing to ``` ### 20.2b1 ``` =================== Bug Fixes --------- - Correctly treat wheels containing non-ASCII file contents so they can be installed on Windows. (`5712 <https://github.com/pypa/pip/issues/5712>`_) - Prompt the user for password if the keyring backend doesn't return one (`7998 <https://github.com/pypa/pip/issues/7998>`_) Improved Documentation ---------------------- - Add GitHub issue template for reporting when the dependency resolver fails (`8207 <https://github.com/pypa/pip/issues/8207>`_) ``` </details> <details> <summary>Links</summary> - PyPI: https://pypi.org/project/pip - Changelog: https://pyup.io/changelogs/pip/ - Homepage: https://pip.pypa.io/ </details> Co-authored-by: pyup-bot <github-bot@pyup.io> Co-authored-by: Ellen Marie Dash <me@duckie.co>
@chrahunt I've been looking along this thread and haven't been able to find my answer, hopefuly you can give me an answer :) Thank you |
Hello! Do you mind creating a new issue with this question and maybe a few more details on your use case so we can provide better advice? |
This command will raise an error from pip 20.2.2. pypa/pip#7309 Without this command we can't call coverage3 directly so we had to change our Makefile a bit.
pip documentation still gives "--install-scripts" as a suggested use of "--install-option" |
@nugend Would you mind opening a new issue for the documentation fix? |
This is used by one of our repositories at work, to keep all scripts used at |
As stated above, please open a new issue. I think this fits well into the recent configurable install scheme discussion, but it should be discussed as a feature request on its own, not buried under a closed issue. |
See pypa/pip#7309. Using --install-option and either of --prefix or --install-lib results in an error starting at pip 20.2.
For anyone else who happens to run across this. We were also were using We were using it to package utility scripts or other in venvs and put those entry point / console scripts in a folder that was in path, but without wanting to add a bunch of With the deprecation and pending removal, the workaround we've settled on is to split the install into two steps: -pip install sphinx --install-option="--install-scripts=/custom/path"
+pip install sphinx
+pip install sphinx --no-deps --force-reinstall --target "/custom/path"
Since we're working with venvs, for our usage, this has the desired effect. |
What's the problem this feature will solve?
Currently the
--install-option
parameter allows passing arbitrary arguments tosetup.py
for packages using the legacy-installation path. If any options/flags that control install location are passed, such as:--exec-prefix
--home
--install-base
--install-data
--install-headers
--install-lib
--install-platlib
--install-purelib
--install-scripts
--prefix
--root
--user
then it causes issues. Not every package uses
setup.py
, so in the general case this causes legacy packages to be installed with the the scheme provided in--install-option
and PEP 517/wheel packages to be installed with the scheme pip is aware of. This has already hit two users (#7253, #7240).Pip knows how to use scheme information properly for PEP 517, wheel, and legacy installs. Enforcing that pip is the only one passing this kind of information will make the user experience more consistent.
Describe the solution you'd like
Explicitly fail
pip install
if--install-option
includes any of the above arguments, whether provided on the command-line or in a requirements file.In addition to the consistent user experience, this would also allow pip to pass the more explicit
--install-{purelib,platlib,headers,scripts,data}
(forinstall
)--install-dir
,--script-dir
(forinstall -e
)to
setup.py
instead of the current--prefix
,--home
,--root
,--user
, and--install-headers
.This may also be required to implement PEP 582 (
__pypackages__
) since doing legacy installs to a plainlib
directory isn't possible with the current arguments being passed tosetup.py
, and passing an explicit--install-lib
would break any usages of the other arguments in--install-option
.IMO this could be implemented without deprecation because the current behavior demonstrated in #7253 and #7240 causes failures in non-obvious ways, and the remediation is simple in most cases - just pass the parameters to pip instead.
Alternative Solutions
--install-option
we will get more support tickets. These will taper off eventually as people stop using these flags in order to install non-legacy packages. We eventually forget that the user can pass these options, and implement new features without worrying about it.--install-option
- this defeats the purpose of having pip-level arguments--install-option
conflicts with the one specified at the pip level - this is more friendly, but I feel that it would also be more confusing and add to the implementation burden in pip (reconciling--install-option
across different packages in a requirements file)Additional context
--home
,--prefix
,--user
, and--root
to setup.pyThe text was updated successfully, but these errors were encountered: