%global forgeurl https://github.com/zulip/python-zulip-api/ %global tag 0.9.0 %forgemeta Name: python-zulip-api Version: %{tag} Release: %{autorelease} Summary: The Zulip API Python bindings License: Apache-2.0 URL: %{forgeurl} Source: %{forgesource} BuildArch: noarch BuildRequires: python3-devel BuildRequires: pip BuildRequires: python3dist(importlib-metadata) %global _description %{summary} %description %{_description} %package -n python3-zulip Summary: %{summary} %description -n python3-zulip %_description %package -n python3-zulip_bots Summary: %{summary} %description -n python3-zulip_bots %_description %package -n python3-zulip_botserver Summary: %{summary} %description -n python3-zulip_botserver %_description %prep %forgesetup #prep the requirements.txt file #remove workspace packages sed -i -e '/^-e/d' requirements.txt #packages for type-checking/linting arent needed sed -i -e '/types/d' requirements.txt sed -i -e '/lint/d' requirements.txt #remove version bounding sed -i -e 's/.=.*//g' requirements.txt # remove myp package due to it not being packaged and optional sed -i -e '/myp/d' requirements.txt # setup.py files have dependencies in a way that cannot be build together. # concat the req into a file and strip the workspace packages # sed -i -e '/zulip/d' req.txt %generate_buildrequires %pyproject_buildrequires -N ./requirements.txt cd zulip %pyproject_buildrequires cd ../zulip_bots ( %pyproject_buildrequires ) | grep -vE '\bzulip\b' cd ../zulip_botserver ( %pyproject_buildrequires ) | grep -vE '\bzulip\b' cd .. %build cd zulip %pyproject_wheel cd ../zulip_bots %pyproject_wheel cd ../zulip_botserver %pyproject_wheel cd .. %install cd zulip %pyproject_install cd ../zulip_bots %pyproject_install cd ../zulip_botserver %pyproject_install cd .. %check cd zulip %pytest cd ../zulip_botserver %pytest cd .. %files -n python3-zulip %doc README.md %license THIRDPARTY %license LICENSE %{_bindir}/zulip* %{_datadir}/zulip/ %{python3_sitelib}/zulip/ %{python3_sitelib}/integrations/ %{python3_sitelib}/zulip-%{tag}.dist-info/ %files -n python3-zulip_bots %{python3_sitelib}/zulip_bots/ %{python3_sitelib}/zulip_bots-%{tag}.dist-info/ %files -n python3-zulip_botserver %{python3_sitelib}/zulip_botserver/ %{python3_sitelib}/zulip_botserver-%{tag}.dist-info/ %changelog %autochangelog