2018-09-11 11:52:10 +02:00
|
|
|
#
|
|
|
|
# spec file for package ansible-lint
|
|
|
|
#
|
2022-02-15 18:15:02 +01:00
|
|
|
# Copyright (c) 2022 SUSE LLC
|
2018-09-11 11:52:10 +02:00
|
|
|
# Copyright 2018 by Lars Vogdt
|
|
|
|
#
|
|
|
|
# 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.
|
|
|
|
|
2022-02-15 18:15:02 +01:00
|
|
|
# Please submit bugfixes or comments via https://bugs.opensuse.org/
|
2018-09-11 11:52:10 +02:00
|
|
|
#
|
|
|
|
|
2023-05-16 12:16:18 +02:00
|
|
|
%{?sle15_python_module_pythons}
|
2022-12-02 08:24:13 +01:00
|
|
|
%if 0%{?suse_version} < 1550
|
|
|
|
# Leap15, SLES15
|
2023-05-16 12:16:18 +02:00
|
|
|
%if %pythons == "python310"
|
2022-12-02 08:24:13 +01:00
|
|
|
%define ansible_python python310
|
|
|
|
%define ansible_python_executable python3.10
|
|
|
|
%define ansible_python_sitelib %python310_sitelib
|
2023-05-16 12:16:18 +02:00
|
|
|
%endif
|
|
|
|
%if %pythons == "python311"
|
|
|
|
%define ansible_python python311
|
|
|
|
%define ansible_python_executable python3.11
|
|
|
|
%define ansible_python_sitelib %python311_sitelib
|
|
|
|
%endif
|
2022-12-02 08:24:13 +01:00
|
|
|
%else
|
|
|
|
# Tumbleweed
|
2023-05-16 12:16:18 +02:00
|
|
|
%define pythons python3
|
2022-12-02 08:24:13 +01:00
|
|
|
%define ansible_python python3
|
|
|
|
%define ansible_python_executable python3
|
|
|
|
%define ansible_python_sitelib %python3_sitelib
|
|
|
|
%endif
|
2018-09-11 11:52:10 +02:00
|
|
|
|
2017-09-10 08:42:53 +02:00
|
|
|
%global lib_name ansiblelint
|
2022-02-01 21:07:40 +01:00
|
|
|
%{?python_enable_dependency_generator}
|
2022-02-15 18:15:02 +01:00
|
|
|
Name: ansible-lint
|
2023-10-19 08:14:37 +02:00
|
|
|
Version: 6.21.0
|
2022-07-28 22:37:26 +02:00
|
|
|
Release: 0%{?dist}
|
2022-02-15 18:15:02 +01:00
|
|
|
Summary: Best practices checker for Ansible
|
|
|
|
License: MIT
|
|
|
|
URL: https://github.com/ansible-community/ansible-lint
|
2022-10-06 09:24:46 +02:00
|
|
|
Source0: https://github.com/ansible-community/ansible-lint/archive/v%{version}/ansible-lint-%{version}.tar.gz#/ansible-lint-%{version}.tar.gz
|
2022-02-15 18:15:02 +01:00
|
|
|
BuildArch: noarch
|
|
|
|
BuildRequires: python-rpm-macros
|
2023-03-07 16:13:07 +01:00
|
|
|
BuildRequires: %{ansible_python}-base >= 3.9
|
2022-12-02 08:24:13 +01:00
|
|
|
BuildRequires: %{ansible_python}-pip
|
|
|
|
BuildRequires: %{ansible_python}-wheel
|
2022-10-06 11:27:43 +02:00
|
|
|
BuildRequires: fdupes
|
|
|
|
|
2022-02-01 21:07:40 +01:00
|
|
|
# SECTION tests
|
2022-12-02 08:24:13 +01:00
|
|
|
BuildRequires: %{ansible_python}-flaky >= 3.7.0
|
2023-09-20 08:59:20 +02:00
|
|
|
BuildRequires: %{ansible_python}-pytest >= 7.2.2
|
2022-12-02 08:24:13 +01:00
|
|
|
BuildRequires: %{ansible_python}-pytest-cov
|
|
|
|
BuildRequires: %{ansible_python}-pytest-xdist >= 2.1.0
|
|
|
|
BuildRequires: %{ansible_python}-psutil
|
|
|
|
BuildRequires: %{ansible_python}-black >= 22.8.0
|
|
|
|
BuildRequires: %{ansible_python}-mypy
|
|
|
|
BuildRequires: %{ansible_python}-pylint
|
|
|
|
BuildRequires: %{ansible_python}-flake8
|
2022-10-06 11:27:43 +02:00
|
|
|
# /SECTION
|
|
|
|
|
|
|
|
# Add runtime requirements (unless required for tests)
|
|
|
|
# to make sure this only builds if they are present
|
2023-09-07 09:49:48 +02:00
|
|
|
# https://github.com/ansible/ansible-lint/blob/main/.config/requirements.in
|
|
|
|
BuildRequires: ansible-core >= 2.15.0
|
|
|
|
BuildRequires: %{ansible_python}-ansible-compat >= 4.1.10
|
|
|
|
BuildRequires: %{ansible_python}-black >= 22.8.0
|
2023-05-22 08:06:55 +02:00
|
|
|
BuildRequires: %{ansible_python}-enrich >= 1.2.7
|
2023-09-07 09:49:48 +02:00
|
|
|
BuildRequires: %{ansible_python}-filelock >= 3.3.0
|
2023-05-22 08:06:55 +02:00
|
|
|
BuildRequires: %{ansible_python}-jsonschema >= 4.17.3
|
2023-06-01 11:19:02 +02:00
|
|
|
BuildRequires: %{ansible_python}-packaging >= 23.1
|
2023-09-07 09:49:48 +02:00
|
|
|
BuildRequires: %{ansible_python}-PyYAML >= 6.0.1
|
|
|
|
BuildRequires: %{ansible_python}-requests >= 2.31.0
|
|
|
|
BuildRequires: %{ansible_python}-rich >= 13.5.2
|
2023-06-01 11:19:02 +02:00
|
|
|
BuildRequires: (%{ansible_python}-ruamel.yaml >= 0.17.31 and %{ansible_python}-ruamel.yaml < 0.18)
|
2023-05-22 08:06:55 +02:00
|
|
|
BuildRequires: %{ansible_python}-subprocess-tee >= 0.4.1
|
2022-12-02 08:24:13 +01:00
|
|
|
BuildRequires: %{ansible_python}-tenacity
|
2023-05-22 08:06:55 +02:00
|
|
|
BuildRequires: %{ansible_python}-wcmatch >= 8.4.1
|
2023-06-01 11:19:02 +02:00
|
|
|
BuildRequires: %{ansible_python}-yamllint >= 1.32.0
|
2022-10-06 11:27:43 +02:00
|
|
|
|
2023-02-15 19:58:12 +01:00
|
|
|
#
|
2023-09-07 09:49:48 +02:00
|
|
|
# https://github.com/ansible/ansible-lint/blob/main/.config/requirements.in
|
|
|
|
Requires: ansible-core >= 2.15.0
|
|
|
|
Requires: %{ansible_python}-ansible-compat >= 4.1.10
|
|
|
|
Requires: %{ansible_python}-black >= 22.8.0
|
2023-05-22 08:06:55 +02:00
|
|
|
Requires: %{ansible_python}-bracex >= 2.2.1
|
2023-09-20 08:59:20 +02:00
|
|
|
Requires: %{ansible_python}-enrich >= 1.2.7
|
2023-09-07 09:49:48 +02:00
|
|
|
Requires: %{ansible_python}-filelock >= 3.3.0
|
|
|
|
Requires: %{ansible_python}-jsonschema >= 4.17.3
|
2023-06-01 11:19:02 +02:00
|
|
|
Requires: %{ansible_python}-packaging >= 23.1
|
2023-09-07 09:49:48 +02:00
|
|
|
Requires: %{ansible_python}-PyYAML >= 6.0.1
|
|
|
|
Requires: %{ansible_python}-requests >= 2.31.0
|
|
|
|
Requires: %{ansible_python}-rich >= 13.5.2
|
2023-06-01 11:19:02 +02:00
|
|
|
Requires: (%{ansible_python}-ruamel.yaml >= 0.17.31 and %{ansible_python}-ruamel.yaml < 0.18)
|
2023-05-22 08:06:55 +02:00
|
|
|
Requires: %{ansible_python}-subprocess-tee >= 0.4.1
|
2022-12-02 08:24:13 +01:00
|
|
|
Requires: %{ansible_python}-tenacity
|
2023-05-22 08:06:55 +02:00
|
|
|
Requires: %{ansible_python}-wcmatch >= 8.4.1
|
2023-06-01 11:19:02 +02:00
|
|
|
Requires: %{ansible_python}-yamllint >= 1.32.0
|
2017-09-10 08:42:53 +02:00
|
|
|
|
|
|
|
%description
|
2022-02-01 21:07:40 +01:00
|
|
|
Checks playbooks for practices and behavior that could potentially be improved.
|
2017-09-10 08:42:53 +02:00
|
|
|
|
|
|
|
%prep
|
2022-10-06 09:24:46 +02:00
|
|
|
%setup -n %{name}-%{version}
|
2022-12-24 13:24:42 +01:00
|
|
|
sed -i '/^dynamic/d' pyproject.toml
|
|
|
|
sed -i '/^description/a version = "%{version}"' pyproject.toml
|
2022-02-01 21:07:40 +01:00
|
|
|
sed -i '1{/\/usr\/bin\/env python/d;}' src/ansiblelint/__main__.py
|
2023-05-22 08:06:55 +02:00
|
|
|
sed -i '/__version__ =/ s/0.1.dev1/%{version}/' src/ansiblelint/version.py
|
2017-09-10 08:42:53 +02:00
|
|
|
|
|
|
|
%build
|
2022-12-24 13:24:42 +01:00
|
|
|
%{ansible_python_executable} -mpip wheel --no-deps --disable-pip-version-check --use-pep517 --no-build-isolation --progress-bar off --verbose --wheel-dir ./build/ .
|
|
|
|
mkdir -p ./dist
|
|
|
|
cp ./build/ansible_lint-*-none-any.whl ./dist/
|
2017-09-10 08:42:53 +02:00
|
|
|
|
|
|
|
%install
|
2022-12-24 13:24:42 +01:00
|
|
|
|
|
|
|
%{ansible_python_executable} -mpip install --root %{buildroot} --disable-pip-version-check --no-compile --no-deps --progress-bar off --ignore-installed --no-index --verbose --find-links build/ansible_lint-*.whl ansible_lint==%{version}
|
2022-12-02 08:24:13 +01:00
|
|
|
find %{buildroot}/%{ansible_python_sitelib} -name '*.pyc' -delete
|
|
|
|
%{ansible_python_executable} -m compileall %{buildroot}/%{ansible_python_sitelib}
|
|
|
|
%{ansible_python_executable} -O -m compileall %{buildroot}/%{ansible_python_sitelib}
|
2022-12-24 13:24:42 +01:00
|
|
|
cp -vr src/ansiblelint/schemas %{buildroot}/%{ansible_python_sitelib}/%{lib_name}/
|
|
|
|
cp -vr src/ansiblelint/data %{buildroot}/%{ansible_python_sitelib}/%{lib_name}/
|
2017-09-10 08:42:53 +02:00
|
|
|
|
2022-12-02 08:24:13 +01:00
|
|
|
%fdupes -s %{buildroot}/%{ansible_python_sitelib}
|
2017-09-10 08:42:53 +02:00
|
|
|
|
2022-02-01 21:07:40 +01:00
|
|
|
%files
|
2022-07-21 19:55:21 +02:00
|
|
|
%doc README.md
|
|
|
|
%license COPYING
|
2022-02-01 21:07:40 +01:00
|
|
|
%{_bindir}/ansible-lint
|
2022-12-02 08:24:13 +01:00
|
|
|
%{ansible_python_sitelib}/%{lib_name}/
|
|
|
|
%{ansible_python_sitelib}/ansible_lint-%{version}.dist-info/
|
2017-09-10 08:42:53 +02:00
|
|
|
|
|
|
|
%changelog
|