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

1342 commits

Author SHA1 Message Date
Chris Hunt 40bc4ea8fe Move network unit tests to align with subpackage names 2020-02-23 16:22:30 -05:00
Christopher Hunt 40523794d8
Merge pull request #7747 from pfmoore/parsed_requirement
Refactor parse_requirements to be independent of InstallRequirement
2020-02-24 00:21:28 +08:00
Anudit Nagar 082c0f01d2
Update old-style formatting to new-style formatting (#7762) 2020-02-21 21:48:14 +05:30
Nitesh Sharma ce1e0f470a
Move UI helpers to cli subpackage (#6727) 2020-02-21 14:01:13 +05:30
Paul Moore f085bb0e0e Merge branch 'master' into parsed_requirement 2020-02-14 20:34:44 +00:00
Paul Moore aac5d821f9 Move make_requirement to pip._internal.req.constructors (and rename it) 2020-02-14 12:22:50 +00:00
Paul Moore 90e4eb3eed Make parse_requirements return a ParsedRequirement 2020-02-14 11:52:53 +00:00
Pradyun Gedam cdae7277ef
Merge pull request #7596 from uranusjr/6446-link-url-quoting
Fix incorrect quoting Link.url
2020-02-14 16:00:43 +05:30
Paul Moore e2a57fd1e6 Refactor to reduce coupling.
* Make ParsedLine record the type of line
* Split handle_line to allow passing arguments only where needed
* Remove unneeded attributes from ParsedRequirement
2020-02-14 09:56:42 +00:00
Paul Moore f2e49b3946 Use a new ParsedRequirement class to communicate between handle_line and parse_requirements 2020-02-13 10:39:17 +00:00
Paul Moore 6f154f5546
Merge pull request #7707 from pfmoore/refactor_options
Pass individual options to InstallRequirement rather than an options object
2020-02-07 14:22:10 +00:00
Paul Moore a9f1d8562b Pass individual options to InstallRequirement rather than an options object 2020-02-06 16:05:11 +00:00
Chris Hunt e7998a3617 Rename populate_requirement_set to get_requirements 2020-02-05 22:30:07 -05:00
Chris Hunt de5ec7e884 Remove unused requirement_set argument 2020-02-05 22:30:07 -05:00
Chris Hunt 9c58aa7eb5 Do not use InstallRequirement in warn_deprecated_install_options
This only needed a list of requirements, so give it just that.
2020-02-05 22:30:07 -05:00
Chris Hunt fd815bc1fa Pass in a plain list of InstallRequirement to Resolver.resolve
Further simplifies the Resolver interface, and will give us the
opportunity to remove any knowledge of RequirementSet from the
individual commands.
2020-02-05 22:30:05 -05:00
Chris Hunt 550ae907bd Parameterize check_supported_wheels to Resolver.resolve
This reduces our dependence on the input RequirementSet.
2020-02-05 22:29:46 -05:00
Chris Hunt 58c06299db Return a different RequirementSet from Resolver.resolve
This makes the resolver interface simpler by returning a brand new
RequirementSet vs mutating the one that was input to the function, and
will let us specialize RequirementSet for the different use cases.
2020-02-05 22:29:30 -05:00
Chris Hunt 8197a4bbc5 Do not write delete marker file to track source_dir delete preference
Previously we were writing a delete marker file which is checked in
InstallRequirement.remove_temporary_source which is only invoked if the
user did not pass --no-clean (and a PreviousBuildDirError was not
raised). Since our TempDirectory machinery now respects these conditions
we can just wrap our source directory in that instead of using this
ad-hoc mechanism for tracking our delete preference.

This will let us clean up a lot of dead code that only existed for this
use case.
2020-02-05 20:14:44 -05:00
Chris Hunt b8c0d0175d Do not test unpack_http_url or unpack_file_url
The tests for unpack_{file,http}_url relies on these functions to both
retrieve and unpack. We want to move unpacking out, so call unpack_url
instead.
2020-02-04 21:49:40 -05:00
Chris Hunt 39d1c51fdb Globally-manage BuildEnvironment._temp_dir 2020-02-04 20:32:27 -05:00
Chris Hunt f2af7df453 Use tempdir_registry to control auto-deleted files globally
Next we can actually transition some files to be globally-managed that
are only deleted conditionally.
2020-01-29 23:04:26 -05:00
Chris Hunt 45991bcc1e Use explicit default value for TempDirectory delete flag
Now we can opt-in to globally-managed + globally-configured file
deletion for pre-existing directories by passing an explicit `None`.
2020-01-29 23:04:14 -05:00
Christopher Hunt f1cd4cb48e
Merge pull request #7608 from uranusjr/global-cleanup
Delay TempDirectory.delete resolution to cleanup
2020-01-22 18:25:05 +08: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
Tzu-ping Chung 35377c995c Add test for tempdir registry lazy eval 2020-01-19 18:22:14 +07:00
Pradyun Gedam f1cf84e2f8
Merge pull request #7542 from sbidoul/normalize-cache-dir-sbi
Eagerly normalize cache directory
2020-01-18 22:38:59 +05:30
Tzu-ping Chung cdd7821d92 Fix incorrect quoting Link.url
Cherry-picked manually from atugushev:fix-issue-6446.

Co-Authored-By: Albert Tugushev <albert@tugushev.ru>
2020-01-14 16:12:11 +08:00
Pradyun Gedam b411cdbdf5
Azure Pipelines: Test Windows on Python 3.8 (#7320) 2020-01-13 12:33:43 +00:00
Chris Hunt 8d92e40c1f Use USERPROFILE in expanduser test
In Python 3.8, expanduser on Windows no longer respects HOME, per
https://bugs.python.org/issue36264.
2020-01-12 19:44:43 -05:00
Chris Hunt 0a57e4e9f2 Manage temp directory deletion centrally
This gives us a global toggle that we can use to control whether
temporary directories get deleted from one place (ideally, in the
commands taking --no-clean).
2020-01-10 11:08:05 +01:00
Stéphane Bidoul (ACSONE) 8ce0859012
Remove redundant expanduser in WheelCache
Path normalization, which includes expanduser is now
done eagerly. Assert this when initializing
WheelCache.
2020-01-08 08:02:29 +01:00
Chris Hunt 896317d13d Remove unused abi functions
Previously, these were used when the user did not provide an explicit
ABI. Now this is handled internally in `packaging.tags` (by
`_cpython_abi` and `_generic_abi`).
2020-01-07 19:01:05 -05:00
Chris Hunt 7aaa705c15 Remove unused glibc functions
The remaining glibc-related functions are required to allow us to put
the libc version in the pip user agent (for stats).
2020-01-07 19:01:00 -05:00
Chris Hunt 2455977bc8 Remove unused manylinux auto-deduction functions 2020-01-07 19:00:55 -05:00
Chris Hunt 5dbef5debe Use packaging.tags.cpython_tags
We assume this function improves the status quo over the current
`_cpython_tags`, so we use it when no arguments need to be customized.

Since `packaging.tags` has its own tests and derives defaults
differently than pep425tags, we also remove the applicable tests that
were testing against the result of a plain call to
`pep425tags.get_supported()`.
2020-01-07 18:59:44 -05:00
Chris Hunt 4659a78935 Use packaging.tags.compatible_tags
We assume this function improves on our existing behavior, so use it
as-is. We will customize the arguments over the next few commits.

Since packaging.tags internally calculates platforms when not provided,
we skip the tests which patch functions assuming that manylinux
compatibility determination depends on them.
2020-01-07 18:55:26 -05:00
Pradyun Gedam ea27521359
Custom optparse.Option type that calls expanduser (#7534) 2020-01-07 12:26:38 +00:00
Chris Hunt 58f175fdf2 Remove unused format_tag
Since we delegate tag formatting to packaging.tags.Tag, we don't need
this function or its tests.
2020-01-07 01:42:42 -05:00
Chris Hunt 80b2c82d0c Use packaging.tags.Tag in place of Tuple
This is the standard type used by packaging.tags. Making this change
throughout the code lets us start switching over to using its
tag-generating functions in get_supported().

We also get rid of a test, since it was superseded by `__str__` in
packaging.tags.Tag.
2020-01-07 01:42:42 -05:00
Chris Hunt 893faa9e44 Replace get_abbr_impl with interpreter_name
This reduces the amount of code we have to manage.

interpreter_name is calculated differently, defaulting to the
long name of the interpreter rather than "cp", but that is more
conformant.
2020-01-06 18:27:51 -05:00
Chris Hunt 4b5614c9e2 Replace get_impl_ver with interpreter_version 2020-01-06 18:27:27 -05: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) 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) 4bdca1a09a
Remove now useless build_wheels function 2020-01-05 23:52:40 +01: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
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
Tzu-ping Chung 5ffc6bd468 Add tests for global path options 2020-01-02 18:58:42 +08: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 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
Christopher Hunt b2f596ba2b
Merge pull request #7536 from chrahunt/refactor/extract-wheel-info-functions
Refactor wheel info extraction during install
2020-01-02 06:25:33 +08:00
Chris Hunt 010c24d64c Take .dist-info dir directly in wheel_metadata
Since retrieval of the .dist-info dir already ensures that a
distribution is found, this reduces responsibility on wheel_metadata and
lets us remove a few tests already covered by the tests for
test_wheel_dist_info_dir_*.
2020-01-01 12:25:01 -05:00
Chris Hunt fc48a17206 Simplify positive wheel_version unit test 2020-01-01 12:25:01 -05:00
Chris Hunt 6c56557fbe Remove unused req_description from wheel_dist_info_dir 2020-01-01 12:25:01 -05:00
Chris Hunt e1c7de8861 Raise UnsupportedWheel instead of AssertionError, and let caller add name 2020-01-01 12:25:01 -05:00
Chris Hunt 32115b55af Extract getting wheel .dist-info directory into a separate function 2020-01-01 12:10:22 -05:00
Christopher Hunt ab7e4769db
Merge pull request #7520 from chrahunt/maint/cross-platform-lints
Run linters/docs on Windows and macOS
2020-01-01 23:48:56 +08:00
Chris Hunt c9b0742508 Remove old root_is_purelib
The _invalidversion_ tests are not applicable to the new function since
we do not use a regex to find the applicable folder.
2019-12-31 12:49:08 -05:00
Chris Hunt 42c6dd78b9 Use WHEEL metadata to determine Root-Is-Purelib 2019-12-31 12:47:01 -05:00
Chris Hunt ca729c89de Simplify wheel_version tests 2019-12-31 12:35:53 -05:00
Chris Hunt d66bc398be Split wheel_metadata from wheel_version
This will let us re-use the wheel_metadata for other parts of
processing, and by parameterizing checks in terms of metadata we will be
able to substitute in metadata derived directly from the zip.
2019-12-31 12:35:52 -05:00
Christopher Hunt 69143848b0
Make WHEEL file errors more explicit (#7529)
* Raise exception on exception in finding wheel dist

We plan to replace this code with direct extraction from a zip, so no
point catching anything more precise.

* Raise exception if no dist is found in wheel_version
* Catch file read errors when reading WHEEL

get_metadata delegates to the underlying implementation which tries
to locate and read the file, throwing an IOError (Python 2) or OSError
subclass on any errors.

Since the new explicit test checks the same case as brokenwheel in
test_wheel_version we remove the redundant test.

* Check for WHEEL decoding errors explicitly

This was the last error that could be thrown by get_metadata, so we can
also remove the catch-all except block.

* Move WHEEL parsing outside try...except

This API does not raise an exception, but returns any errors on the
message object itself. We are preserving the original behavior, and can
decide later whether to start warning or raising our own exception.

* Raise explicit error if Wheel-Version is missing

`email.message.Message.__getitem__` returns None on missing values, so
we have to check for ourselves explicitly.

* Raise explicit exception on failure to parse Wheel-Version

This is also the last exception that can be raised, so we remove
`except Exception`.

* Remove dead code

Since wheel_version never returns None, this exception will never be
raised.
2019-12-31 23:17:41 +08: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) 3828699ddc
Move build options from WheelBuilder to build function 2019-12-29 18:49:54 +01:00
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
Chris Hunt 8dc6919875 Fix mypy checks on Windows
Previously we were making unguarded calls to non-Windows-only APIs. Mypy
only automatically excludes these from platform-specific checks when
inside conditions.
2019-12-29 00:33:28 -05: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
Pradyun Gedam 37f3fd7087
Move legacy wheel build process 2019-12-25 17:52:39 +05:30
Christopher Hunt 0292938f89
Merge pull request #7501 from uranusjr/appdirs-patch 2019-12-24 23:30:55 +08:00
Tzu-ping Chung c98c0ad79c Default to /etc/xdg if XDG_CONFIG_DIRS if empty 2019-12-23 14:33:17 +08:00
Christopher Hunt 3f4bb75fa4
Merge pull request #7499 from chrahunt/feature/add-old-entrypoints
Add old pip entrypoints
2019-12-23 05:40:10 +08:00
Pradyun Gedam c06874c471
Merge pull request #7490 from sbidoul/legacy-cache-bug-sbi
Fix cache bug with legacy cache entries
2019-12-21 07:27:46 +00:00
Tzu-ping Chung 2ccc5c055d Match site_config_dirs for empty XDG_CONFIG_DIRS 2019-12-20 14:36:30 +08:00
Tzu-ping Chung 204887da03 Apply changes from bundled appdirs to vendored
* Convert Windows app data directory values to bytes on Python 2, so the
  output type is consistent across platforms (pypa/pip#4000)
* Also look in ~/.config for user config on macOS (pypa/pip#4100)
* Remove pywin32 dependency, only use ctypes and winreg for directory
  lookup on Windows (pypa/pip#2467)
* Always use os.path.join() instead of os.sep.join() so cross-platform
  tests work as expected (pypa/pip#3275)
2019-12-19 17:15:03 +08:00
Chris Hunt 82a2651f93 Move pip._internal.main to cli submodule
Moving this out of the way gives us the flexibility to define wrappers
that will redirect requests to our old entrypoints to our new one.
2019-12-18 21:09:22 -05:00
Christopher Hunt ab12706aaa
Merge pull request #7478 from chrahunt/refactor/make-functional-download-tests
Make unpack_* unit tests into functional tests
2019-12-17 07:55:29 +08:00
Stéphane Bidoul (ACSONE) 36ff884673
Fix WheelCache.get in presence of legacy cache keys 2019-12-15 23:43:36 +01:00
Stéphane Bidoul (ACSONE) 80bfba3302
Improve WheelCache.get test 2019-12-15 23:41:03 +01:00
Stéphane Bidoul (ACSONE) 9c74c0214a
Add failing test for legacy cache keys 2019-12-15 23:41:03 +01:00
Chris Hunt c565d7a1b2 Switch to install_wheel in unit tests
Since it tests install_unpacked_wheel, the coverage should be the same.
2019-12-14 11:38:31 -05:00
Chris Hunt 9faa9aef29 Make download_http_url existing bad file test functional
Reduces coupling between tests and code.
2019-12-13 20:30:45 -05:00
Chris Hunt d3920f299f Make unpack_file_url existing bad file test functional
Reduces coupling between tests and code.
2019-12-13 20:30:45 -05:00
Chris Hunt fe24c7fc16 Make unpack_file_url existing matching file test functional
Reduces coupling between tests and code.
2019-12-13 20:30:45 -05:00
Chris Hunt 30c2d979b0 Make unpack_file_url download test to functional
This and the next several changes will uncouple the tests from the
current implementation, allowing us to factor the actual file download
out of `unpack_file_url` and `unpack_http_url`.
2019-12-13 20:30:45 -05:00
Pradyun Gedam 8e7a87bf4b
Factor out pep517 wheel build function (#7473) 2019-12-13 04:26:44 +00:00
Christopher Hunt d7eaede434
Revert "Add new option: pip wheel --save-wheel-names (#6377)" (#7420)
This reverts commit bcad1b1cb5, reversing
changes made to f86490317a.

As discussed, we should rethink the interface of this command output as
part of larger CLI usability review. In the interim, the same
functionality can be achieved using straightforward shell commands.
2019-12-13 07:57:05 +08:00
Stéphane Bidoul (ACSONE) 2eff06e7cc
Make WheelBuilder should_unpack argument explicit 2019-12-12 23:46:05 +01:00
Pradyun Gedam ce5edd4841
Better workaround for cache poisoning (#3025, #7319) 2019-12-12 11:28:57 +00:00
Chris Hunt 0457826bd0 Add global TempDirectory manager
In cases where there is not a clear scope, or where enforcing a scope
and passing a temp directory to callees creates unnecessary coupling
between components, this will let us tie the lifetime of temporary
directories to the lifetime of the application without using e.g.
atexit or finalizers.

This has the benefit of being easier to test and reason about.
2019-12-09 06:06:37 +08:00
Chris Hunt 24d2f1e719 Remove unused arguments 2019-12-05 20:29:43 -05:00
Chris Hunt 7db57478a2 Construct Downloader outside RequirementPreparer
Reduces RequirementPreparer responsibilities, and will let us get rid of
some constructor arguments.
2019-12-05 20:26:53 -05:00
Chris Hunt 762e4a0817 Move parse_content_disposition to network.download 2019-12-04 18:31:53 -05:00
Chris Hunt 32b0fc23ab Move sanitize_content_filename to network.download 2019-12-04 18:31:53 -05:00
Chris Hunt 3fbc991f0c Move _prepare_download to network.download 2019-12-04 18:31:53 -05:00
Chris Hunt db766f3c95 Move helper mock classes to dedicated module
When we factor out tests these will be needed in both sets, and it's
easier to refactor tests later if we avoid creating a dependency between
test files.
2019-12-04 18:30:21 -05:00
Christopher Hunt 830e29e189
Move wheel to operations.install.wheel (#7421)
* Update documentation

For now just fixing the paths and adding a sub-package docstring.
2019-12-04 06:02:39 +08:00
Stéphane Bidoul (ACSONE) 824dca1060
Better support for unicode cache entries 2019-12-02 12:07:19 +01:00
Stéphane Bidoul (ACSONE) 66ba51ca7d
Use legacy cache entries when they exist.
Pip 20 changes the cache key format to include the
interpreter name. To avoid invalidating all existing caches,
we continue using existing cache entries that were computed
with the legacy algorithm. This should not regress issue #3025
because wheel cached in such legacy entries should have
the python implementation tag set.
2019-12-02 12:07:19 +01:00
Stéphane Bidoul (ACSONE) c4ef6163e5
New cache key generation algorithm
Instead of building an URL-ish string that could be
complex to describe and reproduce, generate a dictionary that is
hashed with a simple algorithm.
2019-12-02 12:07:19 +01:00
Stéphane Bidoul (ACSONE) e0165e7b30
Remove unused wheel_builder python_tag argument 2019-12-02 12:07:18 +01:00
Chris Hunt b8c16a0dc8 Move Wheel tests 2019-12-02 11:52:51 +08:00
Chris Hunt 60f6ed9387 Move wheel.Wheel to models.wheel.Wheel
This aligns more closely with how the class is used and makes it easier
to move the rest of the wheel module to a dedicated module for
installation.
2019-12-02 11:52:51 +08:00
Chris Hunt bf26185d55 Import Wheel in tests directly 2019-12-02 11:52:51 +08:00
Chris Hunt 1abf978e88 Move format_tag to pep425tags
This is a more appropriate place for the function, since it is more
related to tags than wheels, and will make it easier to refactor Wheel
into its own module.
2019-12-02 11:52:51 +08:00
Chris Hunt b8f626ace6 Deprecate install-location-related options in --install-option 2019-11-30 17:42:48 -05:00
Chris Hunt 55a943e556 Add distutils args helpers
The utils.distutils_args.parse_args function can recognize distutils
arguments so we can deprecate their usage.
2019-11-30 17:39:56 -05:00
Christopher Hunt 5ba702894a
Remove old workaround for Debian Python patch (#7401) 2019-11-26 11:58:46 +08:00
Xavier Fernandez db1a2754bb Fix logging of cached response
Cached responses often (always ?) provide a length meaning they were
never logged as such.
2019-11-25 23:15:00 +01:00
Xavier Fernandez 95576102c5
Tweak format_size utility function to include a space (#7399) 2019-11-25 22:09:10 +01:00
Xavier Fernandez 8114003e62 Add basic tests for format_size 2019-11-25 14:53:23 +01:00
Chris Hunt 19806574e5 Move Downloader out of unpack_http_url
Reduces scope of session and progress_bar.
2019-11-21 19:11:46 -05:00
Chris Hunt 4be0a5445a Move Downloader up out of _download_http_url
Reduces exposure of session and progress_bar.
2019-11-21 19:11:46 -05:00
mdebi f6aaba9fd9 Warn if a path in PATH starts with tilde during install 2019-11-16 00:16:41 +01:00
Xavier Fernandez 9e1b1c7466
Merge pull request #7335 from sbidoul/subdirectory-cache-key-sbi
Include subdirectory URL fragments in cache keys
2019-11-15 23:14:16 +01:00
Christopher Hunt 6bc7a1c5ad
Merge pull request #7342 from chrahunt/refactor/simplify-tags
Make versions argument singular for pep425tags.get_supported()
2019-11-13 10:50:47 +08:00
Chris Hunt 7d27bff299 Make versions argument singular for pep425tags.get_supported()
This simplifies the interface of this function in preparation for
switching to packaging.tags.
2019-11-12 20:58:44 -05:00
Stéphane Bidoul (ACSONE) 613cc01c0b
Include subdirectory URL fragment in the cache key 2019-11-12 08:50:21 +01:00
Chris Hunt 95375a5213 Make session a required parameter in operations.prepare 2019-11-11 22:34:52 -05:00
Christopher Hunt 0801e972c3
Merge pull request #7337 from chrahunt/refactor/remove-unneeded-compat
Remove unnecessary native_str implementation
2019-11-11 15:44:02 +08:00
Pradyun Gedam c522381b32
Rename InstallationCandidate.{project -> name} (#7328) 2019-11-11 13:11:19 +05:30
Christopher Hunt 8ce34af430
Merge pull request #7323 from chrahunt/refactor/less-intrusive-pep425tags
Be less intrusive towards pep425tags in tests
2019-11-11 15:37:10 +08:00
Pradyun Gedam 9b25cd512b
Rename InstallationCandidate.{project -> name} 2019-11-11 11:37:53 +05:30
Pradyun Gedam 1405a403fe
Merge branch 'master' into add-use-user-site-to-preparer 2019-11-11 08:40:20 +05:30
Chris Jerdonek f4cad3d403 Add PackageFinder.process_project_url(), and test. 2019-11-10 21:27:13 -05:00
Chris Jerdonek bab1e4f8a1 Change CollectedLinks to store project_urls. 2019-11-10 21:27:00 -05:00
Chris Jerdonek 024038cf10 Add LinkCollector.fetch_page(). 2019-11-10 21:19:07 -05:00
Chris Hunt 0a6305a398 Remove unused compat.native_str 2019-11-10 18:06:24 -05:00
Pradyun Gedam deecb36de9
Reduce RequirementTracker responsibilities (#7278) 2019-11-10 15:08:52 +05:30
Christopher Hunt 2ed5d565de
Merge pull request #7326 from chrahunt/bugfix/enforce-pyproject-requires-format
Enforce requirement format in pyproject.toml build-system.requires
2019-11-10 16:56:18 +08:00
Christopher Hunt 77eb89edbb
Merge pull request #7314 from chrahunt/refactor/remove-req-from-wheel-build
Factor out legacy wheel build function
2019-11-10 16:55:35 +08:00
Pradyun Gedam c9606b86e1
Add use_user_site to RequirementPreparer 2019-11-10 13:51:29 +05:30
Pradyun Gedam 1b07d3e797
Rewrap strings to 80 characters 2019-11-10 12:38:29 +05:30
Pradyun Gedam f39ce3439b
Update tests to correctly enter RequirementTracker context 2019-11-10 12:38:08 +05:30
Pradyun Gedam bb197e12bf
Move make_install_req definition to top of function
Why: Makes the diff for the next commit cleaner
2019-11-10 12:34:59 +05:30
Pradyun Gedam c40a9d332d
Update callsites for RequirementTracker 2019-11-10 12:33:25 +05:30
Chris Hunt f64f15b6d9 Enforce requirement format in build-system.requires 2019-11-09 20:58:27 -05:00
Chris Hunt eb3701f749 Use shared_data to avoid copying the data directory 2019-11-09 20:47:20 -05:00
Chris Hunt 9775387e41 Move unit test to functional test for implicit hash checking 2019-11-09 16:30:44 -05:00
Chris Hunt e4a7276ea0 Explicitly require hashes for tests that expect it
The purpose of these tests is not to check implicit hash-checking mode,
so we can be explicit.
2019-11-09 16:12:05 -05:00
Chris Hunt 7f8c25dbbb Fix call to Resolver/Preparer in tests 2019-11-09 16:11:43 -05:00
Chris Hunt 94dbbe2556 Remove patching of pep425tags internals in wheel tests 2019-11-09 13:09:18 -05:00
Chris Hunt 7f910251a4 Remove unused sys.platform patching from test_wheel 2019-11-09 13:09:06 -05:00
Chris Hunt 8963f63989 Parameterize requirement name for logging 2019-11-08 21:54:03 -05:00
Christopher Hunt 7af704e3cf
Merge pull request #7310 from chrahunt/refactor/scheme
Add Scheme model and use for wheel installation
2019-11-09 09:57:03 +08:00
Chris Hunt e03a71aff8 Use new Scheme model for wheel installation 2019-11-07 12:43:39 -05:00
Pradyun Gedam 0cebc55e3f
Add tests for create_env_error_message function (#7255) 2019-11-07 21:08:02 +05:30
Christopher Hunt d3129f227a
Merge pull request #7301 from chrahunt/refactor/reduce-resolver-finder-dependence
Reduce Resolver dependence on PackageFinder
2019-11-06 14:17:55 +08:00
Pradyun Gedam 7b3d3a31e6
Support PEP 405 include-system-site-packages configuration (#7155) 2019-11-06 11:47:36 +05:30
Christopher Hunt 8341f87046
Merge pull request #7287 from pradyunsg/refactor/simplify-metadata-generation-flow
Simplify metadata generation flow, to be a lot more "linear"
2019-11-06 11:51:49 +08:00
Chris Hunt deac2343dc Don't pass PackageFinder to Preparer from Resolver
Preparer's overall responsibilities align more with having its own
reference to finder, which will help us remove it from resolver later.
2019-11-05 20:57:14 -05:00
Pradyun Gedam 8981895b5e
Skip all failing tests when using venv
Our isolation logic for venv isn't correct and that is causing these
tests to fail. The culprits for this are:

  tests/lib/venv.py::VirtualEnvironment.user_site_packages
  tests/lib/venv.py::VirtualEnvironment.sitecustomize

Both these together are supposed to create an environment to isolate the
tests. However, they were written for virtualenv and make assumptions
that are not true for environments created with venv. Until we can fix
VirtualEnvironment to properly isolate the test from the underlying test
environment when using venv, these tests will continue to fail.

This is blocking an important bugfix for users facing issues with since
pip is installing packages into `--user` when run in a venv, even when
`--user` isn't visible from that environment.

As a temporary band-aid for this problem, I'm skipping these tests to
unblock us from shipping the bugfix for the aforementioned issue.

The test isolation logic should be fixed to work for venv. Once such a
fix is made, this commit should be reverted.
2019-11-05 23:02:45 +05:30
Pradyun Gedam 1aee0eb5cb
Correctly ignore system site-packages for venv
Why: PEP 405 virtual environments have a different mechanism for
ignoring system site-packages in virtual environments.
2019-11-05 14:45:08 +05:30
Pradyun Gedam fd7c9b7ce4
Refactor virtualenv_no_global
Why: This change makes it easier to introduce handling for PEP 405 based
virtual environment's global site-package exclusion logic
2019-11-05 14:45:08 +05:30
Christopher Hunt 7d5967906e
Merge pull request #7288 from pradyunsg/refactor/new-wheel_builder-module
Create a new wheel_builder module and move WheelBuilder+friends
2019-11-05 11:54:09 +08:00
Christopher Hunt 7f8be22584
Merge pull request #7292 from chrahunt/refactor/make-session-required
Make session required in pip._internal.req.req_file functions
2019-11-04 19:40:25 +08:00
Pradyun Gedam 54fc70d212
Stop generating metadata as part of a unit test 2019-11-04 14:30:20 +05:30
Pradyun Gedam b1f2f747f9
🎨 a test 2019-11-04 11:51:44 +05:30
Pradyun Gedam 9435050c2d
Move tests for WheelBuilder and friends 2019-11-04 11:51:44 +05:30
Pradyun Gedam 647d30ec77
Move hash_file to utils.misc
Why: Allows for better code reuse, without introducing dependency
between wheel->wheel_builder.
2019-11-04 11:51:08 +05:30
Pradyun Gedam da9a432576
Move WheelBuilder and friends to a dedicated module 2019-11-04 11:49:02 +05:30
Chris Hunt df42c80ff6 Make session required in pip._internal.req.req_file functions 2019-11-03 20:49:11 -05:00
Stéphane Bidoul (ACSONE) f5eba4f726
Add tests for git sha wheel caching 2019-11-03 22:54:33 +01:00
Chris Hunt 3076c39f25 Remove unused Resolver.session 2019-11-03 14:31:38 -05:00
Chris Hunt 44cc3aeb0a Use session from RequirePreparer, not Resolver 2019-11-03 14:26:47 -05:00
Christopher Hunt 2a2794e09b
Merge pull request #7268 from sbidoul/remove-should_use_ephem_cache-sbi
remove should_use_ephemeral_cache
2019-11-01 16:29:03 +08:00
Christopher Hunt a0fd8c2154
Merge pull request #7261 from chrahunt/refactor/simplify-req-file-parsing-3
Simplify requirement file parsing
2019-10-31 09:20:40 +08:00
jenix21 d8567d3b66 address review comment 2019-10-30 00:33:15 +09:00
Stéphane Bidoul (ACSONE) cdf09bfc4a
remove should_use_ephemeral_cache 2019-10-29 09:15:44 +01:00
Stéphane Bidoul (ACSONE) aaa4237adf
refactor should_use_ephemeral_cache 2019-10-28 22:56:04 +01:00
Chris Hunt 85918afc5e Remove req_file.process_line and update tests
The behavior that was in process_line was moved to
RequirementsFileParser so it's no longer needed, we just had to
move the remaining tests to use the higher-level parse_requirements
interface.
2019-10-26 13:53:01 -04:00
Chris Hunt 68454d29a5 Make req file parsing unit tests higher-level
Decoupling the tests from the implementation makes it possible
to refactor the interface exposed by process_line.
2019-10-26 13:52:36 -04:00
Christopher Hunt be01170ba5
Merge pull request #7245 from chrahunt/refactor/simplify-req-file-parsing-2
Simplify requirement file parsing
2019-10-25 19:51:04 +08:00
jenix21 4c6052d2d6 Add tests for create_env_error_message function 2019-10-23 01:00:08 +09:00
Pradyun Gedam c729a84b48
Merge pull request #7002 from takluyver/install-user-fallback
Default to --user install in certain conditions
2019-10-22 08:44:06 +05:30
Thomas Kluyver c4d92bbb4e Use pytest parametrize for decide_user_install tests 2019-10-21 08:52:44 +01:00
Thomas Kluyver fbc0588c01 Add unit tests of decide_user_install() 2019-10-20 21:48:18 +01:00
Chris Hunt a5d53eab0a Simplify skip_requirements_regex option handling
Decouples `process_lines` from our CLI options.
2019-10-20 13:33:15 -04:00
Pradyun Gedam 8dbf8461fc
Clean up wheel.move_wheel_files (#7176) 2019-10-20 13:26:48 +05:30
Pradyun Gedam 9ab9040d75
Remove RequirementSet.require_hashes (#7068) 2019-10-20 13:23:40 +05:30
Pradyun Gedam 611fc6069b
Update references to collector.py 2019-10-19 22:24:53 +05:30
Pradyun Gedam 2db6f428bf
Update imports to {index -> index.package_finder} 2019-10-19 22:24:01 +05:30
Pradyun Gedam 66e9b44f15
Import req_file more directly 2019-10-19 22:22:11 +05:30
Pradyun Gedam c18e912b2a
Import InstallationCandidate more directly 2019-10-19 22:22:11 +05:30
Pradyun Gedam bcad1b1cb5
Add new option: pip wheel --save-wheel-names (#6377) 2019-10-19 11:03:15 +05:30
Chris Hunt 5c5c6eca83 Rename test file to align with moved functions 2019-10-16 21:29:06 -04:00
Chris Hunt 6eb83c6d3a Move remaining functions in download to operations.prepare
The only user of this module is operations.prepare.RequirementPreparer.
Moving the functionality to the single using module means that
refactoring will be easier (since all the mess is in one place). This
also removes a mis-named module from the top-level of the repository.
2019-10-16 21:29:06 -04:00
Harsh Vardhan 0e6ac42c93 Add need_svn decorator for tests which require svn
Signed-off-by: Harsh Vardhan <harsh59v@gmail.com>
2019-10-15 17:22:16 +05:30
Chris Hunt b8fb97a815 Remove unused RequirementSet.require_hashes 2019-10-13 13:19:49 -04:00
Chris Hunt bbc29f0c6c Pass require_hashes directly to Resolver
This removes some of the dependence of the Resolver on our specific
RequirementSet implementation.
2019-10-13 13:19:49 -04:00
Chris Hunt 913f856739 Cleanup arguments, add docstring 2019-10-11 22:24:50 -04:00
Chris Hunt 39572ddd12 Don't pass InstallRequirement to install_unpacked_wheel
We are only using this value for logging. Passing a string reduces
coupling between InstallRequirement and this function.
2019-10-11 21:58:58 -04:00
Chris Hunt 4682f3cb9b Pass scheme to install_unpacked_wheel
This reduces the number of required arguments and helps establish a
convention for install_* functions, which should take a scheme instead
of the individual components.
2019-10-11 21:49:39 -04:00
Chris Hunt 578de7d863 Rename wheel install function 2019-10-11 21:41:47 -04:00
Christopher Hunt f3f396fd79
Merge pull request #7102 from mayeut/manylinux2014
Add manylinux2014 support
2019-10-10 18:07:51 -04:00