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

2923 commits

Author SHA1 Message Date
Pradyun Gedam
a99190459e
Merge pull request #8817 from sbidoul/improve-git-checkout 2020-09-01 18:40:51 +05:30
Tzu-ping Chung
87d129a801 Replace custom URL parsing with url_to_path() 2020-09-01 15:43:58 +08:00
Stéphane Bidoul
3aa0c2ed91
Git fetch more aggressively
Before we were fetching only revisions starting with refs/.
Now we also fetch revisions that look like commit that we
don't have locally.
2020-08-30 11:52:06 +02:00
Tzu-ping Chung
8b2b92485c Include Requires-Python dep even with --no-deps 2020-08-26 09:49:25 +08:00
Pradyun Gedam
0b18e21cbe
Merge pull request #8752 from sbidoul/imp-8369-deprecation-sbi 2020-08-25 20:40:27 +05:30
Pradyun Gedam
b7075b9351
Merge pull request #8778 from hugovk/deprecate-3.5
Deprecate support for Python 3.5
2020-08-25 20:40:01 +05:30
Pradyun Gedam
e17f845475
Merge pull request #8522 from NoahGorny/fix-requirements-file-options
install: Update extra-index-url in session from requirements file
2020-08-25 15:08:11 +05:30
Hugo
e93257c080 Warn Python 3.5 support is deprecated and will be removed in pip 21.0, Jan 2021 2020-08-18 15:22:16 +03:00
Pradyun Gedam
a3fd4246af
Merge pull request #8709 from McSinyx/successfully-downloaded
[2020-resolver] List downloaded distributions before exiting
2020-08-17 17:22:17 +05:30
Stéphane Bidoul
4c348cf3a0
Consider success flag instead of absence of exception 2020-08-13 09:38:56 +02:00
Stéphane Bidoul
9c4a88b0a0
Improve deprecation message for issue 8368 2020-08-12 11:07:36 +02:00
b46576d933 Give batch downloader a separate class 2020-08-12 16:07:27 +07:00
a1aeb4ce01 Check download folder for files to be downloaded in batch 2020-08-12 16:02:28 +07:00
18c803a413 Check hashes of memoized downloads 2020-08-11 22:40:42 +07:00
39d296eeb8 Clean up code style and internal interface
Co-Authored-By: Pradyun Gedam <pradyunsg@gmail.com>
Co-Authored-By: Chris Hunt <chrahunt@gmail.com>
2020-08-11 22:40:39 +07:00
078e0effb7 Add memoization mechanism for file download
This is intentionally dependent from caching, which relies on cache dir.
2020-08-11 22:39:42 +07:00
e62f16e969 Make Downloader perform the download 2020-08-11 22:36:08 +07:00
Pradyun Gedam
8eea660e03
Merge pull request #8744 from hroncok/keyring_global_nope
When one keyring attempt fails, don't bother with more
2020-08-11 15:41:02 +05:30
Pradyun Gedam
4c7bbdb4e4
Merge pull request #8702 from uranusjr/get-distribution-looks-for-all 2020-08-10 20:30:55 +05:30
Pradyun Gedam
e8f52198a9
Merge pull request #8718 from uranusjr/pyvenv-cfg-encoding
Always use UTF-8 to read pyvenv.cfg
2020-08-07 15:11:32 +05:30
Tzu-ping Chung
4683ad02e3 Allow filtering constraints with markers 2020-08-07 13:55:38 +08:00
Noah Gorny
aae63795b2 reqfile: Update extra-index-url/index-url in session from requirements file
Also update the relevant tests
2020-08-06 19:25:31 +03:00
11f7994a66 Revise method fetching metadata using lazy wheels
* Rename it to fit the fact that it no longer handle
  fetching _not_ using lazy wheels
* Use self as the first parameter
* Unnest the checks with additional logs showing reason
  when lazy wheel is not used
