Commit Graph

39 Commits

Author SHA1 Message Date
Nguyễn Gia Phong f8b06a3906 Enable flake8-logging-format 2020-07-17 14:33:19 +07:00
Devesh Kumar Singh dadac2ce03 Add type annotations to pip._internal.cache 2020-07-09 21:46:55 +05:30
Stéphane Bidoul 94b77130aa
Add WheelCache method to inform which cache was used
Return whether the link was found in the persistent or ephemeral cache.
2020-04-01 22:57:00 +02:00
Chris Hunt 0410535ef2 Remove unused WheelCache.cleanup 2020-02-04 23:11:27 -05:00
Chris Hunt eead579049 Remove no-op calls to WheelCache.cleanup 2020-02-04 23:11:27 -05:00
Chris Hunt 34df623016 Globally manage EphemWheelCache temp directory 2020-02-04 23:11:25 -05:00
Chris Hunt 63743fcc30 Make ephem-wheel-cache tempdir name globally accessible 2020-02-04 23:01:24 -05: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 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) 74c2837adf
Simplify handling of cache candidate directories 2019-12-16 17:39:25 +01: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) ab0593659d
Use interpreter_name and _version in cache keys 2019-12-02 12:10:12 +01: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) 178cd3f244
Better workaround for cache poisoning #3025
Make sure ``pip wheel`` never outputs pure python wheels with a
python implementation tag. Better fix/workaround for
`#3025 <https://github.com/pypa/pip/issues/3025>`_ by
using a per-implementation wheel cache instead of caching pure python
wheels with an implementation tag in their name.

Fixes #7296
2019-12-02 12:07:18 +01: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
Stéphane Bidoul (ACSONE) 47ae034da8
Debug logging in case of unexpected wheel name in cache 2019-11-13 15:40:07 +01:00
Stéphane Bidoul (ACSONE) a4d12f807f
Avoid double package name canonicalization 2019-11-13 15:40:06 +01:00
Stéphane Bidoul (ACSONE) dcb8669f21
Simplify SimpleWheelCache.get in case package_name is falsy 2019-11-13 11:43:56 +01:00
Stéphane Bidoul (ACSONE) 613cc01c0b
Include subdirectory URL fragment in the cache key 2019-11-12 08:50:21 +01:00
Pradyun Gedam 23ab63e2f3
Import FormatControl more directly 2019-10-19 22:22:07 +05:30
Pradyun Gedam b447f438df
Move path_to_url() to utils/urls.py (#7075) 2019-09-25 10:00:33 +05:30
Chris Jerdonek 0435316fde Move path_to_url() to utils/urls.py. 2019-09-24 02:01:52 -07:00
Chris Hunt 85dcaa74bb Unconditionally create TempDirectory.path 2019-09-22 00:02:46 -04:00
Chris Jerdonek 63639bfc0f Make tags required in Wheel.support_index_min() and supported(). 2019-08-10 02:59:59 -07:00
Pradyun Gedam f377148f6d
Use mypy's inline configuration syntax for opt-outs 2019-07-30 12:39:51 +05:30
Chris Jerdonek 99228e503a Import path_to_url() from utils/misc.py instead of download.py. 2019-06-03 02:31:40 -07:00
Maxim Kurnikov f77b8ca051 remove #noqa: F401 2019-02-22 14:17:07 +03:00
cytolentino f08b34887b Add typing to cache.py 2018-10-30 12:23:13 +00:00
Nitesh Sharma 98966b91c7 update parametrize test and comment 2018-09-04 14:36:09 +05:30
Nitesh Sharma b818b8324d refactor format control and rename test functions 2018-08-28 21:45:40 +05:30
Nitesh Sharma e10a613212 Refactoring: Move FormatControl to separate class
This moves FormatControl named tuple and it's all related
methods to separate class.

Closes https://github.com/pypa/pip/issues/5592
2018-08-28 21:12:42 +05:30
Pradyun Gedam 4fc697847a
Update imports for the moved compat module 2018-07-29 18:32:20 +05:30
Pradyun Gedam 39995b32db
Move Link to models 2018-06-24 02:38:21 +05:30
Pradyun S. Gedam 165b10b9db Rework Wheel Caching 2017-10-04 18:53:55 +05:30
Donald Stufft 95bcf8c5f6 Move all internal APIs to pip._internal 2017-08-31 14:53:00 -04:00
Renamed from pip/cache.py (Browse further)