Let us walk on the 3-isogeny graph
Loading...
Searching...
No Matches
pip._vendor.pkg_resources Namespace Reference

Data Structures

class  _ReqExtras
 
class  ContextualVersionConflict
 
class  DefaultProvider
 
class  DistInfoDistribution
 
class  Distribution
 
class  DistributionNotFound
 
class  EggInfoDistribution
 
class  EggMetadata
 
class  EggProvider
 
class  EmptyProvider
 
class  EntryPoint
 
class  Environment
 
class  ExtractionError
 
class  FileMetadata
 
class  IMetadataProvider
 
class  IResourceProvider
 
class  MemoizedZipManifests
 
class  NoDists
 
class  NullProvider
 
class  PathMetadata
 
class  PEP440Warning
 
class  PkgResourcesDeprecationWarning
 
class  Requirement
 
class  RequirementParseError
 
class  ResolutionError
 
class  ResourceManager
 
class  UnknownExtra
 
class  VersionConflict
 
class  WorkingSet
 
class  ZipManifests
 
class  ZipProvider
 

Functions

 _declare_state (vartype, **kw)
 
 __getstate__ ()
 
 __setstate__ (state)
 
 _sget_dict (val)
 
 _sset_dict (key, ob, state)
 
 _sget_object (val)
 
 _sset_object (key, ob, state)
 
 get_supported_platform ()
 
 register_loader_type (loader_type, provider_factory)
 
 get_provider (moduleOrReq)
 
 _macos_vers (_cache=[])
 
 _macos_arch (machine)
 
 get_build_platform ()
 
 compatible_platforms (provided, required)
 
 run_script (dist_spec, script_name)
 
 get_distribution (dist)
 
 load_entry_point (dist, group, name)
 
 get_entry_map (dist, group=None)
 
 get_entry_info (dist, group, name)
 
 get_default_cache ()
 
 safe_name (name)
 
 safe_version (version)
 
 _forgiving_version (version)
 
 _safe_segment (segment)
 
 safe_extra (extra)
 
 to_filename (name)
 
 invalid_marker (text)
 
 evaluate_marker (text, extra=None)
 
 _parents (path)
 
 register_finder (importer_type, distribution_finder)
 
 find_distributions (path_item, only=False)
 
 find_eggs_in_zip (importer, path_item, only=False)
 
 find_nothing (importer, path_item, only=False)
 
 find_on_path (importer, path_item, only=False)
 
 dist_factory (path_item, entry, only)
 
 safe_listdir (path)
 
 distributions_from_metadata (path)
 
 non_empty_lines (path)
 
 resolve_egg_link (path)
 
 register_namespace_handler (importer_type, namespace_handler)
 
 _handle_ns (packageName, path_item)
 
 _rebuild_mod_path (orig_path, package_name, module)
 
 declare_namespace (packageName)
 
 fixup_namespace_packages (path_item, parent=None)
 
 file_ns_handler (importer, path_item, packageName, module)
 
 null_ns_handler (importer, path_item, packageName, module)
 
 normalize_path (filename)
 
 _cygwin_patch (filename)
 
 _normalize_cached (filename, _cache={})
 
 _is_egg_path (path)
 
 _is_zip_egg (path)
 
 _is_unpacked_egg (path)
 
 _set_parent_ns (packageName)
 
 _version_from_file (lines)
 
 issue_warning (*args, **kw)
 
 parse_requirements (strs)
 
 _always_object (classes)
 
 _find_adapter (registry, ob)
 
 ensure_directory (path)
 
 _bypass_ensure_directory (path)
 
 split_sections (s)
 
 _mkstemp (*args, **kw)
 
 _call_aside (f, *args, **kwargs)
 
 _initialize (g=globals())
 
 _initialize_master_working_set ()
 

Variables

 FileExistsError = OSError
 
bool WRITE_SUPPORT = True
 
 importlib_machinery = None
 
 require = None
 
 working_set = None
 
 add_activation_listener = None
 
 resources_stream = None
 
 cleanup_resources = None
 
 resource_dir = None
 
 resource_stream = None
 
 set_extraction_path = None
 
 resource_isdir = None
 
 resource_string = None
 
 iter_entry_points = None
 
 resource_listdir = None
 
 resource_filename = None
 
 resource_exists = None
 
 _distribution_finders = None
 
 _namespace_handlers = None
 
 _namespace_packages = None
 
 stacklevel
 
 _PEP440_FALLBACK = re.compile(r"^v?(?P<safe>(?:[0-9]+!)?[0-9]+(?:\.[0-9]+)*)", re.I)
 
 parse_version = packaging.version.Version
 
dict _state_vars = {}
 
None _sget_none = lambda *args
 
dict _provider_factories = {}
 
str PY_MAJOR = '{}.{}'.format(*sys.version_info)
 
int EGG_DIST = 3
 
int BINARY_DIST = 2
 
int SOURCE_DIST = 1
 
int CHECKOUT_DIST = 0
 
int DEVELOP_DIST = -1
 
 macosVersionString = re.compile(r"macosx-(\d+)\.(\d+)-(.*)")
 
 darwinVersionString = re.compile(r"darwin-(\d+)\.(\d+)\.(\d+)-(.*)")
 
 get_platform = get_build_platform
 
 run_main = run_script
 
 AvailableDistributions = Environment
 
 empty_provider = EmptyProvider()
 
 MODULE = re.compile(r"\w+(\.\w+)*$").match
 
 EGG_NAME
 
dict _distributionImpl
 
 category
 
 PEP440Warning
 
 append
 

Detailed Description

Package resource API
--------------------

A resource is a logical file contained within a package, or a logical
subdirectory thereof.  The package resource API expects resource names
to have their path parts separated with ``/``, *not* whatever the local
path separator is.  Do not use os.path operations to manipulate resource
names being passed into the API.

The package resource API is designed to work with normal filesystem packages,
.egg files, and unpacked .egg files.  It can also work in a limited way with
.zip files and with custom PEP 302 loaders that support the ``get_data()``
method.

This module is deprecated. Users are directed to :mod:`importlib.resources`,
:mod:`importlib.metadata` and :pypi:`packaging` instead.

Function Documentation

◆ __getstate__()

__getstate__ ( )

Definition at line 147 of file __init__.py.

147def __getstate__():
148 state = {}
149 g = globals()
150 for k, v in _state_vars.items():
151 state[k] = g['_sget_' + v](g[k])
152 return state
153
154
for i

References i.

◆ __setstate__()

__setstate__ (   state)

Definition at line 155 of file __init__.py.

155def __setstate__(state):
156 g = globals()
157 for k, v in state.items():
158 g['_sset_' + _state_vars[k]](k, g[k], v)
159 return state
160
161