2020-08-06 18:43:02 +07:00
487d00295c Define RequirementPreparer._session 2020-08-06 18:42:59 +07:00
4f210f3608 [2020-resolver] List downloaded distributions before exiting
This unifies the behavior of pip download for both legacy and new
resolvers.  InstallRequirement.successfully_download is no longer needed
for this task and is thus retired.
2020-08-06 16:52:31 +07:00
Tzu-ping Chung
810385b971 Always use UTF-8 to read pyvenv.cfg 2020-08-06 11:46:46 +08:00
ffd6a38646 Disable caching for range requests 2020-08-05 22:19:49 +07:00
Tzu-ping Chung
c04182893a Work around lax semantics in commands.search 2020-08-05 04:56:00 +08:00
Tzu-ping Chung
8491ce7723 Refactor and clarify get_distribution() behavior
The call to get_installed_distributions() now passes all flags
excplicitly so they are more obvious and less likely to be misunderstood
in the future. The behavior also documented in the function docstring.

The search_distribution() helper function is renamed with a leading
underscore to make it clear that it is intended as a helper function to
get_distribution().
2020-08-05 03:07:07 +08:00
Tzu-ping Chung
e459763d81 Also look for non-local when searching for dists
This matches the behavior of pkg_resources.get_distribution(), which
this function intends to replace.
2020-08-05 03:07:07 +08:00
Pradyun Gedam
ee4371c386
Merge pull request #8685 from chrahunt/use-preparer-for-lazy-wheels 2020-08-04 18:46:56 +05:30
Pradyun Gedam
e7357c71cd
Merge pull request #8681 from McSinyx/faster-deps
[fast-deps] Make range requests closer to chunk size
2020-08-04 07:38:48 +05:30
Pradyun Gedam
70768de0a8
Merge pull request #8684 from uranusjr/zipfile-unicode-path-python2 2020-08-04 06:50:38 +05:30
Pradyun Gedam
0c48ec0696
Merge pull request #8679 from pradyunsg/tweak-resolutionimpossible-message 2020-08-04 06:49:10 +05:30
Pradyun Gedam
4fa31d509f
Merge pull request #8678 from uranusjr/new-resolver-no-deps-extras-install-self 2020-08-04 06:48:11 +05:30
d98ff19c27 [fast-deps] Make range requests closer to chunk size 2020-08-03 21:49:58 +07:00
Miro Hrončok
ba062c3ed0 When one keyring attempt fails, don't bother with more
This makes https://github.com/pypa/pip/issues/8090 much less painful.
2020-08-03 12:34:26 +02:00
Tzu-ping Chung
a12e2f1479 PEP 427 mandates UTF-8, we don't need the fallback 2020-08-03 15:00:58 +08:00
Tzu-ping Chung
d4995cb89e Implement heuristics to get non-ASCII ZIP entries 2020-08-03 09:29:19 +08:00
Chris Hunt
8b838ebb89 Prepare lazy wheels more so they are downloaded
This keeps all knowledge about preparation and types of requirements in
`RequirementPreparer`, so there's one place to look when we're ready to
start breaking it apart later.
2020-08-02 19:36:29 -04:00
Chris Hunt
c7ade159d4 Pass link to _fetch_metadata instead of req
Removes dependence on `InstallRequirement`.
2020-08-02 19:36:29 -04:00
Chris Hunt
21db4f3096 Log in one common location
Reduces dependence on `InstallRequirement` being passed to
`_fetch_metadata`.
2020-08-02 19:36:29 -04:00
Chris Hunt
6c4d4f3b78 Move _fetch_metadata to RequirementPreparer
The fact that all of this functionality can be put in terms of the
`RequirementPreparer` indicates that, at least at this point, this is
the cleanest place to put this functionality.
2020-08-02 19:36:29 -04:00
Chris Hunt
4e1bff741d Promote Wheel-related assertions to LinkCandidate constructor
These are things we know will be true because of the existing wheel
processing. In the future we may delegate the extraction of these to the
LinkCandidate itself so it doesn't have to be an assertion.
2020-08-02 19:36:28 -04:00
Chris Hunt
9e463916d0 Extract name and version from Wheel link
We happen to know that this is the same treatment that gave us `_name`
and `_version` for Wheels in the first place (in `LinkEvaluator`). It's not
ideal, however the metadata consistency check that occurs in `Candidate`
after creation of a `Distribution` guards us against any deviation in
the name and version during our processing.

