%global pypi_name trio-websocket %global pypi_name_underscore %(echo "%{pypi_name}" | tr '-' '_') Name: python-%{pypi_name} Summary: WebSocket implementation focused on safety and correctness License: MIT Version: 0.10.3 Release: 2%{?dist} URL: https://github.com/python-trio/trio-websocket Source: %{URL}/archive/%{version}/%{pypi_name}-%{version}.tar.gz # Remove the dependency on pyhon3dist(dependencygroup). # That package is a backport of features built into Python 3.11 and newer. Patch0: no-exceptiongroup-dependency.patch BuildArch: noarch BuildRequires: attr BuildRequires: make BuildRequires: pytest BuildRequires: python3-devel BuildRequires: python3-pytest-trio BuildRequires: python3-sphinx BuildRequires: python3-sphinx_rtd_theme BuildRequires: python3-sphinxcontrib-trio BuildRequires: python3-trustme %global _description %{expand: This library implements both server and client aspects of the the WebSocket protocol, striving for safety, correctness, and ergonomics. It is based on the wsproto project, which is a Sans-IO state machine that implements the majority of the WebSocket protocol, including framing, codecs, and events. This library handles I/O using the Trio framework. This library passes the Autobahn Test Suite. } %description %_description %package -n python3-%{pypi_name} Summary: %{summary} %description -n python3-%{pypi_name} %_description %package doc Summary: Documentation for %{pypi_name} %description doc This package contains documentation (in HTML format) for %{pypi_name}. %prep %autosetup -p1 -n %{pypi_name}-%{version} #sed \ # -e '/^from trio_websocket\._version import __version__ as version$/d' \ # -e 's/^release = version$/release = "%{version}"/' \ # -i docs/conf.py %generate_buildrequires %pyproject_buildrequires %build %pyproject_wheel export PYTHONPATH="$(pwd)" %make_build -C docs html PYTHON=python3 BUILDDIR=build %install %pyproject_install %pyproject_save_files %{pypi_name_underscore} %check %pyproject_check_import %pytest %files -n python3-%{pypi_name} -f %{pyproject_files} %files doc %license LICENSE %doc docs/build/html %changelog * Wed Sep 13 2023 Artur Frenszek-Iwicki - 0.10.3-2 - Switch to using pyproject_xxx macros - Build HTML documentation and add -doc subpacakge - Switch to using GitHub tarball as the source (needed for building the docs) * Wed Sep 06 2023 Artur Frenszek-Iwicki - 0.10.3-1 - Initial packaging