-
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
Extract wheels directly to install location #6030
Comments
Okay, so I have two choices for the shorter install step. I'm happy to do either, but the latter is a bigger change and I'll only go that way if you were wanting to do it anyway:
Right now there's consistency between all the different source types as handled by the pieces of the install command, so taking the second approach will complicate that. Then again, if you were hoping to streamline the install command to something more like "acquire files, resolve dependencies, repeat until ready, build non-wheels, install wheels" then I can start moving this way? |
Let's do the later. |
I'll try and map things out and come up with a proper design proposal before moving too far forward. I think I want a new requirement type/subclass for wheels (to separate "install requirement" from "build/install requirement"), but I'm not totally sure yet. |
Okay, so here's my high level plan:
I think because of the way that |
There is a no-binary option - which basically means that a certain package should be installed from an sdist directly. We can't remove the ability to setup.py install just yet. ;) #5051 has some notes on a potential design for changing InstallRequirement. It's basically making a Distribution class which will be used for preparation / installation that differs for legacy sdist vs PEP 517 sdist vs wheel. It's a multi stage process to get there and I've been working on actually implementing it, for a day now. One of the effects of that would be of untangling the code to make things like identifying code that's only run for sdist vs wheel vs editable become easier to spot. |
@pradyunsg My understanding is that Having said that, switching to always installing by building a wheel first, even on the "legacy" path, is a definite change in behaviour, and one that we need to explicitly and clearly document. It'll probably be controversial, but honestly I think we'll have to bite the bullet at some point, and doing it as part of a change that adds other value is better than doing it as a standalone piece of work that only has internal benefits. |
I agree with Paul that biting the bullet is going to have to happen, and this seems like a good time. I'm following #5051 now, so let me know how I can help. It's certainly got a lot of overlap with what I'm thinking here - once it's done, the change to avoid eager-extraction of wheels should be much simpler. |
--no-binary says "Do not use binary packages" in it's docstring. Currently, doing a My understanding stems from the fact that it is that a commonly suggested way on Stackoverflow etc for cases where wheel based installation is to be avoided. I think I've suggested it to people offline as well as a workaround for when wheels don't do what they want. That said, I have no issues removing that code path. In fact, the idea behind #5051 came from an attempt to understand what be done to separate the build paths that use setup.py install to be able to treat them differently and removing them in a post PEP 517 world, is something I'm on board for. |
If six had a |
Right. I've been thinking about it in terms of the most common use case I've seen for that functionality - the way you put it makes sense to me. The no-binary direction is probably a false alarm due to my (mis)interpretation of the option's effect. |
FTR, IIUC, the setup.py install removal discussion has to happen in #5204. |
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 <[email protected]>
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 <[email protected]> Co-authored-by: Ellen Marie Dash <[email protected]>
The current sequence of events for installing a wheel involves extracting it to a temporary location, then copying it to the install location. This requires additional work to copy metadata and permissions, which would not be necessary if it started in the target location (or within one directory rename of the target location).
Avoiding the copy step would be a significant performance increase for installing wheels, particularly on Windows where the current process triggers anti-malware scanners multiple times.
(Forked from #3055)
The text was updated successfully, but these errors were encountered: