python-pysubnettree/python-pysubnettree.spec
Doğukan Çağatay 11c6a3ba43
Replace zeek-btest with pytest for running tests
zeek-btest was retired from Fedora due to build failures. All test files
in this package use a single `@TEST-EXEC: python3 %INPUT` directive, so
a small pytest plugin (conftest.py) that collects test files and runs
each as a subprocess is a complete replacement. Addresses #2485942

Drops the btest.cfg source file and the zeek-btest build dependency.
2026-06-06 20:41:54 +02:00

65 lines
1.5 KiB
RPMSpec

Name: python-pysubnettree
Version: 0.38.1
Release: %autorelease
Summary: Python Module for CIDR Lookups
# BSD-4-Clause is coming from include/patricia.h
License: BSD-3-Clause-LBNL and BSD-4-Clause
URL: https://github.com/zeek/pysubnettree
Source0: %{url}/archive/v%{version}/%{name}-%{version}.tar.gz
# pytest plugin to collect and run *.test files without btest
Source1: conftest.py
Provides: pysubnettree = %{version}-%{release}
Obsoletes: pysubnettree < 0.35-16
BuildRequires: python3-devel
BuildRequires: gcc-c++
BuildRequires: python3-pytest
%global _description %{expand:
The PySubnetTree package provides a Python data structure SubnetTree which maps
subnets given in CIDR notation (incl. corresponding IPv6 versions) to Python
objects. Lookups are performed by longest-prefix matching.}
%description %{_description}
%package -n python3-pysubnettree
Summary: %{summary}
%description -n python3-pysubnettree %{_description}
%prep
%autosetup -n pysubnettree-%{version}
%generate_buildrequires
%pyproject_buildrequires
%build
%pyproject_wheel
%install
%pyproject_install
%pyproject_save_files -l SubnetTree _SubnetTree
%check
%pyproject_check_import
cp %{SOURCE1} testing/conftest.py
cd testing
PYTHONPATH="%{buildroot}%{python3_sitearch}:$PWD/Scripts" pytest pysubnettree/
%files -n python3-pysubnettree -f %{pyproject_files}
%doc CHANGES README
%changelog
%autochangelog