References i.

◆ _always_object()

_always_object (   classes)
protected
Ensure object appears in the mro even
for old-style classes.

Definition at line 3219 of file __init__.py.

3219def _always_object(classes):
3220 """
3221 Ensure object appears in the mro even
3222 for old-style classes.
3223 """
3224 if object not in classes:
3225 return classes + (object,)
3226 return classes
3227
3228

◆ _bypass_ensure_directory()

_bypass_ensure_directory (   path)
protected
Sandbox-bypassing version of ensure_directory()

Definition at line 3243 of file __init__.py.

3243def _bypass_ensure_directory(path):
3244 """Sandbox-bypassing version of ensure_directory()"""
3245 if not WRITE_SUPPORT:
3246 raise IOError('"os.mkdir" not supported on this platform.')
3247 dirname, filename = split(path)
3248 if dirname and filename and not isdir(dirname):
3249 _bypass_ensure_directory(dirname)
3250 try:
3251 mkdir(dirname, 0o755)
3252 except FileExistsError:
3253 pass
3254
3255

◆ _call_aside()

_call_aside (   f,
args,
**  kwargs 
)
protected

Definition at line 3301 of file __init__.py.

3301def _call_aside(f, *args, **kwargs):
3302 f(*args, **kwargs)
3303 return f
3304
3305
3306@_call_aside

◆ _cygwin_patch()

_cygwin_patch (   filename)
protected
Contrary to POSIX 2008, on Cygwin, getcwd (3) contains
symlink components. Using
os.path.abspath() works around this limitation. A fix in os.getcwd()
would probably better, in Cygwin even more so, except
that this seems to be by design...

Definition at line 2416 of file __init__.py.

2416def _cygwin_patch(filename): # pragma: nocover
2417 """
2418 Contrary to POSIX 2008, on Cygwin, getcwd (3) contains
2419 symlink components. Using
2420 os.path.abspath() works around this limitation. A fix in os.getcwd()
2421 would probably better, in Cygwin even more so, except
2422 that this seems to be by design...
2423 """
2424 return os.path.abspath(filename) if sys.platform == 'cygwin' else filename
2425
2426

◆ _declare_state()

_declare_state (   vartype,
**  kw 
)
protected

Definition at line 142 of file __init__.py.

142def _declare_state(vartype, **kw):
143 globals().update(kw)
145
146

References i.

◆ _find_adapter()

_find_adapter (   registry,
  ob 
)
protected
Return an adapter factory for `ob` from `registry`

Definition at line 3229 of file __init__.py.

3229def _find_adapter(registry, ob):
3230 """Return an adapter factory for `ob` from `registry`"""
3231 types = _always_object(inspect.getmro(getattr(ob, '__class__', type(ob))))
3232 for t in types:
3233 if t in registry:
3234 return registry[t]
3235
3236

Referenced by pip._vendor.pkg_resources.get_provider().

Here is the caller graph for this function:

◆ _forgiving_version()

_forgiving_version (   version)
protected
Fallback when ``safe_version`` is not safe enough
>>> parse_version(_forgiving_version('0.23ubuntu1'))
<Version('0.23.dev0+sanitized.ubuntu1')>
>>> parse_version(_forgiving_version('0.23-'))
<Version('0.23.dev0+sanitized')>
>>> parse_version(_forgiving_version('0.-_'))
<Version('0.dev0+sanitized')>
>>> parse_version(_forgiving_version('42.+?1'))
<Version('42.dev0+sanitized.1')>
>>> parse_version(_forgiving_version('hello world'))
<Version('0.dev0+sanitized.hello.world')>

Definition at line 1404 of file __init__.py.

1404def _forgiving_version(version):
1405 """Fallback when ``safe_version`` is not safe enough
1406 >>> parse_version(_forgiving_version('0.23ubuntu1'))
1407 <Version('0.23.dev0+sanitized.ubuntu1')>
1408 >>> parse_version(_forgiving_version('0.23-'))
1409 <Version('0.23.dev0+sanitized')>
1410 >>> parse_version(_forgiving_version('0.-_'))
1411 <Version('0.dev0+sanitized')>
1412 >>> parse_version(_forgiving_version('42.+?1'))
1413 <Version('42.dev0+sanitized.1')>
1414 >>> parse_version(_forgiving_version('hello world'))
1415 <Version('0.dev0+sanitized.hello.world')>
1416 """
1417 version = version.replace(' ', '.')
1418 match = _PEP440_FALLBACK.search(version)
1419 if match:
1420 safe = match["safe"]
1421 rest = version[len(safe):]
1422 else:
1423 safe = "0"
1424 rest = version
1425 local = f"sanitized.{_safe_segment(rest)}".strip(".")
1426 return f"{safe}.dev0+{local}"
1427
1428

◆ _handle_ns()

_handle_ns (   packageName,
  path_item 
)
protected
Ensure that named package includes a subpath of path_item (if needed)

Definition at line 2258 of file __init__.py.

2258def _handle_ns(packageName, path_item):
2259 """Ensure that named package includes a subpath of path_item (if needed)"""
2260
2261 importer = get_importer(path_item)
2262 if importer is None:
2263 return None
2264
2265 # use find_spec (PEP 451) and fall-back to find_module (PEP 302)
2266 try:
2267 spec = importer.find_spec(packageName)
2268 except AttributeError:
2269 # capture warnings due to #1111
2271 warnings.simplefilter("ignore")
2272 loader = importer.find_module(packageName)
2273 else:
2274 loader = spec.loader if spec else None
2275
2276 if loader is None:
2277 return None
2278 module = sys.modules.get(packageName)
2279 if module is None:
2280 module = sys.modules[packageName] = types.ModuleType(packageName)
2281 module.__path__ = []
2282 _set_parent_ns(packageName)
2283 elif not hasattr(module, '__path__'):
2284 raise TypeError("Not a package:", packageName)
2285 handler = _find_adapter(_namespace_handlers, importer)
2286 subpath = handler(importer, path_item, packageName, module)
2287 if subpath is not None:
2288 path = module.__path__
2289 path.append(subpath)
2290 importlib.import_module(packageName)
2291 _rebuild_mod_path(path, packageName, module)
2292 return subpath
2293
2294

◆ _initialize()

_initialize (   g = globals())
protected

Definition at line 3307 of file __init__.py.

3307def _initialize(g=globals()):
3308 "Set up global resource manager (deliberately not state-saved)"
3309 manager = ResourceManager()
3310 g['_manager'] = manager
3311 g.update(
3312 (name, getattr(manager, name))
3313 for name in dir(manager)
3314 if not name.startswith('_')
3315 )
3316
3317

