Commit Graph

378 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 8f0ed32413 Redact URLs in Collecting... logs 2023-10-14 14:02:55 +02:00
Stéphane Bidoul ccc4bbcdfd Postpone some deprecation removals 2023-10-01 15:05:20 +02:00
Tzu-ping Chung 9ba2bb90fb Straighten up extra comps across metadata backends
The importlib.metadata and pkg_resources backends unfortunately
normalize extras differently, and we don't really want to continue using
the latter's logic (being partially lossy while still not compliant to
standards), so we add a new abstraction for the purpose.
2023-09-13 16:45:44 +08:00
Tzu-ping Chung 7127fc96f4 Prevent eager extra normalization
This removes extra normalization when metadata is loaded into the data
structures, so we can obtain the raw values later in the process during
resolution.

The change in match_markers is needed because this is relied on by the
legacy resolver. Since we removed eager normalization, we need to do
that when the extras are used instead to maintain compatibility.
2023-09-13 13:40:35 +08:00
Danny McClanahan 39da6e051a
use f-string in exception message 2023-08-14 07:57:37 -04:00
Danny McClanahan bfa8a5532d
clean up duplicated code 2023-08-14 07:57:37 -04:00
Shantanu a19ade74a5
Use strict optional checking in req_install.py (#11379)
* Use strict optional checking in req_install.py

Suggested by pradyunsg in #11374

Since half of the API of this class depends on self.req not being None,
it seems like we should just prevent users from passing None here.
However, I wasn't able to make that change.

Rather than sprinkle asserts everywhere, I added "checked" properties.
I find this less ad hoc and easier to adapt if e.g. we're able to make
self.req never None in the future.

There are now some code paths where we have asserts that we didn't
before. I relied on other type hints in pip's code base to be accurate.
If that is not the case and we actually relied on some function being
able to accept None when not typed as such, we may hit these asserts.
But hopefully tests would catch such a thing.

* news

* black

* inline asserts

* code review

* fix up merge issue

* fix specifier bug
2023-08-05 00:07:27 +01:00
Stéphane Bidoul 0621e5ad0d Add ireq.is_direct property, for readability 2023-04-16 12:01:04 +02:00
Stéphane Bidoul 4f3a4f7269
Merge pull request #11919 from sbidoul/deprecate-legacy-ignore-config-settings-sbi
Deprecate legacy projects ignoring config settings
2023-04-15 11:39:22 +02:00
Stéphane Bidoul efe2d27451 Further refactor is_wheel_from_cache 2023-04-14 08:12:33 +02:00
Stéphane Bidoul bd746e3136 Introduce ireq.cached_wheel_source_link 2023-04-14 08:03:49 +02:00
Stéphane Bidoul a6ef6485be Rename original_link_is_in_wheel_cache to is_wheel_from_cache
This more accurately reflects that it is not necessarily
related to original_link, original_link being the direct URL
link,
and the wheel cache can also be populated from sdists
URL discovered by the finder.
2023-04-14 08:03:48 +02:00
Stéphane Bidoul f5f0302516 Fix --require-hashes trusting link hashes
When a direct URL with hash is provided as a dependency, --require-hash
incorrectly considered the link hash as trusted.
2023-04-10 13:21:00 +02:00
Stéphane Bidoul 2ff2d0e375 Deprecate legacy projects ignoring config settings
In the future the presence of config settings will
auto enable pep517.
2023-04-02 18:56:47 +02:00
Stéphane Bidoul bc3feef9cc Remove setup.py install legacy 2023-03-31 09:47:09 +02:00
Stéphane Bidoul def5ba887e
Simplify direct_url.json generation (#11875) 2023-03-27 20:04:50 +01:00
Pradyun Gedam 78ab4cf071
Bump all linters other than mypy (#11901) 2023-03-27 20:03:11 +01:00
Stéphane Bidoul 2cf9db2b5d
Merge pull request #11861 from sbidoul/deprecate-build-global-option-sbi
Deprecate --build-option and --global-option
2023-03-27 17:52:53 +02:00
Stéphane Bidoul 82f1ff0adb Fix type of config_settings arguments 2023-03-27 14:01:36 +02:00
Stéphane Bidoul 6adb7af0aa Deprecate --build-option and --global-option 2023-03-27 11:56:16 +01:00
Stéphane Bidoul 7047330b0b Simplify check_legacy_setup_py_options 2023-03-18 15:26:43 +01:00
Stéphane Bidoul a04748db8e Remove support for the deprecated --install-options 2023-03-18 11:20:51 +01:00
Daniil Konovalenko ed7dbe9843 fix formatting 2023-01-14 12:27:51 +01:00
Daniil Konovalenko 53064079ed revert mypy comment 2023-01-14 12:27:51 +01:00
Daniil Konovalenko 254bdf8789 fallback to a placeholder in case dist.location is None 2023-01-14 12:27:51 +01:00
Pradyun Gedam fa4b2efbab
Replace `pep517` with `pyproject_hooks`
The `pep517` package has been superseded by a new package.
2022-12-28 20:13:57 +00:00
Stéphane Bidoul fe58a42521
Warn when --install-option is ignored
Due to building with pep 517.
2022-09-25 12:15:39 +02:00
Stéphane Bidoul a5621a8a81
Deprecate --install-option 2022-09-25 11:21:35 +02:00
Stéphane Bidoul ae802e3e66
Deprecate setup.py install fallback when wheel package is absent 2022-08-06 19:33:30 +02:00
Stéphane Bidoul 27878a52af
Refactor legacy_install_reason 2022-08-06 19:29:31 +02:00
Stéphane Bidoul e15e5191fa
Add wheel support to InstallRequirement.get_dist()
Before it did support only requirements that had their
metadata prepared to a local directory.
WIth wheels that does not happen so we need to
handle that case too.

get_dist() is used by the metadata property of InstallRequirement,
which in turn is useful to obtain metadata
of the RequirementSet returned by the resolver.
2022-06-23 19:33:18 +02:00
Stéphane Bidoul c6baa7514a
Add download_info to InstallRequirement 2022-05-22 22:46:35 +02:00
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