%global srcname flask-socketio
Name: python-%{srcname}
Version: 5.1.1
Release: %autorelease
Summary: Socket.IO integration for Flask applications
License: MIT
URL: https://github.com/miguelgrinberg/Flask-SocketIO/
Source0: %{url}/archive/v%{version}/Flask-SocketIO-%{version}.tar.gz
BuildArch: noarch
BuildRequires: python3-devel
BuildRequires: pyproject-rpm-macros
# Documentation
BuildRequires: make
BuildRequires: python3dist(sphinx)
%global common_description %{expand:
Flask-SocketIO gives Flask applications access to low latency bi-directional
communications between the clients and the server. The client-side application
can use any of the SocketIO official clients libraries in Javascript, C++, Java
and Swift, or any compatible client to establish a permanent connection to the
server.}
%description %{common_description}
%package -n python3-%{srcname}
Summary: %{summary}
%description -n python3-%{srcname} %{common_description}
%package doc
Summary: Documentation for %{name}
%description doc %{common_description}
%prep
%autosetup -n Flask-SocketIO-%{version}
%generate_buildrequires
%pyproject_buildrequires -t
%build
%pyproject_wheel
PYTHONPATH="${PWD}" %make_build -C docs html SPHINXOPTS='%{?_smp_mflags}'
rm -vf docs/_build/html/.buildinfo
%install
%pyproject_install
%pyproject_save_files flask_socketio
%check
# Because of its name, flask_socketio.test_client is mistaken for a test; then,
# pytest fails because of an import path mismatch, since that module is
# available both here in the build directory and in the buildroot. Simply
# ignoring it in test collection is perfectly correct and solves the problem.
%pytest --ignore-glob='*/test_client.py'
%files -n python3-%{srcname} -f %{pyproject_files}
%license LICENSE
%files doc
%license LICENSE
%doc CHANGES.md
%doc README.md
%doc SECURITY.md
%doc docs/_build/html
%doc example
%changelog
%autochangelog