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
extras
parameter 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:
Link
Wrapper for
pip
’sLink
class.- _hashes#
- _parsed_url#
- _path#
- cache_link_parsing#
- comes_from#
- egg_fragment#
- metadata_file_data#
- requires_python#
- yanked_reason#
- piptools._compat.pip_compat._normalize_comes_from_location(original_comes_from: str, /) str #
Convert a
comes_from
path to a posix-style path.This is the rewrite rule when
-r
or-c
appears incomes_from
data and the input path was absolute, meaning we should not relativize the locations.The
-r
or-c
qualifier 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_from
path to a relative posix path.This is the rewrite rule used when
-r
or-c
appears incomes_from
data with an absolute path.The
-r
or-c
qualifier 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_from
value for stdin.