pip_shims.models¶
Helper module for shimming functionality across pip versions.
-
class
pip_shims.models.
ImportTypes
[source]¶ Bases:
pip_shims.models.ImportTypes
Create new instance of ImportTypes(FUNCTION, CLASS, MODULE, CONTEXTMANAGER)
-
ATTRIBUTE
= 5¶
-
CLASS
= 1¶
-
CONTEXTMANAGER
= 3¶
-
FUNCTION
= 0¶
-
METHOD
= 4¶
-
MODULE
= 2¶
-
_asdict
()¶ Return a new OrderedDict which maps field names to their values.
-
_field_defaults
= {}¶
-
_fields
= ('FUNCTION', 'CLASS', 'MODULE', 'CONTEXTMANAGER')¶
-
_fields_defaults
= {}¶
-
classmethod
_make
(iterable)¶ Make a new ImportTypes object from a sequence or iterable
-
_replace
(**kwds)¶ Return a new ImportTypes object replacing specified fields with new values
-
count
()¶ Return number of occurrences of value.
-
index
()¶ Return first index of value.
Raises ValueError if the value is not present.
-
-
pip_shims.models.
ImportTypesBase
¶ alias of
pip_shims.models.ImportTypes
-
class
pip_shims.models.
PipVersion
(version, round_prereleases_up=True, base_import_path=None, vendor_import_path='pip._vendor')[source]¶ Bases:
collections.abc.Sequence
-
_abc_impl
= <_abc_data object>¶
-
count
(value) → integer -- return number of occurrences of value¶
-
index
(value[, start[, stop]]) → integer -- return first index of value.¶ Raises ValueError if the value is not present.
Supporting start and stop arguments is optional, but recommended.
-
version_key
¶
-
version_tuple
¶
-
-
class
pip_shims.models.
PipVersionRange
(start, end)[source]¶ Bases:
collections.abc.Sequence
-
_abc_impl
= <_abc_data object>¶
-
base_import_paths
¶
-
count
(value) → integer -- return number of occurrences of value¶
-
index
(value[, start[, stop]]) → integer -- return first index of value.¶ Raises ValueError if the value is not present.
Supporting start and stop arguments is optional, but recommended.
-
vendor_import_paths
¶
-
-
class
pip_shims.models.
ShimmedPath
(name, import_target, import_type, version_range, provided_methods=None, provided_functions=None, provided_classmethods=None, provided_contextmanagers=None, provided_mixins=None, default_args=None)[source]¶ Bases:
object
-
_ShimmedPath__modules
= {'pip._internal.cli.req_command': <module 'pip._internal.cli.req_command' from '/home/docs/checkouts/readthedocs.org/user_builds/pip-shims/envs/stable/lib/python3.7/site-packages/pip/_internal/cli/req_command.py'>, 'pip._internal.models.target_python': <module 'pip._internal.models.target_python' from '/home/docs/checkouts/readthedocs.org/user_builds/pip-shims/envs/stable/lib/python3.7/site-packages/pip/_internal/models/target_python.py'>, 'pip._internal.operations.build.build_tracker': <module 'pip._internal.operations.build.build_tracker' from '/home/docs/checkouts/readthedocs.org/user_builds/pip-shims/envs/stable/lib/python3.7/site-packages/pip/_internal/operations/build/build_tracker.py'>, 'pip._internal.req.constructors': <module 'pip._internal.req.constructors' from '/home/docs/checkouts/readthedocs.org/user_builds/pip-shims/envs/stable/lib/python3.7/site-packages/pip/_internal/req/constructors.py'>}¶
-
_ensure_methods
(provided)[source]¶ Given a base class, a new name, and any number of functions to attach, turns those functions into classmethods, attaches them, and returns an updated class object.
-
calculated_module_path
¶
-
is_attribute
¶
-
is_class
¶
-
is_contextmanager
¶
-
is_function
¶
-
is_method
¶
-
is_module
¶
-
is_valid
¶
-
shimmed
¶
-
sort_order
¶
-
-
class
pip_shims.models.
ShimmedPathCollection
(name, import_type, paths=None)[source]¶ Bases:
object
-
_ShimmedPathCollection__registry
= {'AbstractDistribution': <pip_shims.models.ShimmedPathCollection object>, 'BadCommand': <pip_shims.models.ShimmedPathCollection object>, 'BestVersionAlreadyInstalled': <pip_shims.models.ShimmedPathCollection object>, 'BuildTracker': <pip_shims.models.ShimmedPathCollection object>, 'CandidateEvaluator': <pip_shims.models.ShimmedPathCollection object>, 'CandidatePreferences': <pip_shims.models.ShimmedPathCollection object>, 'Command': <pip_shims.models.ShimmedPathCollection object>, 'CommandError': <pip_shims.models.ShimmedPathCollection object>, 'ConfigOptionParser': <pip_shims.models.ShimmedPathCollection object>, 'DEV_PKGS': <pip_shims.models.ShimmedPathCollection object>, 'DistributionNotFound': <pip_shims.models.ShimmedPathCollection object>, 'Downloader': <pip_shims.models.ShimmedPathCollection object>, 'FAVORITE_HASH': <pip_shims.models.ShimmedPathCollection object>, 'FormatControl': <pip_shims.models.ShimmedPathCollection object>, 'FrozenRequirement': <pip_shims.models.ShimmedPathCollection object>, 'InstallCommand': <pip_shims.models.ShimmedPathCollection object>, 'InstallRequirement': <pip_shims.models.ShimmedPathCollection object>, 'InstallationError': <pip_shims.models.ShimmedPathCollection object>, 'InstalledDistribution': <pip_shims.models.ShimmedPathCollection object>, 'Link': <pip_shims.models.ShimmedPathCollection object>, 'LinkCollector': <pip_shims.models.ShimmedPathCollection object>, 'LinkEvaluator': <pip_shims.models.ShimmedPathCollection object>, 'PackageFinder': <pip_shims.models.ShimmedPathCollection object>, 'PipError': <pip_shims.models.ShimmedPathCollection object>, 'PreviousBuildDirError': <pip_shims.models.ShimmedPathCollection object>, 'PyPI': <pip_shims.models.ShimmedPathCollection object>, 'RequirementPreparer': <pip_shims.models.ShimmedPathCollection object>, 'RequirementSet': <pip_shims.models.ShimmedPathCollection object>, 'RequirementTracker': <pip_shims.models.ShimmedPathCollection object>, 'RequirementsFileParseError': <pip_shims.models.ShimmedPathCollection object>, 'Resolver': <pip_shims.models.ShimmedPathCollection object>, 'SafeFileCache': <pip_shims.models.ShimmedPathCollection object>, 'SearchScope': <pip_shims.models.ShimmedPathCollection object>, 'SelectionPreferences': <pip_shims.models.ShimmedPathCollection object>, 'SessionCommandMixin': <pip_shims.models.ShimmedPathCollection object>, 'SourceDistribution': <pip_shims.models.ShimmedPathCollection object>, 'TargetPython': <pip_shims.models.ShimmedPathCollection object>, 'TempDirectory': <pip_shims.models.ShimmedPathCollection object>, 'USER_CACHE_DIR': <pip_shims.models.ShimmedPathCollection object>, 'UninstallPathSet': <pip_shims.models.ShimmedPathCollection object>, 'UninstallationError': <pip_shims.models.ShimmedPathCollection object>, 'VcsSupport': <pip_shims.models.ShimmedPathCollection object>, 'Wheel': <pip_shims.models.ShimmedPathCollection object>, 'WheelBuilder': <pip_shims.models.ShimmedPathCollection object>, 'WheelCache': <pip_shims.models.ShimmedPathCollection object>, 'WheelDistribution': <pip_shims.models.ShimmedPathCollection object>, '_strip_extras': <pip_shims.models.ShimmedPathCollection object>, 'build': <pip_shims.models.ShimmedPathCollection object>, 'build_one': <pip_shims.models.ShimmedPathCollection object>, 'build_one_inside_env': <pip_shims.models.ShimmedPathCollection object>, 'build_wheel': <pip_shims.models.ShimmedPathCollection object>, 'cmdoptions': <pip_shims.models.ShimmedPathCollection object>, 'commands_dict': <pip_shims.models.ShimmedPathCollection object>, 'get_build_tracker': <pip_shims.models.ShimmedPathCollection object>, 'get_installed_distributions': <pip_shims.models.ShimmedPathCollection object>, 'get_package_finder': <pip_shims.models.ShimmedPathCollection object>, 'get_requirement_set': <pip_shims.models.ShimmedPathCollection object>, 'get_requirement_tracker': <pip_shims.models.ShimmedPathCollection object>, 'get_resolver': <pip_shims.models.ShimmedPathCollection object>, 'get_supported': <pip_shims.models.ShimmedPathCollection object>, 'get_tags': <pip_shims.models.ShimmedPathCollection object>, 'global_tempdir_manager': <pip_shims.models.ShimmedPathCollection object>, 'index_group': <pip_shims.models.ShimmedPathCollection object>, 'install_req_from_editable': <pip_shims.models.ShimmedPathCollection object>, 'install_req_from_line': <pip_shims.models.ShimmedPathCollection object>, 'install_req_from_req_string': <pip_shims.models.ShimmedPathCollection object>, 'is_archive_file': <pip_shims.models.ShimmedPathCollection object>, 'is_file_url': <pip_shims.models.ShimmedPathCollection object>, 'is_installable_dir': <pip_shims.models.ShimmedPathCollection object>, 'make_abstract_dist': <pip_shims.models.ShimmedPathCollection object>, 'make_distribution_for_install_requirement': <pip_shims.models.ShimmedPathCollection object>, 'make_option_group': <pip_shims.models.ShimmedPathCollection object>, 'make_preparer': <pip_shims.models.ShimmedPathCollection object>, 'parse_requirements': <pip_shims.models.ShimmedPathCollection object>, 'path_to_url': <pip_shims.models.ShimmedPathCollection object>, 'resolve': <pip_shims.models.ShimmedPathCollection object>, 'shim_unpack': <pip_shims.models.ShimmedPathCollection object>, 'stdlib_pkgs': <pip_shims.models.ShimmedPathCollection object>, 'unpack_url': <pip_shims.models.ShimmedPathCollection object>, 'url_to_path': <pip_shims.models.ShimmedPathCollection object>, 'wheel_cache': <pip_shims.models.ShimmedPathCollection object>}¶
-