◆ _initialize_master_working_set()

_initialize_master_working_set ( )
protected
Prepare the master working set and make the ``require()``
API available.

This function has explicit effects on the global state
of pkg_resources. It is intended to be invoked once at
the initialization of this module.

Invocation by other packages is unsupported and done
at their own risk.

Definition at line 3328 of file __init__.py.

3328def _initialize_master_working_set():
3329 """
3330 Prepare the master working set and make the ``require()``
3331 API available.
3332
3333 This function has explicit effects on the global state
3334 of pkg_resources. It is intended to be invoked once at
3335 the initialization of this module.
3336
3337 Invocation by other packages is unsupported and done
3338 at their own risk.
3339 """
3340 working_set = WorkingSet._build_master()
3341 _declare_state('object', working_set=working_set)
3342
3343 require = working_set.require
3344 iter_entry_points = working_set.iter_entry_points
3345 add_activation_listener = working_set.subscribe
3346 run_script = working_set.run_script
3347 # backward compatibility
3348 run_main = run_script
3349 # Activate all distributions already on sys.path with replace=False and
3350 # ensure that all distributions added to the working set in the future
3351 # (e.g. by calling ``require()``) will get activated as well,
3352 # with higher priority (replace=True).
3353 tuple(dist.activate(replace=False) for dist in working_set)
3354 add_activation_listener(
3355 lambda dist: dist.activate(replace=True),
3356 existing=False,
3357 )
3359 # match order
3361 globals().update(locals())

◆ _is_egg_path()

_is_egg_path (   path)
protected
Determine if given path appears to be an egg.

Definition at line 2435 of file __init__.py.

2435def _is_egg_path(path):
2436 """
2437 Determine if given path appears to be an egg.
2438 """
2439 return _is_zip_egg(path) or _is_unpacked_egg(path)
2440
2441

◆ _is_unpacked_egg()

_is_unpacked_egg (   path)
protected
Determine if given path appears to be an unpacked egg.

Definition at line 2450 of file __init__.py.

2450def _is_unpacked_egg(path):
2451 """
2452 Determine if given path appears to be an unpacked egg.
2453 """
2454 return path.lower().endswith('.egg') and os.path.isfile(
2455 os.path.join(path, 'EGG-INFO', 'PKG-INFO')
2456 )
2457
2458

◆ _is_zip_egg()

_is_zip_egg (   path)
protected

Definition at line 2442 of file __init__.py.

2442def _is_zip_egg(path):
2443 return (
2444 path.lower().endswith('.egg')
2445 and os.path.isfile(path)
2446 and zipfile.is_zipfile(path)
2447 )
2448
2449

◆ _macos_arch()

_macos_arch (   machine)
protected

Definition at line 426 of file __init__.py.

426def _macos_arch(machine):
427 return {'PowerPC': 'ppc', 'Power_Macintosh': 'ppc'}.get(machine, machine)
428
429

Referenced by pip._vendor.pkg_resources.get_build_platform().

Here is the caller graph for this function:

◆ _macos_vers()

_macos_vers (   _cache = [])
protected

Definition at line 410 of file __init__.py.

410def _macos_vers(_cache=[]):
411 if not _cache:
412 version = platform.mac_ver()[0]
413 # fallback for MacPorts
414 if version == '':
415 plist = '/System/Library/CoreServices/SystemVersion.plist'
416 if os.path.exists(plist):
417 if hasattr(plistlib, 'readPlist'):
418 plist_content = plistlib.readPlist(plist)
419 if 'ProductVersion' in plist_content:
420 version = plist_content['ProductVersion']
421
423 return _cache[0]
424
425

References i.

Referenced by pip._vendor.pkg_resources.get_build_platform(), and pip._vendor.pkg_resources.get_supported_platform().

Here is the caller graph for this function:

◆ _mkstemp()

_mkstemp ( args,
**  kw 
)
protected

Definition at line 3282 of file __init__.py.

3282def _mkstemp(*args, **kw):
3283 old_open = os.open
3284 try:
3285 # temporarily bypass sandboxing
3286 os.open = os_open
3287 return tempfile.mkstemp(*args, **kw)
3288 finally:
3289 # and then put it back
3290 os.open = old_open
3291
3292
3293# Silence the PEP440Warning by default, so that end users don't get hit by it
3294# randomly just because they use pkg_resources. We want to append the rule
3295# because we want earlier uses of filterwarnings to take precedence over this
3296# one.

◆ _normalize_cached()

_normalize_cached (   filename,
  _cache = {} 
)
protected

Definition at line 2427 of file __init__.py.

2427def _normalize_cached(filename, _cache={}):
2428 try:
2429 return _cache[filename]
2430 except KeyError:
2431 _cache[filename] = result = normalize_path(filename)
2432 return result
2433
2434

◆ _parents()

_parents (   path)
protected
yield all parents of path including path

Definition at line 1680 of file __init__.py.

1680def _parents(path):
1681 """
1682 yield all parents of path including path
1683 """
1684 last = None
1685 while path != last:
1686 yield path
1687 last = path
1688 path, _ = os.path.split(path)
1689
1690

◆ _rebuild_mod_path()

_rebuild_mod_path (   orig_path,
  package_name,
  module 
)
protected
Rebuild module.__path__ ensuring that all entries are ordered
corresponding to their sys.path order

Definition at line 2295 of file __init__.py.

2295def _rebuild_mod_path(orig_path, package_name, module):
2296 """
2297 Rebuild module.__path__ ensuring that all entries are ordered
2298 corresponding to their sys.path order
2299 """
2300 sys_path = [_normalize_cached(p) for p in sys.path]
2301
2302 def safe_sys_path_index(entry):
2303 """
2304 Workaround for #520 and #513.
2305 """
2306 try:
2307 return sys_path.index(entry)
2308 except ValueError:
2309 return float('inf')
2310
2311 def position_in_sys_path(path):
2312 """
2313 Return the ordinal of the path based on its position in sys.path
2314 """
2315 path_parts = path.split(os.sep)
2316 module_parts = package_name.count('.') + 1
2317 parts = path_parts[:-module_parts]
2318 return safe_sys_path_index(_normalize_cached(os.sep.join(parts)))
2319
2320 new_path = sorted(orig_path, key=position_in_sys_path)
2321 new_path = [_normalize_cached(p) for p in new_path]
2322
2323 if isinstance(module.__path__, list):
2324 module.__path__[:] = new_path
2325 else:
2326 module.__path__ = new_path
2327
2328

◆ _safe_segment()

_safe_segment (   segment)
protected
Convert an arbitrary string into a safe segment

Definition at line 1429 of file __init__.py.

1429def _safe_segment(segment):
1430 """Convert an arbitrary string into a safe segment"""
1431 segment = re.sub('[^A-Za-z0-9.]+', '-', segment)
1432 segment = re.sub('-[^A-Za-z0-9]+', '-', segment)
1433 return re.sub(r'\.[^A-Za-z0-9]+', '.', segment).strip(".-")
1434
1435

◆ _set_parent_ns()

_set_parent_ns (   packageName)
protected

Definition at line 2459 of file __init__.py.

2459def _set_parent_ns(packageName):
2460 parts = packageName.split('.')
2461 name = parts.pop()
2462 if parts:
2463 parent = '.'.join(parts)
2464 setattr(sys.modules[parent], name, sys.modules[packageName])
2465
2466

◆ _sget_dict()

_sget_dict (   val)
protected

Definition at line 162 of file __init__.py.

162def _sget_dict(val):
163 return val.copy()
164
165

References i.

◆ _sget_object()

_sget_object (   val)
protected

Definition at line 171 of file __init__.py.

171def _sget_object(val):
172 return val.__getstate__()
173
174

References i.

◆ _sset_dict()

_sset_dict (   key,
  ob,
  state 
)
protected

Definition at line 166 of file __init__.py.

166def _sset_dict(key, ob, state):
167 ob.clear()
168 ob.update(state)
169
170

References i.

◆ _sset_object()

_sset_object (   key,
  ob,
  state 
)
protected

Definition at line 175 of file __init__.py.

175def _sset_object(key, ob, state):
176 ob.__setstate__(state)
177
178

References i.

◆ _version_from_file()

_version_from_file (   lines)
protected
Given an iterable of lines from a Metadata file, return
the value of the Version field, if present, or None otherwise.

Definition at line 2614 of file __init__.py.

2614def _version_from_file(lines):
2615 """
2616 Given an iterable of lines from a Metadata file, return
2617 the value of the Version field, if present, or None otherwise.
2618 """
2619
2620 def is_version_line(line):
2621 return line.lower().startswith('version:')
2622
2623 version_lines = filter(is_version_line, lines)
2624 line = next(iter(version_lines), '')
2625 _, _, value = line.partition(':')
2626 return safe_version(value.strip()) or None
2627
2628

◆ compatible_platforms()

compatible_platforms (   provided,
  required 
)
Can code for the `provided` platform run on the `required` platform?

Returns true if either platform is ``None``, or the platforms are equal.

XXX Needs compatibility checks for Linux and other unixy OSes.

Definition at line 461 of file __init__.py.

461def compatible_platforms(provided, required):
462 """Can code for the `provided` platform run on the `required` platform?
463
464 Returns true if either platform is ``None``, or the platforms are equal.
465
466 XXX Needs compatibility checks for Linux and other unixy OSes.
467 """
468 if provided is None or required is None or provided == required:
469 # easy case
470 return True
471
472 # macOS special cases
473 reqMac = macosVersionString.match(required)
474 if reqMac:
475 provMac = macosVersionString.match(provided)
476
477 # is this a Mac package?
478 if not provMac:
479 # this is backwards compatibility for packages built before
480 # setuptools 0.6. All packages built after this point will
481 # use the new macOS designation.
482 provDarwin = darwinVersionString.match(provided)
483 if provDarwin:
484 dversion = int(provDarwin.group(1))
485 macosversion = "%s.%s" % (reqMac.group(1), reqMac.group(2))
486 if (
487 dversion == 7
488 and macosversion >= "10.3"
489 or dversion == 8
490 and macosversion >= "10.4"
491 ):
492 return True
493 # egg isn't macOS or legacy darwin
494 return False
495
496 # are they the same major version and machine type?
498 return False
499
500 # is the required OS major update >= the provided one?
501 if int(provMac.group(2)) > int(reqMac.group(2)):
502 return False
503
504 return True
505
506 # XXX Linux and other platforms' special cases should go here
507 return False
508
509

References i.

◆ declare_namespace()

declare_namespace (   packageName)
Declare that package 'packageName' is a namespace package

Definition at line 2329 of file __init__.py.

2329def declare_namespace(packageName):
2330 """Declare that package 'packageName' is a namespace package"""
2331
2332 msg = (
2333 f"Deprecated call to `pkg_resources.declare_namespace({packageName!r})`.\n"
2334 "Implementing implicit namespace packages (as specified in PEP 420) "
2335 "is preferred to `pkg_resources.declare_namespace`. "
2336 "See https://setuptools.pypa.io/en/latest/references/"
2337 "keywords.html#keyword-namespace-packages"
2338 )
2339 warnings.warn(msg, DeprecationWarning, stacklevel=2)
2340
2342 try:
2343 if packageName in _namespace_packages:
2344 return
2345
2346 path = sys.path
2347 parent, _, _ = packageName.rpartition('.')
2348
2349 if parent:
2350 declare_namespace(parent)
2351 if parent not in _namespace_packages:
2352 __import__(parent)
2353 try:
2354 path = sys.modules[parent].__path__
2355 except AttributeError as e:
2356 raise TypeError("Not a package:", parent) from e
2357
2358 # Track what packages are namespaces, so when new path items are added,
2359 # they can be updated
2360 _namespace_packages.setdefault(parent or None, []).append(packageName)
2361 _namespace_packages.setdefault(packageName, [])
2362
2363 for path_item in path:
2364 # Ensure all the parent's path items are reflected in the child,
2365 # if they apply
2366 _handle_ns(packageName, path_item)
2367
2368 finally:
2370
2371

◆ dist_factory()

dist_factory (   path_item,
  entry,
  only 
)
Return a dist_factory for the given entry.

Definition at line 2138 of file __init__.py.

2138def dist_factory(path_item, entry, only):
2139 """Return a dist_factory for the given entry."""
2140 lower = entry.lower()
2141 is_egg_info = lower.endswith('.egg-info')
2142 is_dist_info = lower.endswith('.dist-info') and os.path.isdir(
2143 os.path.join(path_item, entry)
2144 )
2145 is_meta = is_egg_info or is_dist_info
2146 return (
2147 distributions_from_metadata
2148 if is_meta
2149 else find_distributions
2150 if not only and _is_egg_path(entry)
2151 else resolve_egg_link
2152 if not only and lower.endswith('.egg-link')
2153 else NoDists()
2154 )
2155
2156

◆ distributions_from_metadata()

distributions_from_metadata (   path)

Definition at line 2189 of file __init__.py.

2189def distributions_from_metadata(path):
2190 root = os.path.dirname(path)
2191 if os.path.isdir(path):
2192 if len(os.listdir(path)) == 0:
2193 # empty metadata dir; skip
2194 return
2195 metadata = PathMetadata(root, path)
2196 else:
2197 metadata = FileMetadata(path)
2198 entry = os.path.basename(path)
2200 root,
2201 entry,
2202 metadata,
2203 precedence=DEVELOP_DIST,
2204 )
2205
2206

◆ ensure_directory()

ensure_directory (   path)
Ensure that the parent directory of `path` exists

Definition at line 3237 of file __init__.py.

3237def ensure_directory(path):
3238 """Ensure that the parent directory of `path` exists"""
3239 dirname = os.path.dirname(path)
3240 os.makedirs(dirname, exist_ok=True)
3241
3242

◆ evaluate_marker()

evaluate_marker (   text,
  extra = None 
)
Evaluate a PEP 508 environment marker.
Return a boolean indicating the marker result in this environment.
Raise SyntaxError if marker is invalid.

This implementation uses the 'pyparsing' module.

Definition at line 1467 of file __init__.py.

1467def evaluate_marker(text, extra=None):
1468 """
1469 Evaluate a PEP 508 environment marker.
1470 Return a boolean indicating the marker result in this environment.
1471 Raise SyntaxError if marker is invalid.
1472
1473 This implementation uses the 'pyparsing' module.
1474 """
1475 try:
1476 marker = packaging.markers.Marker(text)
1477 return marker.evaluate()
1479 raise SyntaxError(e) from e
1480
1481

◆ file_ns_handler()

file_ns_handler (   importer,
  path_item,
  packageName,
  module 
)
Compute an ns-package subpath for a filesystem or zipfile importer

Definition at line 2384 of file __init__.py.

2384def file_ns_handler(importer, path_item, packageName, module):
2385 """Compute an ns-package subpath for a filesystem or zipfile importer"""
2386
2387 subpath = os.path.join(path_item, packageName.split('.')[-1])
2388 normalized = _normalize_cached(subpath)
2389 for item in module.__path__:
2390 if _normalize_cached(item) == normalized:
2391 break
2392 else:
2393 # Only return the path if it's not already there
2394 return subpath
2395
2396

◆ find_distributions()

find_distributions (   path_item,
  only = False 
)
Yield distributions accessible via `path_item`

Definition at line 2073 of file __init__.py.

2073def find_distributions(path_item, only=False):
2074 """Yield distributions accessible via `path_item`"""
2075 importer = get_importer(path_item)
2076 finder = _find_adapter(_distribution_finders, importer)
2077 return finder(importer, path_item, only)
2078
2079

◆ find_eggs_in_zip()

find_eggs_in_zip (   importer,
  path_item,
  only = False 
)
Find eggs in zip files; possibly multiple nested eggs.

Definition at line 2080 of file __init__.py.

2080def find_eggs_in_zip(importer, path_item, only=False):
2081 """
2082 Find eggs in zip files; possibly multiple nested eggs.
2083 """
2084 if importer.archive.endswith('.whl'):
2085 # wheels are not supported with this finder
2086 # they don't have PKG-INFO metadata, and won't ever contain eggs
2087 return
2088 metadata = EggMetadata(importer)
2089 if metadata.has_metadata('PKG-INFO'):
2090 yield Distribution.from_filename(path_item, metadata=metadata)
2091 if only:
2092 # don't yield nested distros
2093 return
2094 for subitem in metadata.resource_listdir(''):
2095 if _is_egg_path(subitem):
2096 subpath = os.path.join(path_item, subitem)
2097 dists = find_eggs_in_zip(zipimport.zipimporter(subpath), subpath)
2098 for dist in dists:
2099 yield dist
2100 elif subitem.lower().endswith(('.dist-info', '.egg-info')):
2101 subpath = os.path.join(path_item, subitem)
2102 submeta = EggMetadata(zipimport.zipimporter(subpath))
2103 submeta.egg_info = subpath
2104 yield Distribution.from_location(path_item, subitem, submeta)
2105
2106

◆ find_nothing()

find_nothing (   importer,
  path_item,
  only = False 
)

Definition at line 2110 of file __init__.py.

2110def find_nothing(importer, path_item, only=False):
2111 return ()
2112
2113

◆ find_on_path()

find_on_path (   importer,
  path_item,
  only = False 
)
Yield distributions accessible on a sys.path directory

Definition at line 2117 of file __init__.py.

2117def find_on_path(importer, path_item, only=False):
2118 """Yield distributions accessible on a sys.path directory"""
2119 path_item = _normalize_cached(path_item)
2120
2121 if _is_unpacked_egg(path_item):
2123 path_item,
2124 metadata=PathMetadata(path_item, os.path.join(path_item, 'EGG-INFO')),
2125 )
2126 return
2127
2128 entries = (os.path.join(path_item, child) for child in safe_listdir(path_item))
2129
2130 # scan for .egg and .egg-info in directory
2131 for entry in sorted(entries):
2132 fullpath = os.path.join(path_item, entry)
2133 factory = dist_factory(path_item, entry, only)
2134 for dist in factory(fullpath):
2135 yield dist
2136
2137

◆ fixup_namespace_packages()

fixup_namespace_packages (   path_item,
  parent = None 
)
Ensure that previously-declared namespace packages include path_item

Definition at line 2372 of file __init__.py.

2372def fixup_namespace_packages(path_item, parent=None):
2373 """Ensure that previously-declared namespace packages include path_item"""
2375 try:
2376 for package in _namespace_packages.get(parent, ()):
2377 subpath = _handle_ns(package, path_item)
2378 if subpath:
2379 fixup_namespace_packages(subpath, package)
2380 finally:
2382
2383

◆ get_build_platform()

get_build_platform ( )
Return this platform's string for platform-specific distributions

XXX Currently this is the same as ``distutils.util.get_platform()``, but it
needs some hacks for Linux and macOS.

Definition at line 430 of file __init__.py.

430def get_build_platform():
431 """Return this platform's string for platform-specific distributions
432
433 XXX Currently this is the same as ``distutils.util.get_platform()``, but it
434 needs some hacks for Linux and macOS.
435 """
436 from sysconfig import get_platform
437
438 plat = get_platform()
439 if sys.platform == "darwin" and not plat.startswith('macosx-'):
440 try:
441 version = _macos_vers()
442 machine = os.uname()[4].replace(" ", "_")
443 return "macosx-%d.%d-%s" % (
444 int(version[0]),
445 int(version[1]),
446 _macos_arch(machine),
447 )
448 except ValueError:
449 # if someone is running a non-Mac darwin system, this will fall
450 # through to the default implementation
451 pass
452 return plat
453
454

References pip._vendor.pkg_resources._macos_arch(), pip._vendor.pkg_resources._macos_vers(), pip._vendor.pkg_resources.get_platform, and i.

