def from_marker(cls, marker: Marker) -> Self:  # pragma: no cover
        """Create an EnvSpec from a Marker object."""
        marker_no_python, pyspec = marker.split_pyspec()
        kwargs = {"requires_python": str(pyspec)}
        if not marker_no_python.is_any() and not isinstance(marker_no_python.inner, (MultiMarker, MarkerExpression)):
            raise TypeError(
                f"Unsupported environment marker: {marker}, not a single expression or connected with 'and'"
            )
        if not (implementation_marker := marker_no_python.inner.only("implementation_name")).is_any():
            assert isinstance(implementation_marker, MarkerExpression)
            kwargs["implementation"] = implementation_marker.value
        if not (platform_marker := marker_no_python.inner.only(*PLATFORM_MARKERS)).is_any():
            platform = platform_marker.only("platform_system")
            arch = platform_marker.only("platform_machine")
            if not all(isinstance(m, MarkerExpression) for m in (platform, arch)):
                raise TypeError(f"Unsupported platform marker: {platform_marker}")
            os = platform.value.lower()
            if os == "linux":
                os = "manylinux_2_17"
            elif os == "darwin":
                os = "macos"
            kwargs["platform"] = f"{os}_{arch.value.lower()}"
        return cls.from_spec(**kwargs)
Create an EnvSpec from a Marker object.
src/pdm/models/markers.py