1
1
Fork 0
mirror of https://github.com/pypa/pip synced 2023-12-13 21:30:23 +01:00
Commit graph

77 commits

Author SHA1 Message Date
Stéphane Bidoul 7c6ee48b04 PEP 517 build in presence of --global-option emits a warning
So these are not ignored silently.
2021-04-04 16:08:49 +02:00
Stéphane Bidoul 69dee6286d PEP 517 + --build-option is now a warning
We warn instead of erroring out when --build-option is present
when doing a PEP 517 build. There is no strong reason to error
out, and this will avoid backward compatibility issues when we
support build options in requirement files and installation.
2021-04-04 16:08:49 +02:00
Andrey Bienkowski cd7b50277e Use f-strings for formatting 2021-03-29 10:37:24 +03:00
Tzu-ping Chung 56a8f3d8bd Typing fixes 2021-03-10 16:40:58 +08:00
Jon Dufresne 0945809afc Remove typing.TYPE_CHECKING guards
The typing module has been available since Python 3.5. Guarding the
import has been unnecessary since dropping Python 2.

Some guards remain to either:

- Avoid circular imports
- Importing objects that are also guarded by typing.TYPE_CHECKING
- Avoid mypy_extensions dependency
2021-02-19 18:34:21 -08:00
Jon Dufresne a6392bd62e Replace pip._internal.utils.typing with stdlib typing
The stdlib module has been available since Python 3.5 and the
TYPE_CHECKING constant has been available since 3.5.2.

By using stdlib, this removes the need for pip to maintain its own
Python 2 typing compatibility shim.
2021-02-18 19:09:13 -08:00
Tzu-ping Chung d16a5036de Remove direct pkg_resources usage in wheel_builder 2021-02-04 12:10:28 +08:00
Pradyun Gedam c7419b2aac
Merge pull request #9320 from uranusjr/wheel-check-valid
Verify built wheel contains valid metadata
2021-01-05 21:47:53 +00:00
Stéphane Bidoul 06f1eff024
Simplify check_binary_allowed
check_binary_allowed is only used to check
if a wheel needs to be built in 'pip install' mode.
It mixed format control and pep517 mode check.

