File python-cached-ipaddress.spec of Package python-cached-ipaddress

#
# spec file for package python-cached-ipaddress
#
# 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/
#


%global flavor @BUILD_FLAVOR@%{nil}
%if "%{flavor}" == "test"
%define psuffix -test
%bcond_without test
%else
%define psuffix %{nil}
%bcond_with test
%endif
%define pname cached-ipaddress
%{?sle15_python_module_pythons}
Name:           python-%{pname}%{psuffix}
Version:        0.10.0
Release:        0
Summary:        Python library for cached ipaddress objects
License:        Apache-2.0
Group:          Development/Languages/Python
URL:            https://github.com/bdraco/cached-ipaddress
Source0:        python-%{pname}-%{version}.tar.xz
BuildRequires:  %{python_module pip}
BuildRequires:  %{python_module poetry}
%if %{with test}
BuildRequires:  %{python_module propcache}
BuildRequires:  %{python_module pytest-cov}
BuildRequires:  %{python_module pytest}
%endif
BuildRequires:  fdupes
BuildRequires:  python-rpm-macros
Requires:       python-propcache
%python_subpackages

%description
Cache construction of ipaddress objects.

%prep
%setup -q -n python-%{pname}-%{version}

%if !%{with test}
%build
%pyproject_wheel

%install
%pyproject_install
%python_expand %fdupes %{buildroot}%{$python_sitearch}
%endif

%if %{with test}
%check
%pytest
%endif

%if !%{with test}
%files %python_files
%defattr(-,root,root,-)
%{python_sitearch}/*
%doc CHANGELOG.md CONTRIBUTING.md README.md
%license LICENSE
%endif

%changelog
openSUSE Build Service is sponsored by