(self, marker: str)
| 191 | |
| 192 | class Marker: |
| 193 | def __init__(self, marker: str) -> None: |
| 194 | # Note: We create a Marker object without calling this constructor in |
| 195 | # packaging.requirements.Requirement. If any additional logic is |
| 196 | # added here, make sure to mirror/adapt Requirement. |
| 197 | try: |
| 198 | self._markers = _normalize_extra_values(_parse_marker(marker)) |
| 199 | # The attribute `_markers` can be described in terms of a recursive type: |
| 200 | # MarkerList = List[Union[Tuple[Node, ...], str, MarkerList]] |
| 201 | # |
| 202 | # For example, the following expression: |
| 203 | # python_version > "3.6" or (python_version == "3.6" and os_name == "unix") |
| 204 | # |
| 205 | # is parsed into: |
| 206 | # [ |
| 207 | # (<Variable('python_version')>, <Op('>')>, <Value('3.6')>), |
| 208 | # 'and', |
| 209 | # [ |
| 210 | # (<Variable('python_version')>, <Op('==')>, <Value('3.6')>), |
| 211 | # 'or', |
| 212 | # (<Variable('os_name')>, <Op('==')>, <Value('unix')>) |
| 213 | # ] |
| 214 | # ] |
| 215 | except ParserSyntaxError as e: |
| 216 | raise InvalidMarker(str(e)) from e |
| 217 | |
| 218 | def __str__(self) -> str: |
| 219 | return _format_marker(self._markers) |
nothing calls this directly
no test coverage detected