Commit Graph

8814 Commits

Author SHA1 Message Date
Chris Hunt 8460394c47 Update packaging version and include py.typed
Since the new packaging has types, it includes a py.typed. No harm in
including this in our package, and it may facilitate debug tool usage on
an installed pip by signaling that pip._vendor.packaging is
type-annotated.
2020-01-06 14:03:34 -05:00
Pradyun Gedam 5e1455561e
Move should_build filtering to wheel and install commands (#7527) 2020-01-06 14:25:40 +00: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) f04e6ab7b5
Split should_build test
Separately test should_build_for_wheel_command
and should_buid_for_install_command.
The tests are simpler and this open the door
for reasoning about both functions independently.
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) 68179ea0de
Add .trivial newsfile 2020-01-05 23:52:41 +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) 212ee12474
Filter requirements to build beforehand in install command
One more step so build() becomes only concerned with building.
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) 3ae13f7d28
Move is_wheel_installed to utils 2020-01-05 23:52:40 +01:00
Stéphane Bidoul (ACSONE) e45005f4bb
Filter requirements to build beforehand in wheel command
One more step so build() becomes only concerned with building.
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
Stéphane Bidoul (ACSONE) 4bdca1a09a
Remove now useless build_wheels function 2020-01-05 23:52:40 +01:00
Stéphane Bidoul (ACSONE) 10ff58d7be
Simplify install by calling build once
We filter what to build beforehand so we
can call build once. We then filter failures
to detect PEP 517 failures.
2020-01-05 23:52:38 +01:00
Stéphane Bidoul (ACSONE) 8601bb5d06
Make build_wheels return all failures
Check for PEP 517 build failures by
filtering failures.
2020-01-05 23:52:03 +01:00
Stéphane Bidoul (ACSONE) 8784fb419a
Make build_wheels return successes too
In preparation for moving the unpacking
out of WheelBuilder.build
2020-01-05 18:47:52 +01:00
Christopher Hunt b7ed044525
Merge pull request #7539 from chrahunt/refactor/get-dist-from-zip
Use wheelfile-based pkg_resources.Distribution for metadata
2020-01-06 01:24:13 +08: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
Chris Hunt 33043ba22f Use pkg_resources.Distribution derived from wheel directly
We now extract all metadata files from the wheel directly into memory
and make them available to the wrapping pkg_resources.Distribution via
the DictMetadata introduced earlier.
2020-01-05 10:57:14 -05:00
Chris Hunt ed65393840 Extract reading wheel file from wheel_metadata into separate function 2020-01-04 20:50:17 -05:00
Chris Hunt ae34781826 Parameterize wheel file path for metadata extraction 2020-01-04 20:50:17 -05:00
Chris Hunt 20706eb93f Add DictMetadata for adapting zip data to Distribution
pkg_resources.Distribution classes delegate to the IMetadataProvider
implementation provided at construction. This is the one we'll use for
adapting a ZipFile to pkg_resources.DistInfoDistribution.
2020-01-04 20:49:41 -05:00
Christopher Hunt c3ab0a0b13
Merge pull request #7552 from chrahunt/refactor/cleanup-wheel-install-tests
Make wheel install test packages more explicit
2020-01-05 08:46:07 +08:00
Chris Hunt b263fcc105 Move parse_wheel and supporting functions to utils.wheel
In order to parse metadata from wheel files directly we want to reuse
parse_wheel. Moving it out helps avoid creating an unnecessary
dependence on operations.install.wheel.
2020-01-04 23:11:51 +01:00
Chris Hunt b58205ea01 Use valid wheel for functional download tests
Previously we were copying an existing wheel to a file with a
different distribution name. When using stricter metadata parsing this
would fail, so now we use a more conformant dummy wheel function.
2020-01-04 23:08:43 +01:00
Xavier Fernandez c3ae86e85f
Merge pull request #7553 from chrahunt/refactor/cleanup-git-tests
Make _git_commit test helper args explicit
2020-01-04 23:06:13 +01:00
Chris Hunt b65bd4c31a Remove unused args parameter from _git_commit 2020-01-03 19:24:22 -05:00
Chris Hunt 5665b94a5b Make explicit argument for git commit -a 2020-01-03 19:21:36 -05:00
Chris Hunt f9bf1a7004 Make explicit argument for git commit --allow-empty 2020-01-03 19:19:18 -05:00
Chris Hunt 79eaf132fc Remove unnecessary expect_stderr from _git_commit
This simplifies our interface to git, which will make it easier to trade
out our subprocess-based invocations in the future.
2020-01-03 19:13:08 -05:00
Chris Hunt f5684ed7ae Use shared_data fixture in wheel install tests
shared_data avoids copying the entire data directory, so use it in cases
where we know pip won't have any opportunity to edit the data files
(where we're passing tmpdir for --find-links).
2020-01-03 18:25:02 -05:00
Chris Hunt d468da2796 Explicitly copy required packages to tmpdir for wheel install tests
Any test using --find-links data.packages is potentially using several
packages. By copying specifically the packages we need, we can more
easily see the packages that each test depends on and avoid using the
`data` fixture.
2020-01-03 18:23:48 -05:00
Chris Hunt 4e5d854456 Normalize --find-links argument format in wheel install tests 2020-01-03 17:58:40 -05:00
Chris Hunt 7af9371176 Remove redundant expect_error=False in tests
This is the default, so there is no need to specify it explicitly.
2020-01-03 14:25:36 +01:00
Pradyun Gedam 08f61a9b73
Do not attempt setup.py clean for failed pep517 builds (#7477) 2020-01-02 12:11:32 +00: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) c93acfb20b
Test legacy clean not attempt after PEP 517 build failure 2020-01-02 12:14:03 +01:00
Xavier Fernandez a71086eb9c
Merge pull request #7538 from chrahunt/refactor/get-metadata-from-zip
Read wheel metadata from wheel directly
2020-01-02 10:35:45 +01:00
Chris Hunt 2f92826081 Extract basic wheel parsing into separate function
This functions as a guard for the rest of our wheel-handling code,
ensuring that we will only get past this point if we have a wheel that
we should be able to handle version-wise.

We return a tuple instead of bundling up the result in a dedicated type
because it's the simplest option. The interface will be easy to update
later if the need arises.
2020-01-01 17:51:25 -05:00
Chris Hunt d5b4c15105 Remove dead code from wheel_metadata
Since we don't pass the source directory anymore, remove the tests
and implementation.
2020-01-01 17:51:24 -05:00
Chris Hunt a2af0f9468 Get WHEEL metadata from wheel file directly 2020-01-01 17:26:20 -05:00
Chris Hunt 2519e9740c Split try block in wheel_metadata
Makes it simpler to substitute in zip-derived WHEEL extraction.
2020-01-01 17:26:20 -05:00
Chris Hunt 62721eb5da Remove dead code
Since we don't pass the source dir anymore, we can simplify the tests
and implementation for wheel_dist_info_dir.
2020-01-01 17:26:20 -05:00
Chris Hunt cd5400ceb9 Determine .dist-info directory from wheel file directly
First example of transitioning a directory-aware function to using a
zipfile directly. Since we will not need to maintain the unpacked dir
going forward, we don't need to worry about making wheel_dist_info_dir
"generic", just that the same tests pass for both cases at each commit.

To do this neatly we use pytest.fixture(params=[...]), which
generates a test for each param. Once we've transitioned the
necessary functions we only need to replace the fixture name and remove
the dead code.
2020-01-01 17:26:20 -05:00
Chris Hunt 452acd5e76 Add files in .dist-info directory tests
Since zips don't typically contain directory entries, we want to
only operate on files. Adding files to the .dist-info tests means we
will be able to reuse them for both cases, while they coexist.
2020-01-01 17:26:20 -05:00
Chris Hunt 513a3162de Pass open zip file for wheel into install_unpacked_wheel
With this parameter we can incrementally update code to rely on the zip
file instead of the unpacked source directory.
2020-01-01 17:26:20 -05:00