File python-aiodiscover.spec of Package python-aiodiscover

#
# spec file for package python-aiodiscover
#
# 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 aiodiscover
Name:           python-%{pname}%{psuffix}
Version:        2.7.0
Release:        0
Summary:        Python library for async host discovery
License:        Apache-2.0
Group:          Development/Languages/Python
URL:            https://github.com/bdraco/aiodiscover
Source0:        python-%{pname}-%{version}.tar.xz
BuildArch:      noarch
BuildRequires:  %{python_module pip}
BuildRequires:  %{python_module poetry}
%if %{with test}
BuildRequires:  %{python_module pytest}
BuildRequires:  %{python_module pytest-asyncio >= 0.23.7}
BuildRequires:  %{python_module pytest-cov >= 3.0.0}
BuildRequires:  %{python_module aiodns >= 3.1.1}
BuildRequires:  %{python_module cached-ipaddress >= 0.2.0}
BuildRequires:  %{python_module ifaddr}
%endif
BuildRequires:  fdupes
BuildRequires:  python-rpm-macros
Requires:       python-aiodns >= 3.1.1
%if %python_version_nodots < 311
Requires:       python-async_timeout >= 4.0.1
%endif
Requires:       python-cached-ipaddress >= 0.2.0
Requires:       python-ifaddr
Requires:       python-netifaces >= 0.11.0
Requires:       python-pyroute2 >= 0.7.3
%python_subpackages

%description
Discover hosts on the network via ARP and PTR lookup.

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

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

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

%if %{with test}
%check
%pytest -k "not test_async_discover_hosts"
%endif

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

%changelog
openSUSE Build Service is sponsored by