File python-hardeneks.spec of Package python-hardeneks

#
# spec file for package python-hardeneks
#
# 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}
Name:           python-hardeneks
Version:        0.11.2
Release:        0
Summary:        Runs checks to see if an EKS cluster follows EKS Best Practices
License:        MIT-0
URL:            https://github.com/aws-samples/hardeneks
Source:         https://github.com/aws-samples/hardeneks/archive/refs/tags/v%{version}.tar.gz#/hardeneks-%{version}.tar.gz
BuildRequires:  python-rpm-macros
BuildRequires:  %{python_module pip}
BuildRequires:  %{python_module poetry-core}
# SECTION runtime requirements
# declare runtime dependencies as BuildRequires,
# so this only builds if all dependencies will be met
BuildRequires:  %{python_module boto3}
BuildRequires:  %{python_module kubernetes}
BuildRequires:  %{python_module typer}
BuildRequires:  %{python_module pre-commit}
# https://github.com/aws-samples/hardeneks/issues/58
# BuildRequires:  %{python_module tox-gh-actions}
# /SECTION runtime requirements
# SECTION test requirements
BuildRequires:  %{python_module pytest}
BuildRequires:  %{python_module pytest-datadir}
# /SECTION
BuildRequires:  fdupes
BuildRequires:  dos2unix
BuildArch:      noarch
Requires(post): update-alternatives
Requires(postun): update-alternatives
# https://github.com/aws-samples/hardeneks/blob/main/pyproject.toml#L8
Requires:       boto3
Requires:       kubernetes
Requires:       typer
Requires:       pre-commit
# https://github.com/aws-samples/hardeneks/issues/58
#Requires:       tox-gh-actions
%python_subpackages

%description
Runs checks to see if an EKS cluster follows [EKS Best
Practices](https://aws.github.io/aws-eks-best-practices/).

%prep
%autosetup -p1 -n hardeneks-%{version}

%build
%pyproject_wheel

# wrong-file-end-of-line-encoding
dos2unix README.md

%install
%pyproject_install
%python_clone -a %{buildroot}%{_bindir}/hardeneks
%python_expand %fdupes %{buildroot}%{$python_sitelib}

%check
%pytest

%post
%python_install_alternative hardeneks

%postun
%python_uninstall_alternative hardeneks

%files %{python_files}
%doc README.md
%license LICENSE
%python_alternative %{_bindir}/hardeneks
%{python_sitelib}/hardeneks
%{python_sitelib}/hardeneks-%{version}.dist-info

%changelog
openSUSE Build Service is sponsored by