PATH:
opt
/
cloudlinux
/
venv
/
lib
/
python3.11
/
site-packages
/
setuptools
from __future__ import annotations from collections.abc import Iterable, Iterator from functools import lru_cache from typing import TYPE_CHECKING, Callable, TypeVar, Union, overload import jaraco.text as text from packaging.requirements import Requirement if TYPE_CHECKING: from typing_extensions import TypeAlias _T = TypeVar("_T") _StrOrIter: TypeAlias = Union[str, Iterable[str]] parse_req: Callable[[str], Requirement] = lru_cache()(Requirement) # Setuptools parses the same requirement many times # (e.g. first for validation than for normalisation), # so it might be worth to cache. def parse_strings(strs: _StrOrIter) -> Iterator[str]: """ Yield requirement strings for each specification in `strs`. `strs` must be a string, or a (possibly-nested) iterable thereof. """ return text.join_continuation(map(text.drop_comment, text.yield_lines(strs))) # These overloads are only needed because of a mypy false-positive, pyright gets it right # https://github.com/python/mypy/issues/3737 @overload def parse(strs: _StrOrIter) -> Iterator[Requirement]: ... @overload def parse(strs: _StrOrIter, parser: Callable[[str], _T]) -> Iterator[_T]: ... def parse(strs: _StrOrIter, parser: Callable[[str], _T] = parse_req) -> Iterator[_T]: # type: ignore[assignment] """ Parse requirements. """ return map(parser, parse_strings(strs))
[-] windows_support.py
[open]
[-] cli.exe
[open]
[-] namespaces.py
[open]
[-] installer.py
[open]
[+]
..
[-] version.py
[open]
[-] gui-arm64.exe
[open]
[-] _shutil.py
[open]
[-] _scripts.py
[open]
[-] gui.exe
[open]
[+]
__pycache__
[+]
tests
[-] logging.py
[open]
[+]
config
[-] warnings.py
[open]
[-] _imp.py
[open]
[-] script (dev).tmpl
[open]
[+]
_distutils
[-] errors.py
[open]
[-] _core_metadata.py
[open]
[-] _static.py
[open]
[-] cli-32.exe
[open]
[-] monkey.py
[open]
[-] script.tmpl
[open]
[-] modified.py
[open]
[-] msvc.py
[open]
[-] cli-64.exe
[open]
[-] build_meta.py
[open]
[-] wheel.py
[open]
[-] launch.py
[open]
[-] gui-32.exe
[open]
[-] _entry_points.py
[open]
[-] glob.py
[open]
[-] _reqs.py
[open]
[-] archive_util.py
[open]
[-] unicode_utils.py
[open]
[-] gui-64.exe
[open]
[-] depends.py
[open]
[-] _path.py
[open]
[+]
command
[-] dist.py
[open]
[+]
_vendor
[-] __init__.py
[open]
[-] cli-arm64.exe
[open]
[-] extension.py
[open]
[-] discovery.py
[open]
[+]
compat
[-] _normalization.py
[open]
[-] _discovery.py
[open]
[-] _itertools.py
[open]
[-] _importlib.py
[open]