From 77cd259f745eb4c522083072e81ab0ccbaf2fb49 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Randy=20D=C3=B6ring?= <30527984+radoering@users.noreply.github.com> Date: Sat, 18 Jan 2025 14:21:19 +0100 Subject: [PATCH] tests: adapt tests to cosmetic changes caused by poetry-core#818 --- poetry.lock | 18 +++++++++++------- pyproject.toml | 2 +- ...nflicting-dependency-extras-transitive.test | 2 +- .../with-dependencies-differing-extras.test | 2 +- tests/puzzle/test_solver.py | 14 +++++++------- tests/puzzle/test_solver_internals.py | 9 +++------ 6 files changed, 24 insertions(+), 23 deletions(-) diff --git a/poetry.lock b/poetry.lock index 1cb6c86aeb9..8f06576e67a 100644 --- a/poetry.lock +++ b/poetry.lock @@ -1,4 +1,4 @@ -# This file is automatically @generated by Poetry 2.0.0 and should not be changed by hand. +# This file is automatically @generated by Poetry 2.0.1 and should not be changed by hand. [[package]] name = "backports-tarfile" @@ -1043,12 +1043,16 @@ name = "poetry-core" version = "2.0.1" description = "Poetry PEP 517 Build Backend" optional = false -python-versions = "<4.0,>=3.9" +python-versions = ">=3.9, <4.0" groups = ["main"] -files = [ - {file = "poetry_core-2.0.1-py3-none-any.whl", hash = "sha256:a3c7009536522cda4eb0fb3805c9dc935b5537f8727dd01efb9c15e51a17552b"}, - {file = "poetry_core-2.0.1.tar.gz", hash = "sha256:10177c2772469d9032a49f0d8707af761b1c597cea3b4fb31546e5cd436eb157"}, -] +files = [] +develop = false + +[package.source] +type = "git" +url = "https://github.com/python-poetry/poetry-core.git" +reference = "HEAD" +resolved_reference = "b1505c6eef8160ffe4ead25c7bff81317947da1a" [[package]] name = "pre-commit" @@ -1735,4 +1739,4 @@ type = ["pytest-mypy"] [metadata] lock-version = "2.1" python-versions = ">=3.9,<4.0" -content-hash = "308952b9d3e6645aa1a55c5c021949e2300dd78a8f0049cdf2814785e1196dc5" +content-hash = "e12eda5cc53996f463234f41ff013a8b0aa972ffbcbe210197327660d88b0af1" diff --git a/pyproject.toml b/pyproject.toml index e6037c56bb2..f86eee304d6 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ version = "2.0.1" description = "Python dependency management and packaging made easy." requires-python = ">=3.9,<4.0" dependencies = [ - "poetry-core (==2.0.1)", + "poetry-core @ git+https://github.com/python-poetry/poetry-core.git", "build (>=1.2.1,<2.0.0)", "cachecontrol[filecache] (>=0.14.0,<0.15.0)", "cleo (>=2.1.0,<3.0.0)", diff --git a/tests/installation/fixtures/with-conflicting-dependency-extras-transitive.test b/tests/installation/fixtures/with-conflicting-dependency-extras-transitive.test index 5e6f11ab7f9..fc15ffab04f 100644 --- a/tests/installation/fixtures/with-conflicting-dependency-extras-transitive.test +++ b/tests/installation/fixtures/with-conflicting-dependency-extras-transitive.test @@ -26,7 +26,7 @@ optional = true python-versions = "*" files = [ ] groups = [ "main" ] -markers = "extra == \"root-extra-one\" and extra != \"root-extra-two\" or extra == \"root-extra-two\" and extra != \"root-extra-one\"" +markers = "extra == \"root-extra-one\" and extra != \"root-extra-two\" or extra != \"root-extra-one\" and extra == \"root-extra-two\"" [[package.dependencies.conflicting-dep]] version = "1.1.0" diff --git a/tests/installation/fixtures/with-dependencies-differing-extras.test b/tests/installation/fixtures/with-dependencies-differing-extras.test index 7dcaacf26ae..564d9d03d94 100644 --- a/tests/installation/fixtures/with-dependencies-differing-extras.test +++ b/tests/installation/fixtures/with-dependencies-differing-extras.test @@ -6,7 +6,7 @@ optional = true python-versions = "*" files = [ ] groups = [ "main" ] -markers = "extra == \"extra-one\" and extra != \"extra-two\" or extra == \"extra-two\" and extra != \"extra-one\"" +markers = "extra == \"extra-one\" and extra != \"extra-two\" or extra != \"extra-one\" and extra == \"extra-two\"" [package.dependencies.transitive-dep-one] version = "1.1.0" diff --git a/tests/puzzle/test_solver.py b/tests/puzzle/test_solver.py index a566e5c588e..6d791baed5d 100644 --- a/tests/puzzle/test_solver.py +++ b/tests/puzzle/test_solver.py @@ -2035,34 +2035,34 @@ def test_solver_duplicate_dependencies_with_overlapping_markers_complex( ), ( 'numpy (>=1.17.3) ; python_version < "3.9"' - ' and (platform_system != "Darwin" and platform_system != "Linux")' + ' and platform_system != "Darwin" and platform_system != "Linux"' ' and python_version >= "3.8" or python_version < "3.9"' ' and platform_system != "Darwin" and python_version >= "3.8"' ' and platform_machine != "aarch64" or python_version < "3.9"' ' and platform_machine != "arm64" and python_version >= "3.8"' ' and platform_system != "Linux" or python_version < "3.9"' - ' and (platform_machine != "arm64" and platform_machine != "aarch64")' + ' and platform_machine != "arm64" and platform_machine != "aarch64"' ' and python_version >= "3.8"' ), ( 'numpy (>=1.14.5) ; python_version < "3.8"' - ' and (platform_system != "Darwin" and platform_system != "Linux")' + ' and platform_system != "Darwin" and platform_system != "Linux"' ' and python_version >= "3.7" or python_version < "3.8"' ' and platform_system != "Darwin" and python_version >= "3.7"' ' and platform_machine != "aarch64" or python_version < "3.8"' ' and platform_machine != "arm64" and python_version >= "3.7"' ' and platform_system != "Linux" or python_version < "3.8"' - ' and (platform_machine != "arm64" and platform_machine != "aarch64")' + ' and platform_machine != "arm64" and platform_machine != "aarch64"' ' and python_version >= "3.7"' ), ( 'numpy (>=1.13.3) ; python_version < "3.6" or python_version < "3.7"' - ' and (platform_system != "Darwin" and platform_system != "Linux")' + ' and platform_system != "Darwin" and platform_system != "Linux"' ' or python_version < "3.7" and platform_system != "Darwin"' ' and platform_machine != "aarch64" or python_version < "3.7"' ' and platform_machine != "arm64" and platform_system != "Linux"' - ' or python_version < "3.7" and (platform_machine != "arm64"' - ' and platform_machine != "aarch64")' + ' or python_version < "3.7" and platform_machine != "arm64"' + ' and platform_machine != "aarch64"' ), }, ) diff --git a/tests/puzzle/test_solver_internals.py b/tests/puzzle/test_solver_internals.py index ae882560e5c..5a9effd8972 100644 --- a/tests/puzzle/test_solver_internals.py +++ b/tests/puzzle/test_solver_internals.py @@ -213,16 +213,13 @@ def test_propagate_markers_with_root_extra( assert tm(result[package]) == {} assert tm(result[a]) == {"main": 'extra == "foo"'} assert tm(result[b]) == { - "main": ( - 'extra == "foo" and sys_platform == "linux"' - ' or extra == "bar" and sys_platform == "linux"' - ) + "main": 'sys_platform == "linux" and (extra == "foo" or extra == "bar")', } assert tm(result[c]) == {"main": 'extra == "foo" and python_version == "3.8"'} assert tm(result[d]) == { "main": ( - 'extra == "foo" and sys_platform == "linux" and python_version == "3.9"' - ' or extra == "bar" and sys_platform == "linux" and python_version == "3.9"' + 'sys_platform == "linux" and (extra == "foo" or extra == "bar")' + ' and python_version == "3.9"' ) }