%global pypi_name segno Name: python-%{pypi_name} Version: 1.6.6 Release: 1%{?dist} Summary: QR Code and Micro QR Code encoder # Three-clause: LICENSE carries the redistribution conditions plus a # "Neither the name of the copyright holder" clause. License: BSD-3-Clause URL: https://github.com/heuer/segno Source0: https://files.pythonhosted.org/packages/source/s/%{pypi_name}/%{pypi_name}-%{version}.tar.gz BuildArch: noarch BuildRequires: python3-devel BuildRequires: python3-flit-core # %%check runs upstream's suite, which lives in the source tree rather than the # installed package. BuildRequires: python3-pytest # Five of upstream's test modules decode the generated PNGs to check them; # without pypng they error at collection and that coverage is simply lost. BuildRequires: python3-pypng %global _description %{expand: Segno generates QR Codes and Micro QR Codes to the ISO/IEC 18004:2015(E) standard, with no dependencies. It writes SVG, PNG, EPS, PDF, PBM, LaTeX, plain text and terminal output, and supports every error-correction level, mask pattern and encoding mode the standard defines.} %description %_description %package -n python3-%{pypi_name} Summary: %{summary} %description -n python3-%{pypi_name} %_description %prep %autosetup -n %{pypi_name}-%{version} -p1 %generate_buildrequires %pyproject_buildrequires %build %pyproject_wheel %install %pyproject_install %pyproject_save_files -l %{pypi_name} %check %pyproject_check_import # Upstream's suite lives in tests/ in the source tree and is not shipped in the # wheel, so it exercises the source rather than the installed copy; # %%pyproject_check_import above is what covers the installed tree. -o addopts= # drops upstream's coverage flags, which need pytest-cov and mean nothing here. # test_plugin asserts qr.to_pil() resolves through segno's entry-point plugin # mechanism, which needs a third-party plugin package (qrcode-artistic) that # Fedora does not carry. It tests plugin discovery, not segno. test_noplugin in # the same file -- the half that checks an unknown plugin raises -- still runs. %pytest -o addopts= tests --deselect tests/test_plugin.py::test_plugin %files -n python3-%{pypi_name} -f %{pyproject_files} %doc README.rst CHANGES.rst %license LICENSE %{_bindir}/%{pypi_name} %{_mandir}/man1/%{pypi_name}.1* %changelog * Tue Sep 15 2026 Morgan Hough - 1.6.6-1 - Initial package. segno is one of the two runtime dependencies SlicerOpenLIFU pip-installs on first use (OpenLIFULib/lazyimport.py); packaging it and python-openlifu is what lets that extension work without reaching out to PyPI from inside Slicer. The other three -- bcrypt, threadpoolctl and requests -- are already in Fedora. - Pure Python with no runtime dependencies of its own on Python 3.10+. - %%check runs upstream's suite: 1575 passed, 10 skipped. python3-pypng is build-required because five test modules decode the generated PNGs to verify them, and error at collection without it. One test is deselected -- test_plugin needs the third-party qrcode-artistic plugin to resolve qr.to_pil(), so it exercises plugin discovery rather than segno.