Referenced by pip._vendor.pkg_resources.get_supported_platform().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_default_cache()

get_default_cache ( )
Return the ``PYTHON_EGG_CACHE`` environment variable
or a platform-relevant user cache dir for an app
named "Python-Eggs".

Definition at line 1373 of file __init__.py.

1373def get_default_cache():
1374 """
1375 Return the ``PYTHON_EGG_CACHE`` environment variable
1376 or a platform-relevant user cache dir for an app
1377 named "Python-Eggs".
1378 """
1379 return os.environ.get('PYTHON_EGG_CACHE') or platformdirs.user_cache_dir(
1380 appname='Python-Eggs'
1381 )
1382
1383

◆ get_distribution()

get_distribution (   dist)
Return a current distribution object for a Requirement or string

Definition at line 523 of file __init__.py.

523def get_distribution(dist):
524 """Return a current distribution object for a Requirement or string"""
525 if isinstance(dist, str):
526 dist = Requirement.parse(dist)
527 if isinstance(dist, Requirement):
528 dist = get_provider(dist)
529 if not isinstance(dist, Distribution):
530 raise TypeError("Expected string, Requirement, or Distribution", dist)
531 return dist
532
533

References pip._vendor.pkg_resources.get_provider(), and i.

Here is the call graph for this function:

◆ get_entry_info()

get_entry_info (   dist,
  group,
  name 
)
Return the EntryPoint object for `group`+`name`, or ``None``

Definition at line 544 of file __init__.py.

544def get_entry_info(dist, group, name):
545 """Return the EntryPoint object for `group`+`name`, or ``None``"""
546 return get_distribution(dist).get_entry_info(group, name)
547
548

◆ get_entry_map()

get_entry_map (   dist,
  group = None 
)
Return the entry point map for `group`, or the full entry map

Definition at line 539 of file __init__.py.

539def get_entry_map(dist, group=None):
540 """Return the entry point map for `group`, or the full entry map"""
541 return get_distribution(dist).get_entry_map(group)
542
543

◆ get_provider()

get_provider (   moduleOrReq)
Return an IResourceProvider for the named module or requirement

Definition at line 397 of file __init__.py.

397def get_provider(moduleOrReq):
398 """Return an IResourceProvider for the named module or requirement"""
399 if isinstance(moduleOrReq, Requirement):
400 return working_set.find(moduleOrReq) or require(str(moduleOrReq))[0]
401 try:
402 module = sys.modules[moduleOrReq]
403 except KeyError:
404 __import__(moduleOrReq)
405 module = sys.modules[moduleOrReq]
406 loader = getattr(module, '__loader__', None)
407 return _find_adapter(_provider_factories, loader)(module)
408
409

References pip._vendor.pkg_resources._find_adapter(), i, and pip._vendor.pkg_resources.require.

Referenced by pip._vendor.pkg_resources.get_distribution().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_supported_platform()

get_supported_platform ( )
Return this platform's maximum compatible version.

distutils.util.get_platform() normally reports the minimum version
of macOS that would be required to *use* extensions produced by
distutils.  But what we want when checking compatibility is to know the
version of macOS that we are *running*.  To allow usage of packages that
explicitly require a newer version of macOS, we must also know the
current version of the OS.

If this condition occurs for any other platform with a version in its
platform strings, this function should be extended accordingly.

Definition at line 182 of file __init__.py.

182def get_supported_platform():
183 """Return this platform's maximum compatible version.
184
185 distutils.util.get_platform() normally reports the minimum version
186 of macOS that would be required to *use* extensions produced by
187 distutils. But what we want when checking compatibility is to know the
188 version of macOS that we are *running*. To allow usage of packages that
189 explicitly require a newer version of macOS, we must also know the
190 current version of the OS.
191
192 If this condition occurs for any other platform with a version in its
193 platform strings, this function should be extended accordingly.
194 """
195 plat = get_build_platform()
197 if m is not None and sys.platform == "darwin":
198 try:
199 plat = 'macosx-%s-%s' % ('.'.join(_macos_vers()[:2]), m.group(3))
200 except ValueError:
201 # not macOS
202 pass
203 return plat
204
205

References pip._vendor.pkg_resources._macos_vers(), pip._vendor.pkg_resources.get_build_platform(), and i.

Here is the call graph for this function:

◆ invalid_marker()

invalid_marker (   text)
Validate text as a PEP 508 environment marker; return an exception
if invalid or False otherwise.

Definition at line 1453 of file __init__.py.

1453def invalid_marker(text):
1454 """
1455 Validate text as a PEP 508 environment marker; return an exception
1456 if invalid or False otherwise.
1457 """
1458 try:
1459 evaluate_marker(text)
1460 except SyntaxError as e:
1461 e.filename = None
1462 e.lineno = None
1463 return e
1464 return False
1465
1466

◆ issue_warning()

issue_warning ( args,
**  kw 
)

Definition at line 3145 of file __init__.py.

3145def issue_warning(*args, **kw):
3146 level = 1
3147 g = globals()
3148 try:
3149 # find the first stack frame that is *not* code in
3150 # the pkg_resources module, to use for the warning
3151 while sys._getframe(level).f_globals is g:
3152 level += 1
3153 except ValueError:
3154 pass
3155 warnings.warn(stacklevel=level + 1, *args, **kw)
3156
3157

◆ load_entry_point()

load_entry_point (   dist,
  group,
  name 
)
Return `name` entry point of `group` for `dist` or raise ImportError

Definition at line 534 of file __init__.py.

534def load_entry_point(dist, group, name):
535 """Return `name` entry point of `group` for `dist` or raise ImportError"""
536 return get_distribution(dist).load_entry_point(group, name)
537
538

◆ non_empty_lines()

non_empty_lines (   path)
Yield non-empty lines from file at path

Definition at line 2207 of file __init__.py.

2207def non_empty_lines(path):
2208 """
2209 Yield non-empty lines from file at path
2210 """
2211 with open(path) as f:
2212 for line in f:
2213 line = line.strip()
2214 if line:
2215 yield line
2216
2217

◆ normalize_path()

normalize_path (   filename)
Normalize a file/dir name for comparison purposes

Definition at line 2411 of file __init__.py.

2411def normalize_path(filename):
2412 """Normalize a file/dir name for comparison purposes"""
2413 return os.path.normcase(os.path.realpath(os.path.normpath(_cygwin_patch(filename))))
2414
2415

◆ null_ns_handler()

null_ns_handler (   importer,
  path_item,
  packageName,
  module 
)

Definition at line 2404 of file __init__.py.

