Commit Graph

345 Commits

Author SHA1 Message Date
Pradyun Gedam 2d028e140e Revert "Filter available distributions using hash declarations from constraints files (#10962)"
This reverts commit 0c284520c6.
2022-05-03 17:50:21 +01:00
Paul Moore 6da9b5c694 Call the PEP 517 backend with the requirement's config settings 2022-04-21 18:30:48 +01:00
Paul Moore af28440792 Store config settings on the install requirement 2022-04-21 18:30:48 +01:00
q0w 0c284520c6
Filter available distributions using hash declarations from constraints files (#10962) 2022-03-16 07:43:06 +00:00
Pradyun Gedam 1cda23bd6b
Merge pull request #10795 from pradyunsg/better-subprocess-errors 2022-01-27 07:09:18 +00:00
James Gerity 5c24a798b8
Change VCS tooling verbosity along with pip's verbosity (#9639)
Co-authored-by: Tzu-ping Chung <uranusjr@gmail.com>
Co-authored-by: Pradyun Gedam <pradyunsg@users.noreply.github.com>
2022-01-25 08:54:02 +00:00
Pradyun Gedam eb462744da
Raise the `LegacyInstallFailure` exception directly 2022-01-25 01:38:23 +00:00
Pradyun Gedam d527e85146
Add a dedicated exception for metadata generation failures 2022-01-25 01:38:22 +00:00
Pradyun Gedam 2a617d5455
Improve presentation of `LegacyInstallFailure`
These errors now more clearly note where the error occurred and what
component is at fault.
2022-01-25 01:38:22 +00:00
Tzu-ping Chung 498f313853 Remove pkg_resources usages from req_install 2021-12-04 17:57:33 +08:00
Tzu-ping Chung cd01e4fd8f Remove pkg_resources usages from utils modules
Relevant functionalities are moved into pip._internal.metadata.
2021-12-04 17:57:33 +08:00
Tzu-ping Chung ad158b03e8 Fix types in tests on Windows 2021-11-18 17:58:12 +08: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
Tzu-ping Chung ebd693e0b5 Abstract pkg_resources from uninstall operation 2021-11-18 17:55:38 +08: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
Alex Hedges e1f81bfa4d Fix many typos 2021-10-11 15:48:17 -04:00
Stéphane Bidoul e377235356
Correctly indent metadata preparation messages 2021-09-29 18:28:04 +02:00
Stéphane Bidoul 826d566eb8
Add a spinner when preparing setup.py metadata
For symmetry with pyproject.toml metadata preparation.
2021-09-28 23:04:58 +02:00
Stéphane Bidoul e5be3f796e
Add PEP 660 support (build_editable) 2021-09-28 23:04:51 +02:00
Jon Dufresne 60c274be2d Complete type annotations of tests/unit/ directory 2021-09-23 05:44:54 -07:00
Jon Dufresne cf7183d875 Remove six import from src/pip/_internal/req/req_install.py
Use Python 3 `raise exc from ...` semantics to replace the use of
six.reraise.
2021-08-08 09:49:00 -07:00
Alex Hedges 88703bbcee Remove extra period in deprecation message 2021-08-02 23:58:53 -04:00
Pradyun Gedam 069b01932a
Blacken src/pip/_internal/req
Progresses the black formatting of the codebase further.
2021-07-24 09:47:54 +01:00
harupy 9d96e0777f Convert type comments 2021-07-23 23:38:27 +09:00
Filipe Laíns 47f7c63ed7
remove support for setup.cfg only projects
Per the discussion in #9945.

Signed-off-by: Filipe Laíns <lains@riseup.net>
2021-05-31 13:50:04 +01:00
Tzu-ping Chung 1983ef0edc Better diagnose when setup.py/cfg cannot be found
This adds a check before invoking 'egg_info' to make sure either setup.py or
setup.cfg actually exists, and emit a clearer error message when neither can
be found and the egg_info command can never succeed.
2021-05-04 16:54:52 +08:00
Stéphane Bidoul 8fc65ea53f
Merge pull request #9673 from mwchase/url-constraints-final-2
Support URL constraints in the new resolver
2021-04-18 12:31:45 +02:00
Max W Chase 4c69ab2a2c Support URL constraints in the new resolver
Fixes #8253
2021-04-17 07:59:57 -04:00
Tzu-ping Chung 56a8f3d8bd Typing fixes 2021-03-10 16:40:58 +08:00
Tzu-ping Chung d9d7790636
Merge pull request #9467 from uranusjr/avoid-exchanging-parsed-version
Use str to pass versions to avoid debundling issue
2021-03-03 16:39:21 +08:00
Pradyun Gedam c2ba7c043b
Merge pull request #9606 from hexagonrecursion/fstr 2021-02-21 08:30:00 +00: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
Tzu-ping Chung 383934eb83 Incorporate get_installed_version() logic
All usages of it now use Environment.get_distribution() instead.

InstallRequirement.installed_version is also removed since it is no
longer used anywhere in the code base.
2021-02-19 13:34:16 +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
Tzu-ping Chung 5fac450375
Merge pull request #9368 from jdufresne/ensure
Remove unnecessary uses of six.ensure_(binary|str|text)
2021-02-18 20:40:21 +08:00
Andrey Bienkowski 9b2cb894ba Convert more str.format() calls to f-strings 2021-02-13 09:27:17 +03:00
Stéphane Bidoul b3761f6fab
Remove support for git+git@ pseudo VCS URLs.
Now that we don't need to support git@
pseudo-urls, we can simplify the test for
valid VCS URLs based on link.is_vcs, which
is turns is based on the URL scheme.

This also means we fail earlier if a git@ pseudo
URL is used.

Since VCS requirements are not validated to be URLs
in Requirement constructors, we can simplify update_editable.
2021-01-18 09:11:07 +01:00
Tzu-ping Chung ab181811ae Use str to pass versions to avoid debundling issue 2021-01-18 05:57:31 +08:00
Pradyun Gedam 3af9093a73
Merge pull request #9274 from sbidoul/pip-wheel-must-keep-clone-sbi 2021-01-17 15:30:57 +00:00
Stéphane Bidoul b43062d428
Remove deprecation deadline for 8368 2021-01-03 15:34:05 +01:00
Stéphane Bidoul 4ea00f2f1b
The preparer always clones VCS requirements
Previously, in download mode, it did a vcs export,
which did not include vcs information, leading to
issues when the build backend required it.
2020-12-27 17:13:35 +01:00
Jon Dufresne c115cdc81a Remove unnecessary uses of six.ensure_(binary|str|text)
Now that Python 2 is not supported, the bytes/str boundaries are more
clear and explicit. Using six.ensure_* methods for backwards
compatibility is no longer necessary as the types are known and verified
using mypy.

One exception is tests/lib/wheel.py which allows tests to pass test
setup data as either bytes or str.

The module operations.install.wheel also remains untouched as it is
especially delicate to bytes/str mixups and the current version is
working.
2020-12-27 07:56:18 -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 f32adaf09b Remove __future__ imports
Unnecessary since dropping Python 2.
2020-12-24 08:38:09 -08:00
Hugo van Kemenade 33f48e2b72 Replace more six 2020-12-22 10:22:20 +02:00
Hugo van Kemenade 817ee23051 Remove redundant Python 2.7 code 2020-12-22 09:06:26 +02:00
Paul Moore 40904e3a05 Remove --build-dir option, as per deprecation 2020-10-27 15:24:36 +00:00