Commit Graph

2054 Commits

Author SHA1 Message Date
ekristina 2e5b4461f4 Improve code reuse in TestSafeFileCache
Use a fixture creating a temporary directory for cache.
2019-05-04 17:11:44 -04:00
Chris Jerdonek fb2533a945 Revert "Error out if installing a pyproject.toml-style (PEP 517) project in editable mode."
This reverts commit cc2d299f76.
2019-04-26 20:19:24 -07:00
Chris Jerdonek 24688ee8e8 Revert "Require --no-use-pep517 if using editable mode with pyproject.toml."
This reverts commit 71f506e71e.
2019-04-26 20:19:05 -07:00
Chris Jerdonek 0453f79b9e Revert "Allow --no-use-pep517 to be used with editable mode in more cases."
This reverts commit f069769948.
2019-04-26 20:18:43 -07:00
Chris Jerdonek 60d3f11961
Merge pull request #6440 from nicolasbock/index_with_git
Protect `@` as safe character when cleaning URLs
2019-04-25 13:28:48 -07: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 f069769948 Allow --no-use-pep517 to be used with editable mode in more cases. 2019-04-25 01:42:11 -07:00
Chris Jerdonek dddd28b8de
Add CandidateEvaluator class to encapsulate sorting. (#6424) 2019-04-22 03:40:35 -07:00
Andy Freeland bb14ff42b0 Fix NameError when handling InvalidRequirement in install_req_from_req_string (#6419)
Previously, an InvalidRequirement would raise a NameError while trying
to raise an InstallationError because `req` was not defined.

Discovered while working on #6402.
2019-04-19 02:37:33 -07:00
johnthagen c8e9caa8a7 Add Subversion.get_vcs_version method (#6390)
Add Subversion.get_vcs_version method to return the version of the currently installed Subversion client.
2019-04-17 00:34:19 -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
Chris Jerdonek 78744e8071
Merge pull request #6370 from cjerdonek/editable-and-pep-517-optional
Fix editable-mode logic when pyproject.toml present
2019-04-06 15:31:53 -07:00
Miro Hrončok d4264dc3b2 Pytest: Use get_closest_marker
See https://github.com/pytest-dev/pytest/pull/4564
2019-04-04 13:07:49 +02:00
Chris Jerdonek 68bc0e0c53
Merge pull request #6339 from cjerdonek/vcs-subprocess-logging
Fix #1219: Prevent subprocess stdout and stderr from cluttering pip's stdout.
2019-04-03 14:36:44 -07:00
Pradyun Gedam 98fc29b36f
Merge pull request #6376 from cjerdonek/fix-typo-enable-test
Fix typo / enable test: "est_link_..." -> "test_link_..."
2019-04-02 23:05:03 +05:30
Chris Jerdonek f82d87a555 Enable test by fixing typo: "est_link_..." -> "test_link_..." 2019-04-02 05:39:11 -07:00
Chris Jerdonek 71f506e71e Require --no-use-pep517 if using editable mode with pyproject.toml. 2019-03-31 05:40:08 -07:00
Caleb Martinez ac9010e87c Allow adding a custom string to pip's User-Agent via an environment variable (#5550) 2019-03-31 02:37:02 -07:00
Chris Jerdonek 66ae68122f Disallow two more argument combinations, and test. 2019-03-26 20:34:23 -07:00
Chris Jerdonek ac18393df7 Make expect_stderr mean the weaker allow_stderr_warning. 2019-03-26 20:34:23 -07:00
Chris Jerdonek 9efd2933ab Remove logic for SSLContext warning on old versions of Python. 2019-03-26 20:34:19 -07:00
Chris Jerdonek 5b9065cf5a Make deprecated_python cause allow_stderr_warning not expect_stderr. 2019-03-26 20:32:49 -07:00
Chris Jerdonek e5353f27cd
Merge pull request #6356 from cjerdonek/vcs-class-methods-2
Make VersionControl methods into class methods (part 2)
2019-03-25 16:35:26 -07:00
Chris Jerdonek e0505bb152 Prevent subprocess stdout and stderr from cluttering pip's stdout. 2019-03-25 00:21:20 -07:00
Chris Jerdonek 55f7a712aa
Merge pull request #6331 from cjerdonek/issue-6314-editable-with-pep517
Show a nice error if editable mode is attempted with a pyproject.toml source tree
2019-03-23 17:32:22 -07:00
Chris Jerdonek 7a4e8b34da Make get_current_branch() a class method. 2019-03-22 00:04:55 -07:00
Chris Jerdonek 977d3f6f8c Make is_commit_id_equal() a class method. 2019-03-22 00:04:55 -07:00
Chris Jerdonek 31d6a4f975 Make resolve_revision() a class method. 2019-03-22 00:04:55 -07:00
Chris Jerdonek 79b64739a9 Make get_revision_sha() a class method. 2019-03-22 00:04:50 -07:00
Alex Loosley d245434c02 Fix #5889: AttributeError: 'NoneType' object has no attribute 'netloc' (#6336) 2019-03-20 16:59:24 +01:00
Chris Jerdonek d3a5b58af9
Merge pull request #6342 from cjerdonek/test-subprocess-stderr
Allow finer-grained testing of subprocess stderr.
2019-03-20 06:19:36 -07:00
Chris Jerdonek bb290e10f2 Address review comments, and add tests. 2019-03-20 02:08:37 -07:00
Chris Jerdonek 2e98d3975f Allow finer-grained testing of subprocess stderr. 2019-03-16 04:16:37 -07:00
Chris Jerdonek 4c5d712057 Change RevOptions to accept a VersionControl subclass. 2019-03-16 01:46:32 -07:00
Chris Jerdonek e1e94530ad Make VersionControl.make_rev_args() a class method. 2019-03-16 01:15:48 -07:00
Chris Jerdonek 3ba489864b Make VersionControl.get_url_rev_and_auth() a class method. 2019-03-16 01:13:25 -07:00
Chris Jerdonek 67b384b8c7 Make VersionControl.get_netloc_and_auth() a class method. 2019-03-16 01:04:44 -07:00
Chris Jerdonek 7f6edbd252
Merge pull request #6130 from cjerdonek/move-get-src-requirement-to-base-class
Move get_src_requirement() to the VersionControl base class
2019-03-14 15:22:54 -07:00
Chris Jerdonek cc2d299f76 Error out if installing a pyproject.toml-style (PEP 517) project in editable mode. 2019-03-14 05:49:39 -07:00
Pi Delport 5f3c56e188 Fix some typos 2019-03-12 21:54:18 +01:00
Chris Jerdonek 1599d65d36
Merge pull request #6312 from cjerdonek/subprocess-tests-and-spinner-fixes
Test call_subprocess more thoroughly; fix spinner edge cases
2019-03-11 23:19:58 -07:00
Steve Dower 293c91ee8a Configuration files may now also be stored under `sys.prefix` (#6268)
* Rename kinds.VENV to kinds.SITE and site_config_files to global_config_files
* Add tests for config file options
* Deprecate --venv in pip config
2019-03-07 11:14:56 +05:30
Chris Jerdonek fe793722b1 Fix a couple spinner edge cases. 2019-03-03 11:05:39 -08:00
Chris Jerdonek ffefa91f2f Improve the call_subprocess() tests. 2019-03-03 10:54:03 -08:00
Miro Hrončok d48475d008 Fix utils.encoding.auto_decode() LookupError with invalid encodings
utils.encoding.auto_decode() was broken when decoding Big Endian BOM
byte-strings on Little Endian or vice versa.

The TestEncoding.test_auto_decode_utf_16_le test was failing on Big Endian
systems, such as Fedora's s390x builders. A similar test, but with BE BOM
test_auto_decode_utf_16_be was added in order to reproduce this on a Little
Endian system (which is much easier to come by).

A regression test was added to check that all listed encodings in
utils.encoding.BOMS are valid.

Fixes https://github.com/pypa/pip/issues/6054
2019-03-01 20:16:18 +01:00
Chris Jerdonek 632896d70b Move make_vcs_requirement_url() to vcs/__init__.py. 2019-03-01 11:06:24 -08:00
Chris Jerdonek fdbfde03e1 Implement get_src_requirement() in the VersionControl base class. 2019-03-01 11:01:25 -08:00
Daniele Esposti 729404d4c5 Redact the password from the extra index URL in log messages (#6295) 2019-03-01 04:21:45 -08:00
Chris Jerdonek 1fdd7e26c5
Merge pull request #6139 from jelmer/bazaar-export-perf
Bazaar: Export directly from the remote branch.
2019-03-01 01:36:02 -08:00