Reduces dependence on Candidate.
2020-08-02 19:36:14 -04:00
Chris Hunt
defbf82a8f Use link from InstallRequirement
Since when we generate the InstallRequirement we set the link, these
must be the same.

Reduces dependence on Candidate.
2020-08-02 18:40:11 -04:00
Chris Hunt
f4603078cf Pass InstallRequirement to _fetch_metadata
Reduces dependence on Candidate.
2020-08-02 18:40:11 -04:00
Chris Hunt
f0d4df10eb Propagate lazy_wheel option through RequirementPreparer
Reduces dependence on Candidate (and Resolver (and Factory)).
2020-08-02 18:40:11 -04:00
Chris Hunt
e49dcfdc35 Move lazy_wheel warning out of Resolver
This warning just needs to be traced in one place for all commands,
there's no need for the resolver to know about it. Moving the warning
out of the Resolver will make it easier to change how we provide the
option.
2020-08-02 18:40:11 -04:00
Chris Hunt
45ab317610 Move call to _fetch_metadata next to call to RequirementPreparer
Since wheels can't be editable, we can move this into LinkCandidate,
closer to `RequirementPreparer.prepare_linked_requirement` into which we
want to integrate `_fetch_metadata`.
2020-08-02 18:40:11 -04:00
Chris Hunt
ec5b6d7b80 Remove extra metadata consistency check
Instead of an early return, we fall through to the existing check at the
end of this function. This aligns our treatment of `_fetch_metadata` and
`_prepare_distribution`.
2020-08-02 18:40:11 -04:00
Chris Hunt
a72d04f734 Move common processing out of _fetch_metadata
Returning a `Distribution` makes `_fetch_metadata` look more like
`_prepare_distribution`, in preparation for moving it there next.
2020-08-02 18:40:11 -04:00
Chris Hunt
8c3c0ade78 Move _fetch_metadata into _prepare
Since `_prepare` is called in two places, we preserve the
`if self._dist is not None` protection above the new call to
`_fetch_metadata`. The second `if` in `_prepare` handles the early
return required when processing a lazy wheel.
2020-08-02 18:40:09 -04:00
Chris Hunt
4d94ae4c40 Move non-lazy req fallback outside of _fetch_metadata
No change in behavior, we just want to unify "requirements processing"
and moving this function out is a prereq for moving `_fetch_metadata` in.
2020-08-02 18:39:57 -04:00
Chris Hunt
7a5e043776 Remove unnecessary check for _dist
Since `_prepare` now internally validates that `_dist` isn't set, we
don't need to.
2020-08-02 18:39:15 -04:00
Chris Hunt
7289625734 Remove redundant guard variable
Now that `_dist` is only set on success, we can use it to guard against
repeated execution instead of `_prepared`. As a result there are now only
two possible outcomes for calling `dist`:

1. `_dist` set and returned - lazy and non-lazy req
2. `_dist` not set and exception raised - bad lazy or bad non-lazy req
2020-08-02 18:38:13 -04:00
Chris Hunt
d957cc94c8 Don't set _dist until it has been validated
Previously a call to `_fetch_metadata` could result in several possible
outcomes:

1. `_dist` set, `_provided` not set, dist returned - for lazy wheels
2. `_dist` set, `_provided` not set, exception - for bad lazy wheels
3. `_dist` not set, `_provided` not set, exception - for non-lazy req
   exceptions
4. `_dist` set, `_provided` not set, exception - for bad non-lazy reqs
5. `_dist` set, `_provided` set, dist returned - for non-lazy reqs

and probably more.