2404def null_ns_handler(importer, path_item, packageName, module):
2405 return None
2406
2407

◆ parse_requirements()

parse_requirements (   strs)
Yield ``Requirement`` objects for each specification in `strs`.

`strs` must be a string, or a (possibly-nested) iterable thereof.

Definition at line 3158 of file __init__.py.

3158def parse_requirements(strs):
3159 """
3160 Yield ``Requirement`` objects for each specification in `strs`.
3161
3162 `strs` must be a string, or a (possibly-nested) iterable thereof.
3163 """
3164 return map(Requirement, join_continuation(map(drop_comment, yield_lines(strs))))
3165
3166

◆ register_finder()

register_finder (   importer_type,
  distribution_finder 
)
Register `distribution_finder` to find distributions in sys.path items

`importer_type` is the type or class of a PEP 302 "Importer" (sys.path item
handler), and `distribution_finder` is a callable that, passed a path
item and the importer instance, yields ``Distribution`` instances found on
that path item.  See ``pkg_resources.find_on_path`` for an example.

Definition at line 2063 of file __init__.py.

2063def register_finder(importer_type, distribution_finder):
2064 """Register `distribution_finder` to find distributions in sys.path items
2065
2066 `importer_type` is the type or class of a PEP 302 "Importer" (sys.path item
2067 handler), and `distribution_finder` is a callable that, passed a path
2068 item and the importer instance, yields ``Distribution`` instances found on
2069 that path item. See ``pkg_resources.find_on_path`` for an example."""
2070 _distribution_finders[importer_type] = distribution_finder
2071
2072

◆ register_loader_type()

register_loader_type (   loader_type,
  provider_factory 
)
Register `provider_factory` to make providers for `loader_type`

`loader_type` is the type or class of a PEP 302 ``module.__loader__``,
and `provider_factory` is a function that, passed a *module* object,
returns an ``IResourceProvider`` for that module.

Definition at line 387 of file __init__.py.

387def register_loader_type(loader_type, provider_factory):
388 """Register `provider_factory` to make providers for `loader_type`
389
390 `loader_type` is the type or class of a PEP 302 ``module.__loader__``,
391 and `provider_factory` is a function that, passed a *module* object,
392 returns an ``IResourceProvider`` for that module.
393 """
394 _provider_factories[loader_type] = provider_factory
395
396

◆ register_namespace_handler()

register_namespace_handler (   importer_type,
  namespace_handler 
)
Register `namespace_handler` to declare namespace packages

`importer_type` is the type or class of a PEP 302 "Importer" (sys.path item
handler), and `namespace_handler` is a callable like this::

    def namespace_handler(importer, path_entry, moduleName, module):
        # return a path_entry to use for child packages

Namespace handlers are only called if the importer object has already
agreed that it can handle the relevant path item, and they should only
return a subpath if the module __path__ does not already contain an
equivalent subpath.  For an example namespace handler, see
``pkg_resources.file_ns_handler``.

Definition at line 2240 of file __init__.py.

2240def register_namespace_handler(importer_type, namespace_handler):
2241 """Register `namespace_handler` to declare namespace packages
2242
2243 `importer_type` is the type or class of a PEP 302 "Importer" (sys.path item
2244 handler), and `namespace_handler` is a callable like this::
2245
2246 def namespace_handler(importer, path_entry, moduleName, module):
2247 # return a path_entry to use for child packages
2248
2249 Namespace handlers are only called if the importer object has already
2250 agreed that it can handle the relevant path item, and they should only
2251 return a subpath if the module __path__ does not already contain an
2252 equivalent subpath. For an example namespace handler, see
2253 ``pkg_resources.file_ns_handler``.
2254 """
2255 _namespace_handlers[importer_type] = namespace_handler
2256
2257

◆ resolve_egg_link()

resolve_egg_link (   path)
Given a path to an .egg-link, resolve distributions
present in the referenced path.

Definition at line 2218 of file __init__.py.

2218def resolve_egg_link(path):
2219 """
2220 Given a path to an .egg-link, resolve distributions
2221 present in the referenced path.
2222 """
2223 referenced_paths = non_empty_lines(path)
2224 resolved_paths = (
2225 os.path.join(os.path.dirname(path), ref) for ref in referenced_paths
2226 )
2227 dist_groups = map(find_distributions, resolved_paths)
2228 return next(dist_groups, ())
2229
2230

◆ run_script()

run_script (   dist_spec,
  script_name 
)
Locate distribution `dist_spec` and run its `script_name` script

Definition at line 510 of file __init__.py.

510def run_script(dist_spec, script_name):
511 """Locate distribution `dist_spec` and run its `script_name` script"""
512 ns = sys._getframe(1).f_globals
513 name = ns['__name__']
514 ns.clear()
515 ns['__name__'] = name
516 require(dist_spec)[0].run_script(script_name, ns)
517
518
519# backward compatibility

References i, pip._vendor.pkg_resources.require, and pip._vendor.pkg_resources.run_script().

Referenced by pip._vendor.pkg_resources.run_script().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ safe_extra()

safe_extra (   extra)
Convert an arbitrary string to a standard 'extra' name

Any runs of non-alphanumeric characters are replaced with a single '_',
and the result is always lowercased.

Definition at line 1436 of file __init__.py.

1436def safe_extra(extra):
1437 """Convert an arbitrary string to a standard 'extra' name
1438
1439 Any runs of non-alphanumeric characters are replaced with a single '_',
1440 and the result is always lowercased.
1441 """
1442 return re.sub('[^A-Za-z0-9.-]+', '_', extra).lower()
1443
1444

◆ safe_listdir()

safe_listdir (   path)
Attempt to list contents of path, but suppress some exceptions.

Definition at line 2173 of file __init__.py.

2173def safe_listdir(path):
2174 """
2175 Attempt to list contents of path, but suppress some exceptions.
2176 """
2177 try:
2178 return os.listdir(path)
2179 except (PermissionError, NotADirectoryError):
2180 pass
2181 except OSError as e:
2182 # Ignore the directory if does not exist, not a directory or
2183 # permission denied
2185 raise
2186 return ()
2187
2188

◆ safe_name()

safe_name (   name)
Convert an arbitrary string to a standard distribution name

Any runs of non-alphanumeric/. characters are replaced with a single '-'.

Definition at line 1384 of file __init__.py.

1384def safe_name(name):
1385 """Convert an arbitrary string to a standard distribution name
1386
1387 Any runs of non-alphanumeric/. characters are replaced with a single '-'.
1388 """
1389 return re.sub('[^A-Za-z0-9.]+', '-', name)
1390
1391

◆ safe_version()

safe_version (   version)
Convert an arbitrary string to a standard version string

