diff --git a/scenarios/wheels/no-sdist-no-wheels-with-matching-abi.toml b/scenarios/wheels/no-sdist-no-wheels-with-matching-abi.toml index 2ffccd70..3a701e32 100644 --- a/scenarios/wheels/no-sdist-no-wheels-with-matching-abi.toml +++ b/scenarios/wheels/no-sdist-no-wheels-with-matching-abi.toml @@ -10,3 +10,6 @@ satisfiable = false [packages.a.versions."1.0.0"] wheel_tags = ["py3-MMMMMM-any"] sdist = false + +[resolver_options] +python_platform = "x86_64-manylinux2014" diff --git a/scenarios/wheels/no-sdist-no-wheels-with-matching-platform.toml b/scenarios/wheels/no-sdist-no-wheels-with-matching-platform.toml index 4d74a922..35ddcaa5 100644 --- a/scenarios/wheels/no-sdist-no-wheels-with-matching-platform.toml +++ b/scenarios/wheels/no-sdist-no-wheels-with-matching-platform.toml @@ -10,3 +10,6 @@ satisfiable = false [packages.a.versions."1.0.0"] wheel_tags = ["py3-none-macosx_10_0_ppc64"] sdist = false + +[resolver_options] +python_platform = "x86_64-manylinux2014" diff --git a/scenarios/wheels/no-sdist-no-wheels-with-matching-python.toml b/scenarios/wheels/no-sdist-no-wheels-with-matching-python.toml index aa955744..cd4a88ac 100644 --- a/scenarios/wheels/no-sdist-no-wheels-with-matching-python.toml +++ b/scenarios/wheels/no-sdist-no-wheels-with-matching-python.toml @@ -10,3 +10,6 @@ satisfiable = false [packages.a.versions."1.0.0"] wheel_tags = ["jy27-none-any"] sdist = false + +[resolver_options] +python_platform = "x86_64-manylinux2014" diff --git a/src/packse/scenario.py b/src/packse/scenario.py index 49aa328d..af0fb55e 100644 --- a/src/packse/scenario.py +++ b/src/packse/scenario.py @@ -139,6 +139,11 @@ class ResolverOptions(msgspec.Struct, forbid_unknown_fields=True): non-overlapping marker expressions. """ + python_platform: str | None = None + """ + The Python platform to use for resolution. + """ + def hash(self) -> str: """ Return a hash of the contents @@ -152,6 +157,10 @@ def hash(self) -> str: hasher.update(no_binary.encode()) for no_build in self.no_build: hasher.update(no_build.encode()) + if self.universal is not None: + hasher.update(self.universal.to_bytes()) + if self.python_platform is not None: + hasher.update(self.python_platform.encode()) return hasher.hexdigest() diff --git a/tests/__snapshots__/test_inspect.ambr b/tests/__snapshots__/test_inspect.ambr index 8c685236..ca2aa622 100644 --- a/tests/__snapshots__/test_inspect.ambr +++ b/tests/__snapshots__/test_inspect.ambr @@ -114,7 +114,8 @@ "prereleases": false, "no_build": [], "no_binary": [], - "universal": false + "universal": false, + "python_platform": null }, "template": "package", "description": "This is an example scenario, in which the user depends on a single package `a` which requires `b`.", @@ -251,7 +252,8 @@ "prereleases": false, "no_build": [], "no_binary": [], - "universal": false + "universal": false, + "python_platform": null }, "template": "package", "description": "This is an example scenario, in which the user depends on a single package `a` which requires `b`.", @@ -415,7 +417,8 @@ "prereleases": false, "no_build": [], "no_binary": [], - "universal": false + "universal": false, + "python_platform": null }, "template": "package", "description": "This is an example scenario written in TOML, in which the user depends on a single package `a` which requires `b`.", @@ -552,7 +555,8 @@ "prereleases": false, "no_build": [], "no_binary": [], - "universal": false + "universal": false, + "python_platform": null }, "template": "package", "description": "This is an example scenario written in YAML, in which the user depends on a single package `a` which requires `b`.",