requirementslib.models.markers module¶
-
class
requirementslib.models.markers.
PipenvMarkers
(os_name=None, sys_platform=None, platform_machine=None, platform_python_implementation=None, platform_release=None, platform_system=None, platform_version=None, python_version=None, python_full_version=None, implementation_name=None, implementation_version=None)[source]¶ Bases:
object
System-level requirements - see PEP508 for more detail
-
line_part
¶
-
pipfile_part
¶
-
-
requirementslib.models.markers.
contains_extra
[source]¶ Check whehter a marker contains an “extra == …” operand.
-
requirementslib.models.markers.
contains_pyversion
[source]¶ Check whether a marker contains a python_version operand.
-
requirementslib.models.markers.
get_contained_extras
[source]¶ Collect “extra == …” operands from a marker.
Returns a list of str. Each str is a speficied extra in this marker.
-
requirementslib.models.markers.
get_contained_pyversions
[source]¶ Collect all python_version operands from a marker.
-
requirementslib.models.markers.
get_without_extra
(marker)[source]¶ Build a new marker without the extra == … part.
The implementation relies very deep into packaging’s internals, but I don’t have a better way now (except implementing the whole thing myself).
This could return None if the extra == … part is the only one in the input marker.
-
requirementslib.models.markers.
get_without_pyversion
(marker)[source]¶ Built a new marker without the python_version part.
This could return None if the python_version section is the only section in the marker.
-
requirementslib.models.markers.
normalize_specifier_set
(specs)[source]¶ Given a specifier set, a string, or an iterable, normalize the specifiers
Note
This function exists largely to deal with
pyzmq
which handles therequires_python
specifier incorrectly, using3.7*
rather than the correct form of3.7.*
. This workaround can likely go away if we ever introduce enforcement for metadata standards on PyPI.Parameters: SpecifierSet] specs (Union[str,) – Supplied specifiers to normalize Returns: A new set of specifiers or specifierset Return type: Union[Set[Specifier], SpecifierSet
]