81a2e9be2b
https://github.com/ansible/ansible-compat/issues/340 OBS-URL: https://build.opensuse.org/package/show/systemsmanagement:ansible/python-ansible-compat?expand=0&rev=21
101 lines
3.9 KiB
RPMSpec
101 lines
3.9 KiB
RPMSpec
#
|
|
# spec file for package python-ansible-compat
|
|
#
|
|
# Copyright (c) 2022 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}
|
|
%if 0%{?suse_version} >= 1650
|
|
# Tumbleweed
|
|
# only works with the python version which the package 'ansible' uses
|
|
%define pythons python3
|
|
%endif
|
|
|
|
Name: python-ansible-compat
|
|
Version: 4.1.10
|
|
Release: 0
|
|
Summary: Compatibility shim for Ansible 2.9 and newer
|
|
License: MIT
|
|
URL: https://github.com/ansible-community/ansible-compat
|
|
Source: https://files.pythonhosted.org/packages/source/a/ansible-compat/ansible-compat-%{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/pyproject.toml#L38
|
|
BuildRequires: ansible-core >= 2.12
|
|
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/pyproject.toml#L56
|
|
BuildRequires: %{python_module pytest}
|
|
BuildRequires: %{python_module pytest-mock}
|
|
BuildRequires: %{python_module pytest-plus}
|
|
# /SECTION
|
|
BuildRequires: fdupes
|
|
BuildRequires: python-rpm-generators
|
|
Requires: ansible-core >= 2.12
|
|
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="test_install_collection"
|
|
IGNORED_CHECKS="${IGNORED_CHECKS} or test_install_collection_dest"
|
|
IGNORED_CHECKS="${IGNORED_CHECKS} or test_prepare_environment_with_collections"
|
|
IGNORED_CHECKS="${IGNORED_CHECKS} or test_prerun_reqs_v1"
|
|
IGNORED_CHECKS="${IGNORED_CHECKS} or test_prerun_reqs_v2"
|
|
IGNORED_CHECKS="${IGNORED_CHECKS} or test_require_collection"
|
|
IGNORED_CHECKS="${IGNORED_CHECKS} or test_require_collection_no_cache_dir"
|
|
IGNORED_CHECKS="${IGNORED_CHECKS} or test_require_collection_wrong_version"
|
|
IGNORED_CHECKS="${IGNORED_CHECKS} or test_runtime_example"
|
|
IGNORED_CHECKS="${IGNORED_CHECKS} or test_runtime_require_module"
|
|
IGNORED_CHECKS="${IGNORED_CHECKS} or test_scan_sys_path[isolatedF-scanF-raises_not_foundT]"
|
|
IGNORED_CHECKS="${IGNORED_CHECKS} or test_scan_sys_path[isolatedF-scanT-raises_not_foundF]"
|
|
IGNORED_CHECKS="${IGNORED_CHECKS} or test_scan_sys_path[isolatedT-scanF-raises_not_foundT]"
|
|
IGNORED_CHECKS="${IGNORED_CHECKS} or test_scan_sys_path[isolatedT-scanT-raises_not_foundT]"
|
|
IGNORED_CHECKS="${IGNORED_CHECKS} or test_upgrade_collection"
|
|
# 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 "not (${IGNORED_CHECKS})"
|
|
|
|
%files %{python_files}
|
|
%{python_sitelib}/ansible_compat
|
|
%{python_sitelib}/ansible_compat-%{version}.dist-info
|
|
%doc README.md
|
|
%license LICENSE
|
|
|
|
%changelog
|