diff --git a/771f7ad29ca4d259761eaa88673c2e32f6412bbe.patch b/771f7ad29ca4d259761eaa88673c2e32f6412bbe.patch new file mode 100644 index 0000000..71de627 --- /dev/null +++ b/771f7ad29ca4d259761eaa88673c2e32f6412bbe.patch @@ -0,0 +1,87 @@ +From 771f7ad29ca4d259761eaa88673c2e32f6412bbe Mon Sep 17 00:00:00 2001 +From: Sloane Hertel <19572925+s-hertel@users.noreply.github.com> +Date: Wed, 6 Nov 2024 10:20:26 -0500 +Subject: [PATCH] update ansible-galaxy resolvelib requirement to >= 0.5.3, < + 2.0.0 (#84218) + +* Update resolvelib upperbound to 2.0.0 + +Minor SemVer releases should not contain breaking changes + +* Test the latest minor release and reduce number of resolvelib versions tested for efficiency +--- + .../fragments/update-resolvelib-lt-2_0_0.yml | 2 ++ + .../galaxy/dependency_resolution/providers.py | 2 +- + requirements.txt | 2 +- + .../ansible-galaxy-collection/vars/main.yml | 14 ++++++++------ + .../ansible_test/_data/requirements/ansible.txt | 2 +- + 5 files changed, 13 insertions(+), 9 deletions(-) + create mode 100644 changelogs/fragments/update-resolvelib-lt-2_0_0.yml + +diff --git a/changelogs/fragments/update-resolvelib-lt-2_0_0.yml b/changelogs/fragments/update-resolvelib-lt-2_0_0.yml +new file mode 100644 +index 00000000000000..10c4f1a0838b91 +--- /dev/null ++++ b/changelogs/fragments/update-resolvelib-lt-2_0_0.yml +@@ -0,0 +1,2 @@ ++minor_changes: ++ - ansible-galaxy - support ``resolvelib >= 0.5.3, < 2.0.0`` (https://github.com/ansible/ansible/issues/84217). +diff --git a/lib/ansible/galaxy/dependency_resolution/providers.py b/lib/ansible/galaxy/dependency_resolution/providers.py +index 7578cae785c100..d336c3441e2e1d 100644 +--- a/lib/ansible/galaxy/dependency_resolution/providers.py ++++ b/lib/ansible/galaxy/dependency_resolution/providers.py +@@ -39,7 +39,7 @@ class AbstractProvider: # type: ignore[no-redef] + + # TODO: add python requirements to ansible-test's ansible-core distribution info and remove the hardcoded lowerbound/upperbound fallback + RESOLVELIB_LOWERBOUND = SemanticVersion("0.5.3") +-RESOLVELIB_UPPERBOUND = SemanticVersion("1.1.0") ++RESOLVELIB_UPPERBOUND = SemanticVersion("2.0.0") + RESOLVELIB_VERSION = SemanticVersion.from_loose_version(LooseVersion(resolvelib_version)) + + +diff --git a/requirements.txt b/requirements.txt +index 5eaf9f2cbc2911..45c9c01b803647 100644 +--- a/requirements.txt ++++ b/requirements.txt +@@ -12,4 +12,4 @@ packaging + # NOTE: Ref: https://github.com/sarugaku/resolvelib/issues/69 + # NOTE: When updating the upper bound, also update the latest version used + # NOTE: in the ansible-galaxy-collection test suite. +-resolvelib >= 0.5.3, < 1.1.0 # dependency resolver used by ansible-galaxy ++resolvelib >= 0.5.3, < 2.0.0 # dependency resolver used by ansible-galaxy +diff --git a/test/integration/targets/ansible-galaxy-collection/vars/main.yml b/test/integration/targets/ansible-galaxy-collection/vars/main.yml +index 066d2678bca56e..c865871c4fe692 100644 +--- a/test/integration/targets/ansible-galaxy-collection/vars/main.yml ++++ b/test/integration/targets/ansible-galaxy-collection/vars/main.yml +@@ -4,13 +4,15 @@ gpg_homedir: "{{ galaxy_dir }}/gpg" + + offline_server: https://test-hub.demolab.local/api/galaxy/content/api/ + ++# Test oldest and most recently supported, and versions with notable changes. ++# The last breaking change for a feature ansible-galaxy uses was in 0.8.0. ++# It would be redundant to test every minor version since 0.8.0, so we just test against the latest minor release. ++# NOTE: If ansible-galaxy incorporates new resolvelib features, this matrix should be updated to verify the features work on all supported versions. + supported_resolvelib_versions: +- - "0.5.3" # Oldest supported +- - "0.6.0" +- - "0.7.0" +- - "0.8.0" +- - "0.9.0" +- - "1.0.1" ++ - "0.5.3" # test CollectionDependencyProvider050 ++ - "0.6.0" # test CollectionDependencyProvider060 ++ - "0.7.0" # test CollectionDependencyProvider070 ++ - "<2.0.0" # test CollectionDependencyProvider080 + + unsupported_resolvelib_versions: + - "0.2.0" # Fails on import +diff --git a/test/lib/ansible_test/_data/requirements/ansible.txt b/test/lib/ansible_test/_data/requirements/ansible.txt +index 5eaf9f2cbc2911..45c9c01b803647 100644 +--- a/test/lib/ansible_test/_data/requirements/ansible.txt ++++ b/test/lib/ansible_test/_data/requirements/ansible.txt +@@ -12,4 +12,4 @@ packaging + # NOTE: Ref: https://github.com/sarugaku/resolvelib/issues/69 + # NOTE: When updating the upper bound, also update the latest version used + # NOTE: in the ansible-galaxy-collection test suite. +-resolvelib >= 0.5.3, < 1.1.0 # dependency resolver used by ansible-galaxy ++resolvelib >= 0.5.3, < 2.0.0 # dependency resolver used by ansible-galaxy diff --git a/ansible-core.changes b/ansible-core.changes index cbf0f93..ae8e0e4 100644 --- a/ansible-core.changes +++ b/ansible-core.changes @@ -1,3 +1,18 @@ +------------------------------------------------------------------- +Fri Nov 22 07:03:32 UTC 2024 - Johannes Kastl + +- Backport patch to relax resolvelib dependency: + 771f7ad29ca4d259761eaa88673c2e32f6412bbe.patch + +------------------------------------------------------------------- +Thu Nov 21 10:41:19 UTC 2024 - Harshvardhan Sharma + +- Added necessary test dependencies: pytest-xdist, pytest-mock, + pytz, passlib, git-core, and openssh to ensure proper test + execution. +- Introduced the `ansible_python_version` variable and updated the + test command. + ------------------------------------------------------------------- Thu Nov 14 16:23:53 UTC 2024 - Johannes Kastl diff --git a/ansible-core.spec b/ansible-core.spec index ff23d59..676cae6 100644 --- a/ansible-core.spec +++ b/ansible-core.spec @@ -21,11 +21,13 @@ # Leap15, SLES15 %if %pythons == "python310" %define ansible_python python310 +%define ansible_python_version 3.10 %define ansible_python_executable python3.10 %define ansible_python_sitelib %python310_sitelib %endif %if %pythons == "python311" %define ansible_python python311 +%define ansible_python_version 3.11 %define ansible_python_executable python3.11 %define ansible_python_sitelib %python311_sitelib %endif @@ -33,6 +35,7 @@ # Tumbleweed %define pythons python3 %define ansible_python python3 +%define ansible_python_version %python3_version %define ansible_python_executable python3 %define ansible_python_sitelib %python3_sitelib %endif @@ -45,6 +48,8 @@ License: GPL-3.0-or-later URL: https://ansible.com/ Source0: https://files.pythonhosted.org/packages/source/a/ansible-core/ansible_core-%{version}.tar.gz#/ansible_core-%{version}.tar.gz Source1: ansible_core-%{version}.tar.gz.sha256 +# PATCH-FIX-UPSTREAM fix resolvelib dependency +Patch1: https://github.com/ansible/ansible/commit/771f7ad29ca4d259761eaa88673c2e32f6412bbe.patch BuildArch: noarch # cannot be installed with ansible < 3 or ansible-base @@ -61,12 +66,17 @@ BuildRequires: %{ansible_python}-cryptography BuildRequires: %{ansible_python}-packaging BuildRequires: fdupes BuildRequires: python-rpm-macros -BuildRequires: (%{ansible_python}-resolvelib >= 0.5.3 with %{ansible_python}-resolvelib < 1.1.0) +BuildRequires: (%{ansible_python}-resolvelib >= 0.5.3 with %{ansible_python}-resolvelib < 2.0.0) # SECTION test requirements -###BuildRequires: %{ansible_python}-botocore -###BuildRequires: %{ansible_python}-curses -###BuildRequires: %{ansible_python}-pytest -###BuildRequires: %{ansible_python}-pytz +BuildRequires: %{ansible_python}-botocore +BuildRequires: %{ansible_python}-curses +BuildRequires: %{ansible_python}-passlib +BuildRequires: %{ansible_python}-pytest +BuildRequires: %{ansible_python}-pytest-mock +BuildRequires: %{ansible_python}-pytest-xdist +BuildRequires: %{ansible_python}-pytz +BuildRequires: git-core +BuildRequires: openssh # /SECTION # SECTION docs BuildRequires: %{ansible_python}-docutils @@ -75,7 +85,7 @@ Requires: %{ansible_python}-Jinja2 >= 3.0.0 Requires: %{ansible_python}-PyYAML >= 5.1 Requires: %{ansible_python}-cryptography Requires: %{ansible_python}-packaging -Requires: (%{ansible_python}-resolvelib >= 0.5.3 with %{ansible_python}-resolvelib < 1.1.0) +Requires: (%{ansible_python}-resolvelib >= 0.5.3 with %{ansible_python}-resolvelib < 2.0.0) # ansible-documentation is a separate package since 2.15.3 Recommends: ansible-documentation @@ -104,7 +114,7 @@ modules can be written in any language and are transferred to managed machines automatically. %prep -%setup -q -n ansible_core-%{version} +%autosetup -p 1 -n ansible_core-%{version} for file in .git_keep .travis.yml ; do find . -name "$file" -delete @@ -182,7 +192,7 @@ cp -v ./man1/*.1 %{buildroot}/%{_mandir}/man1/ %check # NEVER ship untested pure python packages. Enable this before the final submit. -#python3 bin/ansible-test units -v --python %%{python3_version} +%{ansible_python_executable} bin/ansible-test units -v --python %{ansible_python_version} %files %doc changelogs/CHANGELOG-v2.17.rst changelogs/changelog.yaml