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

classmethod from_line(line)[source]
classmethod from_pipfile(name, pipfile)[source]
line_part
classmethod make_marker(marker_string)[source]
pipfile_part
requirementslib.models.markers.cleanup_pyspecs[source]
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.fix_version_tuple[source]
requirementslib.models.markers.format_pyversion(parts)[source]
requirementslib.models.markers.gen_marker(mkr)[source]
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_sorted_version_string(version_set)[source]
requirementslib.models.markers.get_specset(marker_list)[source]
requirementslib.models.markers.get_versions[source]
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.is_instance(item, cls)[source]
requirementslib.models.markers.marker_from_specifier[source]
requirementslib.models.markers.merge_markers(m1, m2)[source]
requirementslib.models.markers.normalize_marker_str(marker)[source]
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 the requires_python specifier incorrectly, using 3.7* rather than the correct form of 3.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]
requirementslib.models.markers.parse_marker_dict(marker_dict)[source]