piptools._compat.pip_compat module#
- class piptools._compat.pip_compat.Distribution(key: 'str', version: 'str', requires: 'Iterable[Requirement]', direct_url: 'DirectUrl | None')#
Bases:
object- classmethod _from_importlib(dist: _ImportLibDist) Distribution#
Mimic pkg_resources.Distribution.requires for the case of no extras.
This doesn’t fulfill that API’s
extrasparameter but satisfies the needs of pip-tools.
- classmethod _from_pkg_resources(dist: Distribution) Distribution#
- classmethod from_pip_distribution(dist: BaseDistribution) Distribution#
- class piptools._compat.pip_compat.FileLink(url: str, comes_from: str | IndexContent | None = None, requires_python: str | None = None, yanked_reason: str | None = None, metadata_file_data: MetadataFile | None = None, cache_link_parsing: bool = True, hashes: Mapping[str, str] | None = None)#
Bases:
LinkWrapper for
pip’sLinkclass.- _hashes#
- _parsed_url#
- _path#
- cache_link_parsing#
- comes_from#
- egg_fragment#
- metadata_file_data#
- requires_python#
- yanked_reason#
- piptools._compat.pip_compat._is_remote_pip_uri(value: str) bool#
Test a string to see if it is a URI treated as a remote file in
pip. Specifically this means that it’s a ‘file’, ‘http’, or ‘https’ URI.The test is performed by trying a URL parse and reading the scheme.
- piptools._compat.pip_compat._normalize_comes_from_location(original_comes_from: str, /) str#
Convert a
comes_frompath to a posix-style path.This is the rewrite rule when
-ror-cappears incomes_fromdata and the input path was absolute, meaning we should not relativize the locations.The
-ror-cqualifier is retained, and the path is converted to posix style.
- piptools._compat.pip_compat._relativize_comes_from_location(original_comes_from: str, /) str#
Convert a
comes_frompath to a relative posix path.This is the rewrite rule used when
-ror-cappears incomes_fromdata with an absolute path.The
-ror-cqualifier is retained, the path is relativized with respect to the CWD, and the path is converted to posix style.
- piptools._compat.pip_compat._rewrite_comes_from_to_hardcoded_stdin_value(_: str, /) str#
Produce the hardcoded
comes_fromvalue for stdin.