Date: Tuesday, April 11, 2023 @ 12:36:42 Author: dvzrv Revision: 1444664
upgpkg: ansible-core 2.14.4-3: Rebuild to add backported patch for resolvelib > 0.10.0. Add simple backport for resolvelib support > 0.10.0: https://github.com/ansible/ansible/commit/b148fd8dd74c8599f809f71117a86577ccfb0638 https://github.com/ansible/ansible/commit/016b7f71b10539c90ddbb3246f19f9cbf0e65428 Add (commented) check() function, which highlights different test approaches (all do not work): https://github.com/ansible/ansible/issues/80472 Added: ansible-core/trunk/ansible-core-2.14.4-resolvelib_1.1.patch Modified: ansible-core/trunk/PKGBUILD ------------------------------------------+ PKGBUILD | 72 +++++++++++++++++++++++++---- ansible-core-2.14.4-resolvelib_1.1.patch | 30 ++++++++++++ 2 files changed, 93 insertions(+), 9 deletions(-) Modified: PKGBUILD =================================================================== --- PKGBUILD 2023-04-11 12:29:46 UTC (rev 1444663) +++ PKGBUILD 2023-04-11 12:36:42 UTC (rev 1444664) @@ -9,14 +9,43 @@ pkgname=ansible-core pkgver=2.14.4 -pkgrel=2 +pkgrel=3 pkgdesc='Radically simple IT automation platform' arch=('any') url='https://pypi.org/project/ansible-core' license=('GPL3') -depends=('python' 'python-cryptography' 'python-jinja' 'python-packaging' 'python-pyyaml' 'python-resolvelib') +depends=( + 'python' + 'python-cryptography' + 'python-jinja' + 'python-packaging' + 'python-pyyaml' + 'python-resolvelib' +) # not directly required, but either convenient or indirectly required depends+=('python-paramiko' 'python-typing-extensions') +makedepends=( + 'python-build' + 'python-docutils' + 'python-installer' + 'python-setuptools' + 'python-straight.plugin' + 'python-wheel' +) +checkdepends=( + 'git' + 'python-bcrypt' + 'python-botocore' + 'python-passlib' + 'python-pexpect' + 'python-py' # missing as dependency of python-pytest-forked + 'python-pytest' + 'python-pytest-mock' + 'python-pytest-xdist' + 'python-pytest-forked' + 'python-pywinrm' + 'python-voluptuous' +) optdepends=( 'python-dnspython: for dig lookup' 'python-jmespath: json_query support' @@ -28,18 +57,23 @@ 'python-systemd: for journald support' 'sshpass: for ssh connections with password' ) -makedepends=('python-build' 'python-docutils' 'python-installer' 'python-setuptools' 'python-straight.plugin' 'python-wheel') provides=('python-ansible' 'ansible-base') replaces=('ansible-base') backup=('etc/ansible/ansible.cfg') -source=("https://pypi.python.org/packages/source/a/ansible-core/ansible-core-${pkgver}.tar.gz") -sha512sums=('86164dfded15232174e4f11140a71b91ef5b0d93b40a2df9588930b4b955f20feb419258c2bbf9d6735d298ec626c88c5e9b1c933a51e3273a28b85fac7a3762') -b2sums=('ae096debaf676dbd46cb047f0f87af5d09b4265368500964bbd0cf3ac8e58969bee489d66486fb570a697df5b22065fae206f1df361eb911a7fe025628655371') +source=( + "https://pypi.python.org/packages/source/a/ansible-core/ansible-core-${pkgver}.tar.gz" + "$pkgname-2.14.4-resolvelib_1.1.patch" +) +sha512sums=('86164dfded15232174e4f11140a71b91ef5b0d93b40a2df9588930b4b955f20feb419258c2bbf9d6735d298ec626c88c5e9b1c933a51e3273a28b85fac7a3762' + 'f69bfd47c7079873c78ca795fb83826ffebfc6b5955759484c08edfd651baf0c9ef136b6df1a9bedceebd80fb26ee0f8b95b07f1fb38ee50506c65b17e2cef5a') +b2sums=('ae096debaf676dbd46cb047f0f87af5d09b4265368500964bbd0cf3ac8e58969bee489d66486fb570a697df5b22065fae206f1df361eb911a7fe025628655371' + '87ab3cac6acdefbf265526803ace205ade1caed8a97e244a8e96d5329b1779661defb5fa0d4ebf2ebee7e2bc547a7996aa7adc82126d07d3b226ad2fd133370f') prepare() { - cd $pkgname-$pkgver - # remove the resolvelib upper boundary (at least for < 0.9.0): https://github.com/ansible/ansible/pull/79399 - sed -e 's/resolvelib.*/resolvelib/' -i requirements.txt + # backport (minus test requirements!) of patch to add resolvelib < 1.1.0 support + # https://github.com/ansible/ansible/commit/b148fd8dd74c8599f809f71117a86577ccfb0638 + # https://github.com/ansible/ansible/commit/016b7f71b10539c90ddbb3246f19f9cbf0e65428 + patch -Np1 -d $pkgname-$pkgver -i ../$pkgname-2.14.4-resolvelib_1.1.patch } build() { @@ -49,6 +83,26 @@ make docs } +# tests don't find the ansible-core internals: https://github.com/ansible/ansible/issues/80472 +# check() { +# local site_packages=$(python -c "import site; print(site.getsitepackages()[0])") + +# cd $pkgname-$pkgver +# # install to test location +# # python -m installer --destdir=test_dir dist/*.whl +# # export PYTHONPATH="test_dir/$site_packages:$PYTHONPATH" +# # export PATH="$PWD/test_dir/usr/bin:$PATH" +# # pytest -vv test/units/ + +# # upstream test wrapper +# # bin/ansible-test units + +# # run only locally +# # export PYTHONPATH="lib:$PYTHONPATH" +# # export PATH="bin:$PATH" +# # pytest -vv --ignore test/integration/ --ignore test/ansible_test/ +# } + package() { cd $pkgname-$pkgver python -m installer --destdir="$pkgdir" dist/*.whl Added: ansible-core-2.14.4-resolvelib_1.1.patch =================================================================== --- ansible-core-2.14.4-resolvelib_1.1.patch (rev 0) +++ ansible-core-2.14.4-resolvelib_1.1.patch 2023-04-11 12:36:42 UTC (rev 1444664) @@ -0,0 +1,30 @@ +diff -ruN a/lib/ansible/galaxy/dependency_resolution/providers.py b/lib/ansible/galaxy/dependency_resolution/providers.py +--- a/lib/ansible/galaxy/dependency_resolution/providers.py 2023-03-27 19:29:13.000000000 +0200 ++++ b/lib/ansible/galaxy/dependency_resolution/providers.py 2023-04-10 22:10:30.216701977 +0200 +@@ -42,7 +42,7 @@ + + # 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("0.9.0") ++RESOLVELIB_UPPERBOUND = SemanticVersion("1.1.0") + RESOLVELIB_VERSION = SemanticVersion.from_loose_version(LooseVersion(resolvelib_version)) + + +@@ -220,7 +220,7 @@ + Mapping of identifier, list of named tuple pairs. + The named tuples have the entries ``requirement`` and ``parent``. + +- resolvelib >=0.8.0, <= 0.8.1 ++ resolvelib >=0.8.0, <= 1.0.1 + + :param identifier: The value returned by ``identify()``. + +diff -ruN a/test/lib/ansible_test/_data/requirements/ansible.txt b/test/lib/ansible_test/_data/requirements/ansible.txt +--- a/test/lib/ansible_test/_data/requirements/ansible.txt 2023-03-27 19:29:13.000000000 +0200 ++++ b/test/lib/ansible_test/_data/requirements/ansible.txt 2023-04-10 22:11:39.433634202 +0200 +@@ -12,4 +12,4 @@ + # 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, < 0.9.0 # dependency resolver used by ansible-galaxy ++resolvelib >= 0.5.3, < 1.1.0 # dependency resolver used by ansible-galaxy
