2025-06-18 08:19:04 +00:00
#
# spec file for package python-ansible-compat
#
# Copyright (c) 2025 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via https://bugs.opensuse.org/
#
%{?sle15_python_module_pythons}
2025-06-19 13:07:13 +00:00
%if 0%{?suse_version} >= 1600
2025-06-18 08:19:04 +00:00
# Tumbleweed
# only works with the python version which the package 'ansible' uses
%define pythons python3
%endif
Name : python-ansible-compat
Version : 25.6.0
Release : 0
Summary : Compatibility shim for Ansible 2.9 and newer
License : MIT
URL : https://github.com/ansible-community/ansible-compat
Source : https://github.com/ansible-community/ansible-compat/archive/refs/tags/v%{version} .tar.gz#/%{name}-%{version}.tar.gz
BuildRequires : %{python_module pip}
BuildRequires : %{python_module setuptools_scm}
BuildRequires : %{python_module setuptools}
BuildRequires : %{python_module wheel}
BuildRequires : python-rpm-macros
# SECTION test
# https://github.com/ansible/ansible-compat/blob/main/.config/requirements.in
BuildRequires : ansible-core >= 2.14
BuildRequires : %{python_module PyYAML}
BuildRequires : %{python_module jsonschema >= 4.17.3}
BuildRequires : %{python_module subprocess-tee >= 0.4.1}
# https://github.com/ansible/ansible-compat/blob/main/.config/requirements-test.in
BuildRequires : %{python_module pytest}
BuildRequires : %{python_module pytest-instafail}
BuildRequires : %{python_module pytest-mock}
BuildRequires : %{python_module pytest-plus}
# /SECTION
BuildRequires : fdupes
BuildRequires : python-rpm-generators
Requires : ansible-core >= 2.16
Requires : python-PyYAML
Requires : python-jsonschema >= 4.17.3
Requires : python-packaging
Requires : python-subprocess-tee >= 0.4.1
%{?python_enable_dependency_generator}
BuildArch : noarch
%python_subpackages
%description
Facilitate working with various versions of Ansible 2.9 and newer.
%prep
%setup -q -n ansible-compat-%{version}
%build
%pyproject_wheel
%install
%pyproject_install
%python_expand %fdupes %{buildroot} %{$python_sitelib}
%check
# excluding tests requiring internet connection
IGNORED_CHECKS=" t e s t _ i n s t a l l _ c o l l e c t i o n "
IGNORED_CHECKS=" $ { I G N O R E D _ C H E C K S } o r t e s t _ i n s t a l l _ c o l l e c t i o n _ d e s t "
IGNORED_CHECKS=" $ { I G N O R E D _ C H E C K S } o r t e s t _ p r e p a r e _ e n v i r o n m e n t _ w i t h _ c o l l e c t i o n s "
IGNORED_CHECKS=" $ { I G N O R E D _ C H E C K S } o r t e s t _ p r e r u n _ r e q s _ v 1 "
IGNORED_CHECKS=" $ { I G N O R E D _ C H E C K S } o r t e s t _ p r e r u n _ r e q s _ v 2 "
IGNORED_CHECKS=" $ { I G N O R E D _ C H E C K S } o r t e s t _ r e q u i r e _ c o l l e c t i o n "
IGNORED_CHECKS=" $ { I G N O R E D _ C H E C K S } o r t e s t _ r e q u i r e _ c o l l e c t i o n _ n o _ c a c h e _ d i r "
IGNORED_CHECKS=" $ { I G N O R E D _ C H E C K S } o r t e s t _ r e q u i r e _ c o l l e c t i o n _ w r o n g _ v e r s i o n "
IGNORED_CHECKS=" $ { I G N O R E D _ C H E C K S } o r t e s t _ r u n t i m e _ e x a m p l e "
IGNORED_CHECKS=" $ { I G N O R E D _ C H E C K S } o r t e s t _ r u n t i m e _ r e q u i r e _ m o d u l e "
IGNORED_CHECKS=" $ { I G N O R E D _ C H E C K S } o r t e s t _ s c a n _ s y s _ p a t h [ i s o l a t e d F - s c a n F - r a i s e s _ n o t _ f o u n d T ] "
IGNORED_CHECKS=" $ { I G N O R E D _ C H E C K S } o r t e s t _ s c a n _ s y s _ p a t h [ i s o l a t e d F - s c a n T - r a i s e s _ n o t _ f o u n d F ] "
IGNORED_CHECKS=" $ { I G N O R E D _ C H E C K S } o r t e s t _ s c a n _ s y s _ p a t h [ i s o l a t e d T - s c a n F - r a i s e s _ n o t _ f o u n d T ] "
IGNORED_CHECKS=" $ { I G N O R E D _ C H E C K S } o r t e s t _ s c a n _ s y s _ p a t h [ i s o l a t e d T - s c a n T - r a i s e s _ n o t _ f o u n d T ] "
IGNORED_CHECKS=" $ { I G N O R E D _ C H E C K S } o r t e s t _ s c a n _ s y s _ p a t h [ s c a n F - r a i s e s _ n o t _ f o u n d T ] "
IGNORED_CHECKS=" $ { I G N O R E D _ C H E C K S } o r t e s t _ s c a n _ s y s _ p a t h [ s c a n T - r a i s e s _ n o t _ f o u n d F ] "
IGNORED_CHECKS=" $ { I G N O R E D _ C H E C K S } o r t e s t _ u p g r a d e _ c o l l e c t i o n "
IGNORED_CHECKS=" $ { I G N O R E D _ C H E C K S } o r t e s t _ r u n t i m e _ h a s _ p l a y b o o k "
IGNORED_CHECKS=" $ { I G N O R E D _ C H E C K S } o r t e s t _ l o a d _ p l u g i n s [ m o d u l e s ] "
IGNORED_CHECKS=" $ { I G N O R E D _ C H E C K S } o r t e s t _ g e t _ c a c h e _ d i r _ r e l a t i v e "
IGNORED_CHECKS=" $ { I G N O R E D _ C H E C K S } o r t e s t _ r o _ v e n v "
# tests that need network connectivity
IGNORED_CHECKS=" $ { I G N O R E D _ C H E C K S } o r t e s t _ s c a n _ s y s _ p a t h [ 0 ] "
IGNORED_CHECKS=" $ { I G N O R E D _ C H E C K S } o r t e s t _ s c a n _ s y s _ p a t h [ 1 ] "
IGNORED_CHECKS=" $ { I G N O R E D _ C H E C K S } o r t e s t _ s c a n _ s y s _ p a t h [ d i s a b l e d ] "
IGNORED_CHECKS=" $ { I G N O R E D _ C H E C K S } o r t e s t _ s c a n _ s y s _ p a t h [ e n a b l e d ] "
# Disable checks on test names: https://github.com/pytest-dev/pytest-plus#user-content-avoiding-problematic-test-identifiers https://github.com/ansible/ansible-compat/issues/340
export PYTEST_CHECK_TEST_ID_REGEX=0
%pytest -k " n o t ( $ { I G N O R E D _ C H E C K S } ) "
%files %{python_files}
%{python_sitelib} /ansible_compat
%{python_sitelib} /ansible_compat-%{version} .dist-info
%doc README.md
%license LICENSE
%changelog