%global pypi_name hfsynpy Name: python-%{pypi_name} Version: 0.1.3 Release: 1%{?dist} Summary: Microstrip and transmission-line synthesis, ported from KiCad License: GPL-2.0-or-later URL: https://github.com/GenerativeAntennaDesign/hfsynpy Source0: %{pypi_source %{pypi_name}} BuildArch: noarch BuildRequires: python3-devel BuildRequires: pyproject-rpm-macros %global _description %{expand: hfsynpy is a Python translation of the transmission-line calculator in KiCad's PCB calculator: it synthesizes and analyzes microstrip and related lines (width from impedance, impedance and effective permittivity from geometry). Hertzon uses it in its filter and antenna design tools.} %description %_description %package -n python3-%{pypi_name} Summary: %{summary} %description -n python3-%{pypi_name} %_description %prep %autosetup -n %{pypi_name}-%{version} rm -rf %{pypi_name}.egg-info %generate_buildrequires %pyproject_buildrequires %build %pyproject_wheel %install %pyproject_install %pyproject_save_files %{pypi_name} %check %pyproject_check_import # No upstream tests in the sdist. A 50 ohm line on 1.6 mm FR-4 (er 4.4) is # about 3 mm wide; synthesis followed by analysis must round-trip. %{py3_test_envvars} %{python3} - <<'PYEOF' from hfsynpy import synthesize_microstrip, analyze_microstrip sub = dict(eps_r=4.4, tand=0.02, h=1.6e-3, t=35e-6, rough=0.0, sigma=5.8e7, mur=1.0, murc=1.0, frequency=1e9) s = synthesize_microstrip(**sub, z0_target=50.0, ang_l_target=90.0) assert 2.6e-3 < s.width < 3.3e-3, s.width a = analyze_microstrip(**sub, width=s.width, length=s.length) assert abs(a.Z0_0 - 50.0) < 0.5, a.Z0_0 assert 3.0 < a.epsilon_eff < 4.4, a.epsilon_eff print("hfsynpy ok: w=%.3f mm Z0=%.2f eeff=%.3f" % (s.width * 1e3, a.Z0_0, a.epsilon_eff)) PYEOF %files -n python3-%{pypi_name} -f %{pyproject_files} %license LICENSE %doc README.md %changelog * Wed Oct 21 2026 Morgan Hough - 0.1.3-1 - Initial package (Hertzon dependency).