Definition at line 1392 of file __init__.py.

1392def safe_version(version):
1393 """
1394 Convert an arbitrary string to a standard version string
1395 """
1396 try:
1397 # normalize the version
1398 return str(packaging.version.Version(version))
1400 version = version.replace(' ', '.')
1401 return re.sub('[^A-Za-z0-9.]+', '-', version)
1402
1403

◆ split_sections()

split_sections (   s)
Split a string or iterable thereof into (section, content) pairs

Each ``section`` is a stripped version of the section header ("[section]")
and each ``content`` is a list of stripped lines excluding blank lines and
comment-only lines.  If there are any such lines before the first section
header, they're returned in a first ``section`` of ``None``.

Definition at line 3256 of file __init__.py.

3256def split_sections(s):
3257 """Split a string or iterable thereof into (section, content) pairs
3258
3259 Each ``section`` is a stripped version of the section header ("[section]")
3260 and each ``content`` is a list of stripped lines excluding blank lines and
3261 comment-only lines. If there are any such lines before the first section
3262 header, they're returned in a first ``section`` of ``None``.
3263 """
3264 section = None
3265 content = []
3266 for line in yield_lines(s):
3267 if line.startswith("["):
3268 if line.endswith("]"):
3269 if section or content:
3270 yield section, content
3271 section = line[1:-1].strip()
3272 content = []
3273 else:
3274 raise ValueError("Invalid section heading", line)
3275 else:
3276 content.append(line)
3277
3278 # wrap up last segment
3279 yield section, content
3280
3281

◆ to_filename()

to_filename (   name)
Convert a project or version name to its filename-escaped form

Any '-' characters are currently replaced with '_'.

Definition at line 1445 of file __init__.py.

1445def to_filename(name):
1446 """Convert a project or version name to its filename-escaped form
1447
1448 Any '-' characters are currently replaced with '_'.
1449 """
1450 return name.replace('-', '_')
1451
1452

Variable Documentation

◆ _distribution_finders

_distribution_finders = None
protected

Definition at line 113 of file __init__.py.

◆ _distributionImpl

dict _distributionImpl
protected
Initial value:
1= {
2 '.egg': Distribution,
3 '.egg-info': EggInfoDistribution,
4 '.dist-info': DistInfoDistribution,
5}

Definition at line 3138 of file __init__.py.

◆ _namespace_handlers

_namespace_handlers = None
protected

Definition at line 114 of file __init__.py.

◆ _namespace_packages

_namespace_packages = None
protected

Definition at line 115 of file __init__.py.

◆ _PEP440_FALLBACK

_PEP440_FALLBACK = re.compile(r"^v?(?P<safe>(?:[0-9]+!)?[0-9]+(?:\.[0-9]+)*)", re.I)
protected

Definition at line 126 of file __init__.py.

◆ _provider_factories

dict _provider_factories = {}
protected

Definition at line 377 of file __init__.py.

◆ _sget_none

None _sget_none = lambda *args
protected

Definition at line 179 of file __init__.py.

◆ _state_vars

dict _state_vars = {}
protected

Definition at line 139 of file __init__.py.

◆ add_activation_listener

add_activation_listener = None

Definition at line 101 of file __init__.py.

◆ append

append

Definition at line 3297 of file __init__.py.

◆ AvailableDistributions

AvailableDistributions = Environment

Definition at line 1176 of file __init__.py.

◆ BINARY_DIST

int BINARY_DIST = 2

Definition at line 381 of file __init__.py.

◆ category

category

Definition at line 3297 of file __init__.py.

◆ CHECKOUT_DIST

int CHECKOUT_DIST = 0

Definition at line 383 of file __init__.py.

◆ cleanup_resources

cleanup_resources = None

Definition at line 103 of file __init__.py.

◆ darwinVersionString

darwinVersionString = re.compile(r"darwin-(\d+)\.(\d+)\.(\d+)-(.*)")

Definition at line 456 of file __init__.py.

◆ DEVELOP_DIST

int DEVELOP_DIST = -1

Definition at line 384 of file __init__.py.

◆ EGG_DIST

int EGG_DIST = 3

Definition at line 380 of file __init__.py.

◆ EGG_NAME

EGG_NAME
Initial value:
2 ,
4).match

Definition at line 2468 of file __init__.py.

◆ empty_provider

empty_provider = EmptyProvider()

Definition at line 1761 of file __init__.py.

◆ FileExistsError

FileExistsError = OSError

Definition at line 55 of file __init__.py.

◆ get_platform

get_platform = get_build_platform

Definition at line 458 of file __init__.py.

Referenced by pip._vendor.pkg_resources.get_build_platform().

◆ importlib_machinery

importlib_machinery = None

Definition at line 77 of file __init__.py.

◆ iter_entry_points

iter_entry_points = None

Definition at line 109 of file __init__.py.

◆ macosVersionString

macosVersionString = re.compile(r"macosx-(\d+)\.(\d+)-(.*)")

Definition at line 455 of file __init__.py.

◆ MODULE

MODULE = re.compile(r"\w+(\.\w+)*$").match

Definition at line 2467 of file __init__.py.

◆ parse_version

parse_version = packaging.version.Version

Definition at line 136 of file __init__.py.

◆ PEP440Warning

Definition at line 3297 of file __init__.py.

◆ PY_MAJOR

str PY_MAJOR = '{}.{}'.format(*sys.version_info)

Definition at line 379 of file __init__.py.

◆ require

require = None

◆ resource_dir

resource_dir = None

Definition at line 104 of file __init__.py.

◆ resource_exists

resource_exists = None

Definition at line 112 of file __init__.py.

◆ resource_filename

resource_filename = None

Definition at line 111 of file __init__.py.

◆ resource_isdir

resource_isdir = None

Definition at line 107 of file __init__.py.

◆ resource_listdir

resource_listdir = None

Definition at line 110 of file __init__.py.

◆ resource_stream

resource_stream = None

Definition at line 105 of file __init__.py.

◆ resource_string

resource_string = None

Definition at line 108 of file __init__.py.

◆ resources_stream

resources_stream = None

Definition at line 102 of file __init__.py.

◆ run_main

run_main = run_script

Definition at line 520 of file __init__.py.

◆ set_extraction_path

set_extraction_path = None

Definition at line 106 of file __init__.py.

◆ SOURCE_DIST

int SOURCE_DIST = 1

Definition at line 382 of file __init__.py.

◆ stacklevel

stacklevel

Definition at line 122 of file __init__.py.

◆ working_set

working_set = None

Definition at line 100 of file __init__.py.

◆ WRITE_SUPPORT

bool WRITE_SUPPORT = True

Definition at line 63 of file __init__.py.