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

45 commits

Author SHA1 Message Date
q0w 0c6d20f8c7
Validate build deps when --no-build-isolation is passed (#10886)
This can help catch issues in setting up the build environment, helping
ensure that packages get built according to their declared metadata.
2022-02-18 14:58:40 +00:00
Pradyun Gedam 531c991ef9
Require every call_subprocess call-site to pass command_desc
This serves as additional context that can be presented in error
messages.
2022-01-25 01:38:22 +00:00
Tzu-ping Chung c54d40474a CHange ireq.satisfied_by to abstract distribution 2021-11-18 17:58:10 +08:00
Tzu-ping Chung 62b91dfbf1 Return abstract metadata type from ireq.get_dist() 2021-11-18 17:56:26 +08:00
Stéphane Bidoul b07a956f4b
Split _setup_isolation for readability 2021-10-18 14:34:50 +02:00
Stéphane Bidoul ae512892eb
Prepare legacy editable metadata in isolated env
When there is a pyproject.toml, metadata preparation must be
done in the isolated build environment for legacy editable installs too
(fixes a regression).

Also detect earlier if an editable install must go through the
legacy install path, to be sure to run it in an environment
with the correct build requirements.
2021-10-18 14:34:50 +02:00
Stéphane Bidoul e5be3f796e
Add PEP 660 support (build_editable) 2021-09-28 23:04:51 +02:00
Tzu-ping Chung 25c64a00f1 Fix InstalledDistribution's metadata interface
InstallRequirement.satisfied_by is an old-style distribution object
(pkg_resources) for now, so we need to provide a shim for its access in
InstalledDistribution.get_metadata_distribution(). Not sure why this was
not picked up by the type checker :/
2021-09-26 12:02:17 +08:00
Tzu-ping Chung 135faabfd6
Remove direct pkg_resource usages from resolver and preparer 2021-08-23 02:07:33 +08:00
Diego Ramirez 3b3fde2447
Fix the pip/_internal/distributions annotations (#10074) 2021-07-13 06:29:21 +08:00
Jon Dufresne cd1fb590e7 Blacken the src/pip/_internal/distributions directory 2021-02-21 08:52:50 -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
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
Jon Dufresne c148bcc1aa Use short Python3 super() syntax 2020-12-24 15:11:51 -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
Pradyun Gedam 8f3687cfd9
Rename pip._internal.distributions.{source -> sdist}
Certain environments seem to be leaving behind empty folders in this
directory -- There was an older pip release that included a source/
folder here which isn't getting deleted for some reason. I have not
figured out the root cause why this happens yet. This is resulting in
ImportErrors since Python imports have a higher precedence for packages
compared to modules.

This commit changes the name we're trying to import from, which should
help prevent this mode of failure.
2020-01-21 17:53:24 +05:30
Chris Hunt 33043ba22f Use pkg_resources.Distribution derived from wheel directly
We now extract all metadata files from the wheel directly into memory
and make them available to the wrapping pkg_resources.Distribution via
the DictMetadata introduced earlier.
2020-01-05 10:57:14 -05:00
Maxim Kurnikov b69560661b remove disallow_untyped_defs=False for pip._internal.distributions, pip._internal.operations.prepare 2019-12-12 21:35:37 +01:00
Pradyun Gedam 528d27a2fe
Nicer comments in prepare_distribution_metadata 2019-11-04 14:30:21 +05:30
Pradyun Gedam 67ae8fdc28
Move call to assert_source_matches_version 2019-11-04 14:30:20 +05:30
Pradyun Gedam 911722173e
Move distributions.{source.legacy -> source}
Why: Based on some more experience from refactoring metadata generation,
it became clear to me that the separation of legacy vs modern codepaths
should happen at lower level than this abstraction.
2019-11-04 12:01:38 +05:30
admin 7cfc16d016 Change %s to .format 2019-10-15 13:44:43 +05:30
Pradyun Gedam 1ad0495fdd
Rename {run -> runner}_with_spinner_message 2019-09-30 12:17:07 +05:30
Pradyun Gedam 46bd454e3e
Use pep517.Pep517HookCaller.subprocess_runner
Also, create a new utility function for showing a spinner when running
a subprocess.

Why: The subprocess_runner API was specifically added to make it
possible for pip to stop monkey-patching Pep517HookCaller, while still
maintaining its output style. The relevant monkeypatch will be removed
in a follow up commit.
2019-09-30 12:16:45 +05:30
Maxim Kurnikov 3692097cca add per-file disallow_untyped_defs=False, and set it to True globally 2019-09-29 23:31:15 +02:00
Pradyun Gedam ea68afab93
Enable isort in pre-commit 2019-09-24 18:03:22 +05:30
Pradyun Gedam 13ab7a2bce
Linearize a nested-error-message-generation (#7040)
Merge pull request #7040 from pradyunsg/cleanup/nicer-error-message-creation
2019-09-19 20:06:54 +05:30
Pradyun Gedam f051201d08
Invoke method only when build isolation is needed 2019-09-19 15:23:10 +05:30
Pradyun Gedam b22333e44e
Linearize a nested-error-message-generation 2019-09-19 15:19:06 +05:30
Pradyun Gedam 8dac3a046b
Move isolation setup code into a helper method 2019-09-19 15:05:31 +05:30
Pradyun Gedam c3c2831893
Merge pull request #6980 from pradyunsg/refactor/simplify-make_distribution
Improve make_distribution_for_install_requirement()
2019-09-05 15:30:55 +05:30
Pradyun Gedam fc338512de
Better comments in make_distribution_for_install_requirement() 2019-09-05 11:22:03 +05:30
Pradyun Gedam e31192cf49
Simplify conditional for choosing WheelDistribution 2019-09-05 09:34:16 +05:30
Pradyun Gedam b731b012e0
Update import statement 2019-08-27 15:14:54 +05:30
Pradyun Gedam e9d8e1d326
Move distributions/{source.py -> source/legacy.py}
This would simplify for splitting up the build logic, in follow up
commits.
2019-08-27 14:09:15 +05:30
Pradyun Gedam a0670a9c98
Rename AbstractDistribution.prep_for_dist()
Use a better name prepare_distribution_metadata()
2019-06-16 05:29:00 +05:30
Pradyun Gedam 7908973c07
Rename AbstractDistribution.dist()
Use a more descriptive name get_pkg_resources_distribution()
2019-06-16 05:28:55 +05:30
Pradyun Gedam 534a102564
Rename make_abstract_dist
Use a more descriptive name make_distribution_for_install_requirement()
2019-06-16 05:23:16 +05:30
Pradyun Gedam ad68a85e45
Add TODOs to improve the names for Distribution's methods 2019-06-14 23:28:22 +05:30
Pradyun Gedam 6f1e2ce5bc
Add docstrings to Distribution classes 2019-06-14 23:28:21 +05:30
Pradyun Gedam d43e31802b
Add distributions sub-package for holding build logic
This moves the DistAbstraction logic into a dedicated 'distributions'
sub-package, with separated modules for the concrete implementations of
various distribution handling logic.
2019-06-14 23:27:42 +05:30