From 7ff0c37bcab9bcdfdec0828f4c53b9dc5f37f653 Mon Sep 17 00:00:00 2001 From: Andrew Gallant Date: Wed, 12 Jun 2024 10:00:59 -0400 Subject: [PATCH] scenarios: add tests for Requires-Python This tests the interaction between `Requires-Python` and marker expressions like `python_version` and `python_full_version`. In both of these tests, the `a` dependency should be completely ignored because its corresponding marker expression will never evaluate to true. --- scenarios/fork/requires-python-full.toml | 22 ++++++++++++++++++++++ scenarios/fork/requires-python.toml | 19 +++++++++++++++++++ 2 files changed, 41 insertions(+) create mode 100644 scenarios/fork/requires-python-full.toml create mode 100644 scenarios/fork/requires-python.toml diff --git a/scenarios/fork/requires-python-full.toml b/scenarios/fork/requires-python-full.toml new file mode 100644 index 00000000..1394b30a --- /dev/null +++ b/scenarios/fork/requires-python-full.toml @@ -0,0 +1,22 @@ +name = "fork-requires-python-full" +description = ''' +This tests that a `Requires-Python` specifier will result in the +exclusion of dependency specifications that cannot possibly satisfy it. + +In particular, this is tested via the `python_full_version` marker +instead of the more common `python_version` marker. +''' + +[resolver_options] +universal = true + +[expected] +satisfiable = false + +[root] +requires_python = ">=3.10" +requires = [ + "a==1.0.0 ; python_full_version == '3.9b1'", +] + +[packages.a.versions."1.0.0"] diff --git a/scenarios/fork/requires-python.toml b/scenarios/fork/requires-python.toml new file mode 100644 index 00000000..6ed03e9a --- /dev/null +++ b/scenarios/fork/requires-python.toml @@ -0,0 +1,19 @@ +name = "fork-requires-python" +description = ''' +This tests that a `Requires-Python` specifier will result in the +exclusion of dependency specifications that cannot possibly satisfy it. +''' + +[resolver_options] +universal = true + +[expected] +satisfiable = false + +[root] +requires_python = ">=3.10" +requires = [ + "a==1.0.0 ; python_version == '3.9'", +] + +[packages.a.versions."1.0.0"]