golden hour
/opt/alt/python37/lib/python3.7/site-packages/pip/_internal/utils
⬆️ Go Up
Upload
File/Folder
Size
Actions
__init__.py
0 B
Del
OK
__init__.pyc
164 B
Del
OK
__init__.pyo
164 B
Del
OK
__pycache__
-
Del
OK
appdirs.py
1.32 KB
Del
OK
appdirs.pyc
1.78 KB
Del
OK
appdirs.pyo
1.78 KB
Del
OK
compat.py
9.27 KB
Del
OK
compat.pyc
8.62 KB
Del
OK
compat.pyo
8.62 KB
Del
OK
compatibility_tags.py
5.31 KB
Del
OK
compatibility_tags.pyc
4.45 KB
Del
OK
compatibility_tags.pyo
4.45 KB
Del
OK
datetime.py
295 B
Del
OK
datetime.pyc
625 B
Del
OK
datetime.pyo
625 B
Del
OK
deprecation.py
3.24 KB
Del
OK
deprecation.pyc
3.44 KB
Del
OK
deprecation.pyo
3.44 KB
Del
OK
direct_url_helpers.py
4.26 KB
Del
OK
direct_url_helpers.pyc
3.37 KB
Del
OK
direct_url_helpers.pyo
3.24 KB
Del
OK
distutils_args.py
1.32 KB
Del
OK
distutils_args.pyc
1.6 KB
Del
OK
distutils_args.pyo
1.6 KB
Del
OK
encoding.py
1.25 KB
Del
OK
encoding.pyc
1.61 KB
Del
OK
encoding.pyo
1.56 KB
Del
OK
entrypoints.py
1.19 KB
Del
OK
entrypoints.pyc
1.47 KB
Del
OK
entrypoints.pyo
1.47 KB
Del
OK
filesystem.py
6.78 KB
Del
OK
filesystem.pyc
7.4 KB
Del
OK
filesystem.pyo
7.35 KB
Del
OK
filetypes.py
571 B
Del
OK
filetypes.pyc
792 B
Del
OK
filetypes.pyo
792 B
Del
OK
glibc.py
3.22 KB
Del
OK
glibc.pyc
2.19 KB
Del
OK
glibc.pyo
2.19 KB
Del
OK
hashes.py
4.57 KB
Del
OK
hashes.pyc
5.68 KB
Del
OK
hashes.pyo
5.68 KB
Del
OK
inject_securetransport.py
810 B
Del
OK
inject_securetransport.pyc
1.07 KB
Del
OK
inject_securetransport.pyo
1.07 KB
Del
OK
logging.py
12.79 KB
Del
OK
logging.pyc
11.6 KB
Del
OK
logging.pyo
11.6 KB
Del
OK
misc.py
27.67 KB
Del
OK
misc.pyc
32.2 KB
Del
OK
misc.pyo
32.2 KB
Del
OK
models.py
1.17 KB
Del
OK
models.pyc
2.55 KB
Del
OK
models.pyo
2.55 KB
Del
OK
packaging.py
2.96 KB
Del
OK
packaging.pyc
3.27 KB
Del
OK
packaging.pyo
3.27 KB
Del
OK
parallel.py
3.32 KB
Del
OK
parallel.pyc
3.62 KB
Del
OK
parallel.pyo
3.62 KB
Del
OK
pkg_resources.py
1.22 KB
Del
OK
pkg_resources.pyc
2.39 KB
Del
OK
pkg_resources.pyo
2.39 KB
Del
OK
setuptools_build.py
4.94 KB
Del
OK
setuptools_build.pyc
3.83 KB
Del
OK
setuptools_build.pyo
3.75 KB
Del
OK
subprocess.py
9.69 KB
Del
OK
subprocess.pyc
6.77 KB
Del
OK
subprocess.pyo
6.69 KB
Del
OK
temp_dir.py
8.18 KB
Del
OK
temp_dir.pyc
8.75 KB
Del
OK
temp_dir.pyo
8.62 KB
Del
OK
typing.py
1.37 KB
Del
OK
typing.pyc
1.52 KB
Del
OK
typing.pyo
1.52 KB
Del
OK
unpacking.py
9.27 KB
Del
OK
unpacking.pyc
7.83 KB
Del
OK
unpacking.pyo
7.79 KB
Del
OK
urls.py
1.49 KB
Del
OK
urls.pyc
1.94 KB
Del
OK
urls.pyo
1.8 KB
Del
OK
virtualenv.py
3.62 KB
Del
OK
virtualenv.pyc
4.11 KB
Del
OK
virtualenv.pyo
4.11 KB
Del
OK
wheel.py
7.13 KB
Del
OK
wheel.pyc
7.27 KB
Del
OK
wheel.pyo
7.27 KB
Del
OK
Edit: packaging.py
from __future__ import absolute_import import logging from email.parser import FeedParser from pip._vendor import pkg_resources from pip._vendor.packaging import specifiers, version from pip._internal.exceptions import NoneMetadataError from pip._internal.utils.misc import display_path from pip._internal.utils.typing import MYPY_CHECK_RUNNING if MYPY_CHECK_RUNNING: from typing import Optional, Tuple from email.message import Message from pip._vendor.pkg_resources import Distribution logger = logging.getLogger(__name__) def check_requires_python(requires_python, version_info): # type: (Optional[str], Tuple[int, ...]) -> bool """ Check if the given Python version matches a "Requires-Python" specifier. :param version_info: A 3-tuple of ints representing a Python major-minor-micro version to check (e.g. `sys.version_info[:3]`). :return: `True` if the given Python version satisfies the requirement. Otherwise, return `False`. :raises InvalidSpecifier: If `requires_python` has an invalid format. """ if requires_python is None: # The package provides no information return True requires_python_specifier = specifiers.SpecifierSet(requires_python) python_version = version.parse('.'.join(map(str, version_info))) return python_version in requires_python_specifier def get_metadata(dist): # type: (Distribution) -> Message """ :raises NoneMetadataError: if the distribution reports `has_metadata()` True but `get_metadata()` returns None. """ metadata_name = 'METADATA' if (isinstance(dist, pkg_resources.DistInfoDistribution) and dist.has_metadata(metadata_name)): metadata = dist.get_metadata(metadata_name) elif dist.has_metadata('PKG-INFO'): metadata_name = 'PKG-INFO' metadata = dist.get_metadata(metadata_name) else: logger.warning("No metadata found in %s", display_path(dist.location)) metadata = '' if metadata is None: raise NoneMetadataError(dist, metadata_name) feed_parser = FeedParser() # The following line errors out if with a "NoneType" TypeError if # passed metadata=None. feed_parser.feed(metadata) return feed_parser.close() def get_requires_python(dist): # type: (pkg_resources.Distribution) -> Optional[str] """ Return the "Requires-Python" metadata for a distribution, or None if not present. """ pkg_info_dict = get_metadata(dist) requires_python = pkg_info_dict.get('Requires-Python') if requires_python is not None: # Convert to a str to satisfy the type checker, since requires_python # can be a Header object. requires_python = str(requires_python) return requires_python def get_installer(dist): # type: (Distribution) -> str if dist.has_metadata('INSTALLER'): for line in dist.get_metadata_lines('INSTALLER'): if line.strip(): return line.strip() return ''
Save