Our intent is to use `_dist` being set as the indicator of "this
requirement has been fully processed successfully" and discard
`_prepared`, since we don't actually rely on any of the other states
(they simply lead to a failure or in the future a retry).
2020-08-02 18:37:50 -04:00
Tzu-ping Chung
32b5e43c79 Flip the flag with another name 2020-08-03 05:28:10 +08:00
Chris Hunt
89d8cba55b
Merge pull request #8629 from McSinyx/abstract-abstract
Abstract away AbstractDistribution in higher-level resolver code
2020-08-02 14:41:24 -04:00
Pradyun Gedam
7e6ff08aae
Merge pull request #8656 from chrahunt/gracefully-handle-bad-data-paths
Trace a better error message on installation failure due to invalid .data files in wheels
2020-08-02 19:55:40 +05:30
Tzu-ping Chung
3ce63a62d7 Ask candidates for dependencies even on --no-deps
ExtrasCandidate need to provide one dependency on the non-extra-ed self.
2020-08-02 16:12:46 +08:00
Pradyun Gedam
c412613efe
Tweak ResolutionImpossible error line
This makes it more consistent with how error "summary" lines look.

eg:
     IndexError: list index out of range
      ModuleNotFoundError: No module named 'notamodule'
2020-08-02 07:55:49 +05:30
Pradyun Gedam
b97c199cf7
Point to latest documentation
This allows us to update the content users would see as we get feedback.
2020-08-02 07:53:02 +05:30
Pradyun Gedam
e51a027964
Merge pull request #8659 from uranusjr/fix-get-distribution-dot-in-name
Canonicalize name in check_if_exists
2020-08-02 07:44:24 +05:30
e48a0cb7cb Remove no-longer-used messages 2020-08-01 20:26:44 +07:00
Tzu-ping Chung
c3e1a153fd Improve SVN version parser
SVN has multiple distributions on Windows, e.g. SlikSVN, CollabNet. Some
of them suffix the version with a "-{distro}" part, which causes the
previous implementation to fail.

This patch removes that final part and make the version logic work.
2020-07-31 06:38:43 +08:00
Tzu-ping Chung
1fd5098b24 Canonicalize name in check_if_exists
The previous implementation uses pkg_resources.get_distribution(), which
does not canonicalize the package name correctly, and fails when
combined with pip's own get_distribution(), which does canonicalize
names. This makes InstallRequirement.check_if_exists() only use pip's
own canonicalization logic so different package name forms are matched
as expected.
2020-07-30 22:04:51 +08:00
Chris Hunt
3f9b326c11 Provide a reasonable error on invalid scheme keys
Originally we would throw an `AttributeError` if a bad scheme key was
used. After refactoring we would throw a `KeyError`, which isn't much
better. Now we call out the wheel being processed, scheme key we didn't
recognize, and provide a list of the valid scheme keys. This would
likely be useful for people developing/testing the wheel.
2020-07-29 22:24:09 -04:00
Chris Hunt
864f0e0efa Explicitly handle incorrect .data paths during wheel install
Previously our wheel installation process allowed wheels which contained
non-conforming contents in a contained .data directory.

After the refactoring to enable direct-from-wheel installation, pip
throws an exception when encountering these wheels, but does not include
any helpful information to pinpoint the cause.

