Compare commits

...
Sign in to create a new pull request.

5 commits

Author SHA1 Message Date
Maxwell G
eccc9b7634 Update to 2.12.10. 2022-10-19 23:58:10 -05:00
Maxwell G
894aee8b6d
Update to 2.12.9. 2022-09-12 20:28:13 -05:00
Maxwell G
d1dc5916d7
Update to 2.12.8. 2022-08-16 19:13:50 -05:00
Maxwell G
ee9859f1e6
Commit patchfile 2022-06-23 20:05:37 -05:00
Maxwell G
86cadce1c5
Update to 2.12.7.
Backport packaging fixes from rawhide
2022-06-23 19:13:18 -05:00
5 changed files with 173 additions and 83 deletions

4
.gitignore vendored
View file

@ -13,3 +13,7 @@
/ansible-core-2.12.4.tar.gz
/ansible-core-2.12.5.tar.gz
/ansible-core-2.12.6.tar.gz
/ansible-core-2.12.7.tar.gz
/ansible-core-2.12.8.tar.gz
/ansible-core-2.12.9.tar.gz
/ansible-core-2.12.10.tar.gz

View file

@ -9,35 +9,59 @@
#
%bcond_without tests
Name: ansible-core
Summary: A radically simple IT automation system
Version: 2.12.6
Release: 1%{?dist}
Name: ansible-core
Summary: A radically simple IT automation system
Version: 2.12.10
Release: 1%{?dist}
License: GPLv3+
Source0: %{pypi_source}
Patch0: https://github.com/ansible/ansible/pull/76670.patch#/fix-tests-failing-on-pytest-7.patch
# The main license is GPLv3+. Many of the files in lib/ansible/module_utils
# are BSD licensed. There are various files scattered throughout the codebase
# containing code under different licenses.
# SPDX-License-Identifier: GPL-3.0-or-later AND BSD-2-Clause AND PSF-2.0 AND MIT AND Apache-2.0
License: GPLv3+ and BSD and Python and MIT and ASL 2.0
Source: %{pypi_source}
Url: https://ansible.com
BuildArch: noarch
Patch: https://github.com/ansible/ansible/pull/76670.patch#/fix-tests-failing-on-pytest-7.patch
# A 2.10.3 async test uses /usr/bin/python, which we do not have by default.
# Patch the test to use /usr/bin/python3 as we have for our build.
Patch: 2.10.3-test-patch.patch
# These patch removes the requirement on python3-mock which is deprecated in Fedora.
# This is based off of work upstream.
Patch: replace-mock.patch
# Require packaging macros if rpm-build exists
# This makes the transition seamless for other packages
Requires: (ansible-packaging if rpm-build)
Url: https://ansible.com
BuildArch: noarch
#Provides: ansible = %%{version}-%%{release}
#Obsoletes: ansible <= 2.9.99
# For now conflict with the ansible 'classic' package.
Conflicts: ansible <= 2.9.99
# Virtual provides for bundled libraries
# Search for `_BUNDLED_METADATA` to find them
# lib/ansible/module_utils/urls.py
# SPDX-License-Identifier: BSD-2-Clause AND PSF-2.0
# Fedora-License-Identifier: BSD and Python
Provides: bundled(python3dist(backports-ssl-match-hostname)) = 3.7.0.1
# lib/ansible/module_utils/distro/*
# SPDX-License-Identifier: Apache-2.0
# Fedora-License-Identifier: ASL 2.0
Provides: bundled(python3dist(distro)) = 1.6.0
# lib/ansible/module_utils/six/*
# SPDX-License-Identifier: MIT
# Fedora-License-Identifier: MIT
Provides: bundled(python3dist(six)) = 1.16.0
# lib/ansible/module_utils/compat/selectors.py
# SPDX-License-Identifier: GPL-3.0-or-later
# Fedora-License-Identifier: GPLv3+
Provides: bundled(python3dist(selectors2)) = 1.1.1
Conflicts: ansible <= 2.9.99
#
# obsoletes/provides for ansible-base
#
Provides: ansible-base = 2.10.7
Obsoletes: ansible-base < 2.10.6-1%{?dist}
Provides: ansible-base = %{version}-%{release}
Obsoletes: ansible-base < 2.10.6-1
# A 2.10.3 async test uses /usr/bin/python, which we do not have by default.
# Patch the test to use /usr/bin/python3 as we have for our build.
Patch1: 2.10.3-test-patch.patch
%if %{with tests}
#
@ -45,68 +69,59 @@ Patch1: 2.10.3-test-patch.patch
#
# These two exist on both fedora and rhel8
#
BuildRequires: make
BuildRequires: git-core
BuildRequires: python3-packaging
BuildRequires: python3-pexpect
BuildRequires: openssl
BuildRequires: python3-systemd
BuildRequires: python3-pytz
BuildRequires: glibc-all-langpacks
BuildRequires: python3-resolvelib
BuildRequires: make
BuildRequires: git-core
BuildRequires: python3-packaging
BuildRequires: python3-pexpect
BuildRequires: python3-systemd
BuildRequires: python3-pytz
BuildRequires: glibc-all-langpacks
BuildRequires: python3-resolvelib
#
# These only exist on Fedora. RHEL8 will just skip tests that need them.
#
%if 0%{?fedora}
BuildRequires: python3-paramiko
BuildRequires: python3-winrm
BuildRequires: python3-paramiko
BuildRequires: python3-winrm
BuildRequires: python3-crypto
BuildRequires: python3-pbkdf2
BuildRequires: python3-httmock
BuildRequires: python3-gitlab
BuildRequires: python3-boto3
BuildRequires: python3-botocore
BuildRequires: python3-coverage
BuildRequires: python3-passlib
BuildRequires: python3-coverage
BuildRequires: python3-passlib
%endif
%endif
%if %{with docs}
BuildRequires: make
BuildRequires: python3-sphinx
BuildRequires: python3-sphinx-theme-alabaster
BuildRequires: python3-sphinx-notfound-page
BuildRequires: asciidoc
BuildRequires: python3-straight-plugin
BuildRequires: python3-rstcheck
BuildRequires: python3-pygments
BuildRequires: antsibull
BuildRequires: make
BuildRequires: python3-sphinx
BuildRequires: python3-sphinx-theme-alabaster
BuildRequires: python3-sphinx-notfound-page
BuildRequires: asciidoc
BuildRequires: python3-straight-plugin
BuildRequires: python3-rstcheck
BuildRequires: python3-pygments
BuildRequires: antsibull
%endif
#
# main buildrequires to build
#
BuildRequires: python3-devel
BuildRequires: python3-setuptools
BuildRequires: python3-six
BuildRequires: python3-pytest
BuildRequires: python3-pytest-xdist
BuildRequires: python3-pytest-mock
BuildRequires: python3-requests
BuildRequires: python3-mock
BuildRequires: python3-jinja2
BuildRequires: python3-pyyaml
BuildRequires: python3-cryptography
BuildRequires: python3-pyvmomi
BuildRequires: python3-devel
BuildRequires: python3-setuptools
BuildRequires: python3-pytest
BuildRequires: python3-pytest-xdist
BuildRequires: python3-pytest-mock
BuildRequires: python3-jinja2
BuildRequires: python3-pyyaml
BuildRequires: python3-cryptography
BuildRequires: python3-pyvmomi
BuildRequires: python%{python3_pkgversion}-argcomplete
# RHEL8 doesn't have python3-paramiko or python3-winrm (yet), but Fedora does
Recommends: python3-paramiko
Recommends: python3-winrm
Recommends: python3-paramiko
Recommends: python3-winrm
# needed for json_query filter
Requires: python3-jmespath
# needed for galaxy
Requires: python3-resolvelib
Requires: python%{python3_pkgversion}-argcomplete
# Require packaging macros if rpm-build exists
# This makes the transition seamless for other packages
Requires: (ansible-packaging if rpm-build)
%description
Ansible is a radically simple model-driven configuration management,
@ -135,8 +150,10 @@ This package installs extensive documentation for ansible-core
%prep
%autosetup -p1
%build
# Remove shebangs. They are unnecessary and conflict with the Fedora Packaging Guidelines
find -type f ! -executable -name '*.py' -print -exec sed -i -e '1{\@^#!.*@d}' '{}' \;
%build
sed -i -s 's|/usr/bin/env python|/usr/bin/python3|' test/lib/ansible_test/_util/target/cli/ansible_test_cli_stub.py
# disable the python -s shbang flag as we want to be able to find non system modules
@ -150,9 +167,34 @@ sed -i -s 's|/usr/bin/env python|/usr/bin/python3|' test/lib/ansible_test/_util/
# make PYTHON=/usr/bin/python3 -Cdocs/docsite config cli keywords modules plugins testing
%endif
(
cd bin
for shell in bash fish; do
mkdir -p "../${shell}_completions"
for bin in *; do
if grep -q PYTHON_ARGCOMPLETE_OK "${bin}"; then
case "${shell}" in
bash)
format="${bin}"
;;
fish)
format="${bin}.${shell}"
;;
esac
register-python-argcomplete --shell "${shell}" "${bin}" > "../${shell}_completions/${format}"
else
echo "Skipped generating completions for ${bin}"
fi
done
done
)
%install
%py3_install
install -Dpm 0644 bash_completions/* -t %{buildroot}%{_datadir}/bash-completion/completions
install -Dpm 0644 fish_completions/* -t %{buildroot}%{_datadir}/fish/vendor_completions.d
# Create system directories that Ansible defines as default locations in
# ansible/config/base.yml
DATADIR_LOCATIONS='%{_datadir}/ansible/collections
@ -186,7 +228,7 @@ fi
mkdir -p %{buildroot}%{_datadir}/ansible/plugins/
for location in $DATADIR_LOCATIONS ; do
mkdir %{buildroot}"$location"
mkdir %{buildroot}"$location"
done
mkdir -p %{buildroot}/etc/ansible/
mkdir -p %{buildroot}/etc/ansible/roles/
@ -203,15 +245,6 @@ find %{buildroot}/%{python3_sitelib} -name .travis.yml -exec rm -f {} \;
%check
%if %{with tests}
ln -s /usr/bin/pytest-3 bin/pytest
# This test needs a module not packaged in Fedora so disable it.
#rm -f test/units/modules/cloud/cloudstack/test_cs_traffic_type.py
# These tests are failing with pytest 6
rm -f test/units/galaxy/test_collection_install.py
rm -f test/units/module_utils/urls/test_prepare_multipart.py
# requires perms to read/manipulate iptables rules
rm -f test/units/modules/test_iptables.py
# This seems sunos specific
rm -f test/units/modules/test_service.py
make PYTHON=/usr/bin/python3 tests-py3
%endif
@ -220,9 +253,13 @@ make PYTHON=/usr/bin/python3 tests-py3
%doc README.rst PKG-INFO changelogs/CHANGELOG-v2.12.rst
%dir %{_sysconfdir}/ansible/
%config(noreplace) %{_sysconfdir}/ansible/*
%{_mandir}/man1/ansible*
%{_bindir}/ansible*
%{_datadir}/ansible/
%{_datadir}/bash-completion/completions/ansible*
%dir %{_datadir}/fish
%dir %{_datadir}/fish/vendor_completions.d
%{_datadir}/fish/vendor_completions.d/ansible*.fish
%{_mandir}/man1/ansible*
%{python3_sitelib}/ansible
%{python3_sitelib}/ansible_test
%{python3_sitelib}/*egg-info
@ -234,6 +271,19 @@ make PYTHON=/usr/bin/python3 tests-py3
%endif
%changelog
* Thu Oct 20 2022 Maxwell G <gotmax@e.email> - 2.12.10-1
- Update to 2.12.10.
* Tue Sep 13 2022 Maxwell G <gotmax@e.email> - 2.12.9-1
- Update to 2.12.9.
* Wed Aug 17 2022 Maxwell G <gotmax@e.email> - 2.12.8-1
- Update to 2.12.8.
* Thu Jun 23 2022 Maxwell G <gotmax@e.email> - 2.12.7-1
- Update to 2.12.7.
- Backport packaging fixes from rawhide
* Tue May 24 2022 Maxwell G <gotmax@e.email> - 2.12.6-1
- Update to 2.12.6.

View file

@ -11,14 +11,14 @@ Subject: [PATCH 1/2] Fix pytest 7 failures with leaky fixture
diff --git a/changelogs/fragments/ansible-test-pytest7.yml b/changelogs/fragments/ansible-test-pytest7.yml
new file mode 100644
index 0000000000000..305dddb181b4e
index 00000000000000..305dddb181b4e7
--- /dev/null
+++ b/changelogs/fragments/ansible-test-pytest7.yml
@@ -0,0 +1,2 @@
+bugfixes:
+- ansible-test - Fix tests that were broken with ``pytest 7`` - https://github.com/ansible/ansible/issues/76577
diff --git a/test/units/galaxy/test_role_install.py b/test/units/galaxy/test_role_install.py
index cf990b55a6d90..687fcac1e53fb 100644
index cf990b55a6d902..687fcac1e53fb9 100644
--- a/test/units/galaxy/test_role_install.py
+++ b/test/units/galaxy/test_role_install.py
@@ -8,6 +8,7 @@
@ -100,7 +100,7 @@ Subject: [PATCH 2/2] zap changelog
diff --git a/changelogs/fragments/ansible-test-pytest7.yml b/changelogs/fragments/ansible-test-pytest7.yml
deleted file mode 100644
index 305dddb181b4e..0000000000000
index 305dddb181b4e7..00000000000000
--- a/changelogs/fragments/ansible-test-pytest7.yml
+++ /dev/null
@@ -1,2 +0,0 @@

36
replace-mock.patch Normal file
View file

@ -0,0 +1,36 @@
diff -Naur a/test/units/executor/test_task_executor.py b/test/units/executor/test_task_executor.py
--- a/test/units/executor/test_task_executor.py 2022-06-20 08:45:43.256268500 -0500
+++ b/test/units/executor/test_task_executor.py 2022-06-23 15:15:00.923335000 -0500
@@ -19,7 +19,7 @@
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
-import mock
+from unittest import mock
from units.compat import unittest
from units.compat.mock import patch, MagicMock
diff -Naur a/test/units/module_utils/urls/test_fetch_url.py b/test/units/module_utils/urls/test_fetch_url.py
--- a/test/units/module_utils/urls/test_fetch_url.py 2022-06-20 08:45:43.277268600 -0500
+++ b/test/units/module_utils/urls/test_fetch_url.py 2022-06-23 15:15:37.487225940 -0500
@@ -13,7 +13,7 @@
from ansible.module_utils.urls import fetch_url, urllib_error, ConnectionError, NoSSLError, httplib
import pytest
-from mock import MagicMock
+from unittest.mock import MagicMock
class AnsibleModuleExit(Exception):
diff -Naur a/test/units/module_utils/urls/test_Request.py b/test/units/module_utils/urls/test_Request.py
--- a/test/units/module_utils/urls/test_Request.py 2022-06-20 08:45:43.277268600 -0500
+++ b/test/units/module_utils/urls/test_Request.py 2022-06-23 15:15:37.487225940 -0500
@@ -13,7 +13,7 @@
from ansible.module_utils.urls import SSLValidationHandler, HTTPSClientAuthHandler, RedirectHandlerFactory
import pytest
-from mock import call
+from unittest.mock import call
if HAS_SSLCONTEXT:

View file

@ -1 +1 @@
SHA512 (ansible-core-2.12.6.tar.gz) = 55138701f3733b1ea2049783d9d0246beb7cc778090785eada756c9ef540b248bc345e07a261d5542648fc22088bc25e3ab57f7b904bba615264d5556baae456
SHA512 (ansible-core-2.12.10.tar.gz) = 8b4eb0e923f976680e81ffbe942c4ddc7ddaaaffe83d14c20f78f7c6ab4f548f21920cdfa57b48de2bc24683028e744a92ac4ca45fecc459ea2b042de8c40737