Commit Graph

18 Commits

Author SHA1 Message Date
Damian Shaw 68529081c2
Enforce f-strings via Ruff (#12393) 2023-11-07 09:14:56 +00:00
Stéphane Bidoul 030d2d425b Add comment 2023-04-13 09:33:59 +02:00
Stéphane Bidoul 5119d4651e Improve conversion of direct_url.hash to hashes 2023-04-11 14:49:30 +02:00
Stéphane Bidoul e5c88951a0 Do not crash in presence of misformatted hash field in ``direct_url.json``. 2023-02-05 00:13:32 +01:00
Stéphane Bidoul 38681f3d66 Allow multiple hashes in direct_url.json
This influences the recorded direct_url.json metadata,
and therefore the pip inspect output,
as well as the pip install --report format.
2023-01-28 13:25:38 +01:00
Stéphane Bidoul bc0f4c36ee
Remove resolved_revision from DirectUrl VcsInfo
Altough resolved_revision it is part of PEP 610, it is currently not
implemented in pip, so remove it from the code
base to avoid confusion.
2022-04-18 13:56:22 +02:00
Stéphane Bidoul ca0517621d
Refactor direct url editable test 2021-09-21 11:18:02 +02:00
Pradyun Gedam 94999255d5
Reformat the codebase, with black 2021-08-20 13:37:49 +01:00
Diego Ramirez 6958b87d3d
Complete type annotations: `pip/_internal/models` (#10138) 2021-07-12 11:43:52 +08:00
Jon Dufresne 0945809afc Remove typing.TYPE_CHECKING guards
The typing module has been available since Python 3.5. Guarding the
import has been unnecessary since dropping Python 2.

Some guards remain to either:

- Avoid circular imports
- Importing objects that are also guarded by typing.TYPE_CHECKING
- Avoid mypy_extensions dependency
2021-02-19 18:34:21 -08:00
Jon Dufresne a6392bd62e Replace pip._internal.utils.typing with stdlib typing
The stdlib module has been available since Python 3.5 and the
TYPE_CHECKING constant has been available since 3.5.2.

By using stdlib, this removes the need for pip to maintain its own
Python 2 typing compatibility shim.
2021-02-18 19:09:13 -08:00
Hugo van Kemenade a3e246f7d0 Cleanup: replace 'from urllib import xyz as urllib_xyz' with import urllib.xyz 2020-12-27 16:18:44 +02:00
Pradyun Gedam 86afa89043
Merge pull request #9361 from jdufresne/f-strings
Use f-strings for simple string formatting
2020-12-26 10:24:18 +00:00
Jon Dufresne cdcf74fb8e Use f-strings for simple string formatting
Use pyupgrade to convert simple string formatting to use f-string
syntax. pyupgrade is intentionally timid and will not create an f-string
if it would make the expression longer or if the substitution parameters
are anything but simple names or dotted names.
2020-12-25 16:21:20 -08:00
Jon Dufresne 09b3d3a50b Remove object from class definitions
Unnecessary since dropping Python 2 support. In Python 3, all classes
are new style classes.
2020-12-25 15:48:11 -08:00
Hugo van Kemenade 817ee23051 Remove redundant Python 2.7 code 2020-12-22 09:06:26 +02:00
Pradyun Gedam 25ab172b55
Update linter: isort 2020-09-23 19:52:28 +05:30
Stéphane Bidoul 6b7f4ce81b
Add DirectUrl model, implementing PEP 610 2020-04-01 22:56:59 +02:00