Now if we encounter such a wheel, we trace an error that includes the
name of the requirement we're trying to install, the path to the wheel
file, the path we didn't understand, and a hint about what we expect.
2020-07-29 18:12:16 -04:00
Pradyun Gedam
31299ee370
Merge pull request #8603 from tekumara/pip-list-ignore-require-venv 2020-07-29 09:28:58 +05:30
Pradyun Gedam
a28081c28e
Bump for development 2020-07-29 07:53:18 +05:30
Pradyun Gedam
127acd8c9e
Bump for release 2020-07-29 07:53:17 +05:30
Pradyun Gedam
a8edffda1c
Merge pull request #8594 from pradyunsg/improve-install-conflict-warning 2020-07-28 18:22:53 +05:30
Pradyun Gedam
9033824cbc
Python 2 *sigh* 2020-07-28 11:24:44 +05:30
2439d80a83 Allow specifying verbose/quiet level via config file and env var 2020-07-28 10:11:18 +07:00
Pradyun Gedam
1b2ae22e7b
Don't print that form link after the end of month. 2020-07-27 19:51:40 +05:30
Pradyun Gedam
4e4951066d
Reverse if statement's condition 2020-07-27 13:52:54 +05:30
Pradyun Gedam
8db354260a
Move the form link to make the linter happy 2020-07-27 13:49:21 +05:30
Pradyun Gedam
efdb66ed16
Add messaging variation based on "new resolver" usage 2020-07-27 13:49:21 +05:30
Pradyun Gedam
42c62a08f7
Short circuit when there's nothing to report 2020-07-27 13:49:20 +05:30
Pradyun Gedam
d77b5c234c
Refactor the logging calls into a dedicated loop 2020-07-27 13:49:11 +05:30
Pradyun Gedam
7056132f6f
Merge pull request #8601 from rouge8/use-feature-requirements-file 2020-07-27 13:19:51 +05:30
b795c9a7d6 Abstract away AbstractDistribution in higher-level resolver code 2020-07-26 17:13:04 +07:00
Tzu-ping Chung
3ff9ee151d Account for comes_from string 2020-07-26 15:59:42 +08:00
Stéphane Bidoul
38fe3c2f14
Percolate --use-feature from req file upwards
We explicitly propagate --use-feature options from req files upwards.
This is not strictly necessary for the option to be enabled, because
of the default value is a global list, but that implicit behaviour is
certainly accidental, so we make it explicit, with a test.
2020-07-25 11:14:04 +02:00
Pradyun Gedam
89a51a6fef
Merge pull request #8588 from McSinyx/fast-deps
Use lazy wheel to obtain dep info for new resolver
2020-07-24 09:01:56 +05:30
Pradyun Gedam
43485f5ab7
Merge pull request #8617 from pradyunsg/drop-final-20.2-deprecation
Reject setup.py projects that don't generate .egg-info
2020-07-24 08:54:16 +05:30
Pradyun Gedam
3c20d5bfbd
Reject setup.py projects that don't generate .egg-info
This finalizes a deprecation, since we've not recieved any reports from
users in responses to the deprecation.
2020-07-23 22:32:46 +05:30
Pradyun Gedam
dcfea6ee8f
Really? Wow.
This is a fix for the sole failing test in the CI for these changes (in
tests/functional/test_debug.py::test_debug__library_versions). The
failure took me a fair bit of time to diagnose, but it looks like the
issue is that we're strictly comparing versions as strings. This is a
bad idea when they're not normalized.
2020-07-22 19:57:20 +05:30
Pradyun Gedam
4272aa7980
Upgrade toml to 0.10.1 2020-07-22 19:57:20 +05:30
Pradyun Gedam
afa59d97f6
Upgrade six to 1.15.0 2020-07-22 19:57:19 +05:30
Pradyun Gedam
072b70b9bf
Upgrade urllib3 to 1.25.9 2020-07-22 19:57:19 +05:30
Pradyun Gedam
fe7128c662
Upgrade idna to 2.10 2020-07-22 19:57:19 +05:30
Pradyun Gedam
2ac80f4336
Upgrade certifi to 2020.6.20 2020-07-22 19:57:19 +05:30
Pradyun Gedam
28aad200b3
Upgrade requests to 2.24.0 2020-07-22 19:57:19 +05:30
Pradyun Gedam
413968dd17
Upgrade packaging to 20.4 2020-07-22 19:57:19 +05:30
Pradyun Gedam
e84d0c1813
Upgrade html5lib to 1.1
Also, drop the no-longer-necessary patch.
2020-07-22 19:57:18 +05:30
Pradyun Gedam
11a64cdae8
Upgrade distlib to 0.3.1 2020-07-22 19:57:18 +05:30
Pradyun Gedam
b9b2c18735
Upgrade appdirs to 1.4.4 2020-07-22 19:57:18 +05:30
5d15291274 Use lazy wheel to obtain dep info for new resolver 2020-07-21 16:00:34 +07:00