Commit Graph

116 Commits

Author SHA1 Message Date
Chris Jerdonek 4a9e306678 Add get_applicable_candidates(), and test. 2019-07-07 14:35:56 -07:00
Chris Jerdonek b2389bf8c7 Add CandidatePreferences and PackageFinder.make_candidate_evaluator(). 2019-07-07 14:35:50 -07:00
Chris Jerdonek 9d3d369834 Simplify FoundCandidates. 2019-07-06 01:08:51 -07:00
Chris Jerdonek 979c8405d2 Add LinkEvaluator class. 2019-07-04 16:54:29 -07:00
Chris Jerdonek ba2c382511
Merge pull request #6660 from cjerdonek/rename-egg-info-matches
Rename _egg_info_matches()
2019-06-30 15:00:49 -07:00
Chris Jerdonek 2f1be4e6ec Rename index.py's _egg_info_matches(egg_info, canonical_name). 2019-06-30 12:51:09 -07:00
Chris Jerdonek ae79b5bf5c Add a SelectionPreferences class. 2019-06-28 11:14:55 -07:00
Chris Jerdonek d3b3f16871 Support yanked reasons with non-ascii characters. 2019-06-27 22:53:58 -07:00
Chris Jerdonek 8af3f21a57 Filter out yanked links earlier when allow_yanked=False. 2019-06-27 19:50:25 -07:00
Chris Jerdonek a447be4785 Update PackageFinder to support "yanked" files (PEP 592). 2019-06-26 02:32:40 -07:00
Chris Jerdonek 8666bb1a5d Start parsing the "data-yanked" attribute. 2019-06-25 03:34:42 -07:00
Chris Jerdonek cab7316e2b Change PackageFinder.create() to accept a SearchScope object. 2019-06-21 14:41:49 -07:00
Chris Jerdonek 7d08bb37a5 Add SearchScope class. 2019-06-18 00:47:10 -07:00
Chris Jerdonek c0bda1b906 Log when adding a trusted host from a file. 2019-06-14 01:14:36 -07:00
Chris Jerdonek d72758394d Fully support --trusted-host inside requirements files. 2019-06-13 01:21:05 -07:00
Chris Jerdonek 4c1ccaec73 Store PackageFinder.trusted_hosts instead of secure_origins. 2019-06-12 02:18:23 -07:00
Chris Jerdonek b8d693c71e Add a TargetPython class. 2019-06-11 18:19:20 -07:00
Chris Jerdonek 8dbf88dff7 Update pip-download to respect --python-version. 2019-06-06 13:20:29 -07:00
Chris Jerdonek 99228e503a Import path_to_url() from utils/misc.py instead of download.py. 2019-06-03 02:31:40 -07:00
Chris Jerdonek ce46f8524e
Merge pull request #6545 from cjerdonek/vcs-imports
Remove from pip/_internal/__init__.py the vcs module imports
2019-06-03 02:10:43 -07:00
Chris Jerdonek 5c89643d3d Remove importing from vcs in pip/_internal/__init__.py.
This also renames the current vcs/__init__.py to vcs/versioncontrol.py.
2019-06-03 01:18:36 -07:00
Chris Jerdonek 798d814629 Change PackageFinder to use Tuple[int, ...] instead of List[str] for --python-version. 2019-05-28 03:05:14 -07:00
Chris Jerdonek a9a9cfd98c Improve the debug log message when installing an incompatible wheel. 2019-05-25 23:59:32 -07:00
Chris Jerdonek f82ea77217 Simplify the _check_dist_requires_python() call site. 2019-05-24 21:33:12 -07:00
Chris Jerdonek eeb74aeb29
Merge pull request #6518 from cjerdonek/issue-6371-ignore-requires-python
Fix #6371: make pip install respect --ignore-requires-python
2019-05-22 22:38:20 -07:00
Chris Jerdonek ad2b07898d Fix pip-install to respect --ignore-requires-python. 2019-05-22 21:34:41 -07:00
Andreas Lutro 9eccfae10d redact passwords in output when using --find-links (#6489) 2019-05-22 23:33:41 +02:00
Chris Jerdonek 7e142bae64 Refactor out _check_link_requires_python(), and test. 2019-05-22 09:07:14 -07:00
Chris Jerdonek 4f26eba472 Add CandidateEvaluator.make_found_candidates(). 2019-05-19 13:18:43 -07:00
Chris Jerdonek 7995e2d5a9 Move get_install_candidate() to PackageFinder. 2019-05-19 11:03:47 -07:00
Chris Jerdonek 33959b02d3 Use try-else inside _evaluate_link(). 2019-05-19 09:59:06 -07:00
Chris Jerdonek 1875a8e3f6
Merge pull request #6511 from cjerdonek/package-finder-create-function
Simplify PackageFinder's constructor by accepting a CandidateEvaluator
2019-05-19 09:39:32 -07:00
Chris Jerdonek 10ae49d932 Add py_version_info to CandidateEvaluator's constructor. 2019-05-18 22:40:08 +02:00
Chris Jerdonek cad71a7117 Add PackageFinder.create(), and simplify PackageFinder(). 2019-05-17 11:55:21 -07:00
Chris Jerdonek c54e50f50b Simplify CandidateEvaluator.evaluate_link(). 2019-05-12 15:21:14 -04:00
Chris Jerdonek 3a2a28aeb7 Fix typo. 2019-05-08 19:34:43 -04:00
Chris Jerdonek 5be4e1481e Remove utils/packaging.py's dependence on the current environment. 2019-05-07 21:51:39 -04:00
Chris Jerdonek 10c68e674b Rename _link_package_versions() to evaluate_link(). 2019-05-07 11:54:28 -04:00
Chris Jerdonek 651d6fe705 Move _link_package_versions() to CandidateEvaluator. 2019-05-07 11:46:08 -04:00
Chris Jerdonek 58ee598b03 Refine return type of _package_versions() and find_all_candidates(). 2019-05-07 11:46:08 -04:00
Nicolas Bock 265b4e7e65
Protect `@` as safe character when cleaning URLs
Remote URLs that contain a link to a git repository and a tag
reference will have the `@` character converted into `%40`. This is
incorrect.

Fixes: #6437

Signed-off-by: Nicolas Bock <nicolasbock@gmail.com>
2019-04-25 06:26:04 -06:00
Chris Jerdonek dddd28b8de
Add CandidateEvaluator class to encapsulate sorting. (#6424) 2019-04-22 03:40:35 -07:00
Tzu-ping Chung 1ef8857b4d Finder found candidates cleanup (#6415) 2019-04-20 01:22:46 -07:00
Tzu-ping Chung 14cb4f4fb6 Isolate, reuse PackageFinder best candidate logic (#5971)
Split out how PackageFinder finds the best candidate, and reuse it in the
self version check, to avoid the latter duplicating (and incorrectly
implementing) the same logic.
2019-04-16 16:46:25 -07:00
Nicolas Bock 913757cb53
Do not clean base_url
When the `base_url` is a `[]` protected IPv6 address, the
`_clean_link()` function converts `[` to `%5B` and `]` to `%5D`, which
renders the `base_url` invalid. For example:

```
	Starting new HTTP connection (1): fd00:0:0:236:💯8181
	http://fd00:0:0:236:💯8181 "GET /os-releases/19.0.0.0b1/opensuse_leap-42.3-x86_64/requirements_absolute_requirements.txt HTTP/1.1" 200 None
	Setting setuptools==40.6.3 (from -c http://[fd00:0:0:236::100]:8181/os-releases/19.0.0.0b1/opensuse_leap-42.3-x86_64/requirements_absolute_requirements.txt (line 204)) extras to: ()
	Looking in indexes: http://[fd00:0:0:236::100]:8181/simple
	Collecting setuptools==40.6.3 (from -c http://[fd00:0:0:236::100]:8181/os-releases/19.0.0.0b1/opensuse_leap-42.3-x86_64/requirements_absolute_requirements.txt (line 204))
	  1 location(s) to search for versions of setuptools:
	  * http://[fd00:0:0:236::100]:8181/simple/setuptools/
	  Getting page http://[fd00:0:0:236::100]:8181/simple/setuptools/
	  http://fd00:0:0:236:💯8181 "GET /simple/setuptools/ HTTP/1.1" 200 376
	  Analyzing links from page http://[fd00:0:0:236::100]:8181/simple/setuptools/
	    _package_versions: link = http://%5bfd00:0:0:236::100%5d:8181/packages/opensuse_leap-42.3-x86_64/setuptools/setuptools-40.6.3-py2.py3-none-any.whl#md5=389d3cd088d7afec3a1133b1d8e15df0 (from http://[fd00:0:0:
	236::100]:8181/simple/setuptools/)
	    _link_package_versions: link = http://%5bfd00:0:0:236::100%5d:8181/packages/opensuse_leap-42.3-x86_64/setuptools/setuptools-40.6.3-py2.py3-none-any.whl#md5=389d3cd088d7afec3a1133b1d8e15df0 (from http://[fd00
	:0:0:236::100]:8181/simple/setuptools/)
	    Found link http://%5bfd00:0:0:236::100%5d:8181/packages/opensuse_leap-42.3-x86_64/setuptools/setuptools-40.6.3-py2.py3-none-any.whl#md5=389d3cd088d7afec3a1133b1d8e15df0 (from http://[fd00:0:0:236::100]:8181/
	simple/setuptools/), version: 40.6.3
	  Using version 40.6.3 (newest of versions: 40.6.3)
        Could not install packages due to an EnvironmentError.
        InvalidURL: Failed to parse: %5bfd00:0:0:236::100%5d:8181
```

This change uses the vendored `urllib` library to split the host part
off of the url before URL quoting only the path part.

Fixes: #6285
Signed-off-by: Nicolas Bock <nicolasbock@gmail.com>
2019-04-07 05:57:03 -06:00
Clark Boylan 63ccc286a0 Consistently catch exceptions in index.py
In index.py we were catching requests.exceptions.RetryError and
requests.exceptions.SSLError but then also caught requests.HTTPError.
For consistency catch all of these requests exceptions using the
requests.exceptions path.
2019-04-03 11:49:07 -07:00
Pi Delport 5f3c56e188 Fix some typos 2019-03-12 21:54:18 +01:00
Daniele Esposti 729404d4c5 Redact the password from the extra index URL in log messages (#6295) 2019-03-01 04:21:45 -08:00
Maxim Kurnikov 7977443556 remove unused exc variable 2019-02-22 14:17:49 +03:00
Maxim Kurnikov f77b8ca051 remove #noqa: F401 2019-02-22 14:17:07 +03:00