We change it so it checks allowed formats only,
which leads to better readability of _should_build().
2020-12-31 13:17:44 +01:00
Tzu-ping Chung 6902269d4c Verify built wheel contains valid metadata 2020-12-27 20:13:34 +08:00
Pradyun Gedam 25ab172b55
Update linter: isort 2020-09-23 19:52:28 +05:30
Stéphane Bidoul fe5682627a
Quote 'setup.py install' when calling it legacy
We want to make it clear that it is the setup.py install command we consider
legacy, not setup.py itself.
2020-07-18 13:46:19 +02:00
Devesh Kumar Singh 9a8bcf3f34 Add type: ignore to requirements loop 2020-06-25 23:27:50 +05:30
Devesh Kumar Singh be75ed8566 Type annotations for pip._internal.wheel_builder 2020-06-25 20:52:33 +05:30
Devesh Kumar Singh 76a130105c Fix src/pip with flake8-bugbear 2020-06-10 00:36:03 +05:30
Pradyun Gedam 76b865155e
Merge pull request #8145 from sbidoul/simplfy-should_cache-sbi 2020-05-21 21:30:40 +05:30
Devesh Kumar Singh 60f00b837a Upgrade flake8 to 3.8.1
Co-Authored-By: Anthony Sottile <asottile@umich.edu>
2020-05-18 21:58:26 +05:30
Stéphane Bidoul d8c14d4006
Clarify message when wheel is not installed 2020-05-01 09:57:16 +02:00
Stéphane Bidoul c20f778899
Do not unncessarily warn about wheel being absent
Do not warn about the wheel package being absent
if wheel building would have been skipped for another reason.
2020-05-01 09:57:15 +02:00
Stéphane Bidoul 88da3441ce
Simplify _should_cache
The condition "never cache if pip install would not have built"
can be simplified to "do not cache editable requirements".
This is easier to read, and avoid a double warning if the 'wheel'
package is not installed.
2020-04-26 11:31:02 +02:00
Tzu-ping Chung 510aa46580 Space after comma 2020-04-17 22:39:35 +08:00
Anudit Nagar e6ed38dbce
Add info log when wheel building is skipped (#7768) 2020-02-23 22:56:36 +01:00
Stéphane Bidoul (ACSONE) 0e1e0ef566 _should_cache does not depend on check_binary_allowed
_should_cache is only called by _get_cache_dir.

In pip install mode, _get_cache_dir is never called when
check_binary_allowed returns False because in that case
should_build_for_install_command has returned False before
and the build was skipped.

In pip wheel mode, check_binary_allowed always returns True
(because it is not passed to the build function).

So _should_cache can use _always_true for check_binary_allowed.

*Alternative*

Alternatively, we could have passed check_binary_allowed
to build in pip wheel mode. The only difference is that wheels built
locally from *legacy* packages would then not be cached,
when pip wheel is used with --no-binary.
2020-01-20 10:41:48 +01:00
Stéphane Bidoul (ACSONE) 5aa3b3d2f0
Remove unused build() argument 2020-01-05 23:52:42 +01:00
Stéphane Bidoul (ACSONE) 66e010980a
Remove WheelBuilder
build is now a function
2020-01-05 23:52:42 +01:00
Stéphane Bidoul (ACSONE) 9729273ca8
Make should_build and should_cache "private" 2020-01-05 23:52:42 +01:00
Stéphane Bidoul (ACSONE) c0aca12123
Clarify should_cache a bit 2020-01-05 23:52:42 +01:00
Stéphane Bidoul (ACSONE) 25521f29b5
should_build always returns a boolean 2020-01-05 23:52:41 +01:00
Stéphane Bidoul (ACSONE) 6e7d0e5a05
_collect_buildset becomes _get_cache_dir
The only purpose of _collect_buildset is now
to compute the cache directory to use
for a given requirements. This is better
computed one by one in the build loop.
2020-01-05 23:52:41 +01:00
Stéphane Bidoul (ACSONE) 870106b9bb
Simplify _collect_buildset
Since filtering of what to build has been
done beforehand, there is no need to filter
again here anymore.
2020-01-05 23:52:41 +01:00
Stéphane Bidoul (ACSONE) 8ca8e9bf61
Extend should_build scope wrt legacy requirements
We don't build legacy requirements
when wheel is not installed because
we'll fallback to a legacy install in such case.
2020-01-05 23:52:40 +01:00
Stéphane Bidoul (ACSONE) 3de4765ec7
Add should_build function for wheel and install commands 2020-01-05 23:52:40 +01:00
Chris Hunt a94fb53dad Don't unpack wheel files after building for install
Actual installation has been using the wheel file directly for some
time. The last piece that required an unpacked wheel was metadata. Now
that it uses the wheel file directly, we can remove the unpacking after
build.
2020-01-05 10:57:15 -05:00
Stéphane Bidoul (ACSONE) 8d1d20de8c
Do not attempt setup.py clean for failed pep517 builds
Fixes #6642
2020-01-02 12:14:03 +01:00
Stéphane Bidoul (ACSONE) 261c286de9
Make wheel_cache an argument of build() 2019-12-29 18:51:45 +01:00
Stéphane Bidoul (ACSONE) c8d4277535
Convert _build_one from method to function
It does not rely on WheelBuilder anymore.
2019-12-29 18:51:44 +01:00
Stéphane Bidoul (ACSONE) 3828699ddc
Move build options from WheelBuilder to build function 2019-12-29 18:49:54 +01:00
Pradyun Gedam ccfef67016
Move PEP-517 wheel build logic into operations.build 2019-12-29 16:57:02 +05:30
Christopher Hunt 711cf4deaf
Merge pull request #7517 from sbidoul/wheel-builder-disentangle-6-sbi
Move final wheel builder copy operation to wheel command
2019-12-29 13:46:02 +08:00
Pradyun Gedam 7d9b392fc0
Move legacy wheel build process into "operations.build" (#7513) 2019-12-28 18:55:06 +00:00
Stéphane Bidoul (ACSONE) 7c2c58442f
Update docstring 2019-12-28 16:18:10 +01:00
Stéphane Bidoul (ACSONE) 158ae67910
Remove unused _wheel_dir in WheelBuilder 2019-12-26 21:43:57 +01:00
Stéphane Bidoul (ACSONE) 9909b4069a
Move final copy operation from wheel_builder to wheel command 2019-12-26 21:43:57 +01:00
Stéphane Bidoul (ACSONE) cf21401fd7
Make wheelbuilder.build return successes too
Also, pluralize variable names for readability and consistency with
similar variables in callers.
2019-12-26 21:43:57 +01:00
Stéphane Bidoul (ACSONE) a4d06aecaa wheel builder: unconditionally update req.link (#7515)
We unconditionally update the requirement
link with the build wheel (in cache), so
when build() will return build success as
well as build failure, the caller can obtain
the built wheel by looking at req.local_file_path
2019-12-27 04:31:55 +08:00
Pradyun Gedam 37f3fd7087
Move legacy wheel build process 2019-12-25 17:52:39 +05:30
Christopher Hunt 2a48286178
Merge pull request #7484 from sbidoul/wheel-builder-disentangle-3-sbi
Add missing error logging in WheelBuilder
2019-12-18 13:12:54 +08:00
Stéphane Bidoul (ACSONE) 2a1fb915e2
Remove useless pass statement
Co-Authored-By: Christopher Hunt <chrahunt@gmail.com>
2019-12-16 17:44:34 +01:00
Stéphane Bidoul (ACSONE) 45222a2b36
ensure cache dir is present before building 2019-12-15 23:56:20 +01:00
Christopher Hunt d6491fe666
Merge pull request #7483 from chrahunt/refactor/install-packed-wheel
Add downloaded/local archive path to InstallRequirement
2019-12-15 23:50:36 +08:00