From 0a511e6cb3c5065d829a2d6029894ce910f636401f8bf15261b6d80595c6432e Mon Sep 17 00:00:00 2001 From: Matej Cepl Date: Wed, 24 Nov 2021 06:19:01 +0000 Subject: [PATCH] Accepting request 933340 from home:bnavigator:branches:devel:languages:python - Don't restrict to primary python3 flavor. Other packages depend on this. - Update requirements * The only runtime deps have been removed in version 2.0 * Test requirements from examples are obsolete - Implement some python packaging best practises: * Check for version in dist metadata * uninstall alternative only takes master (there was even a typo) OBS-URL: https://build.opensuse.org/request/show/933340 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-falcon?expand=0&rev=39 --- python-falcon.changes | 12 ++++++++++++ python-falcon.spec | 41 ++++++++++++++++------------------------- 2 files changed, 28 insertions(+), 25 deletions(-) diff --git a/python-falcon.changes b/python-falcon.changes index 5e7912a..fa43ea0 100644 --- a/python-falcon.changes +++ b/python-falcon.changes @@ -1,3 +1,15 @@ +------------------------------------------------------------------- +Tue Nov 23 19:28:50 UTC 2021 - Ben Greiner + +- Don't restrict to primary python3 flavor. Other packages depend + on this. +- Update requirements + * The only runtime deps have been removed in version 2.0 + * Test requirements from examples are obsolete +- Implement some python packaging best practises: + * Check for version in dist metadata + * uninstall alternative only takes master (there was even a typo) + ------------------------------------------------------------------- Mon Nov 22 16:25:06 UTC 2021 - Matej Cepl diff --git a/python-falcon.spec b/python-falcon.spec index 27e3e4e..71b970b 100644 --- a/python-falcon.spec +++ b/python-falcon.spec @@ -16,8 +16,8 @@ # -%{?!python_module:%define python_module() python-%{**} python3-%{**}} -%define pythons python3 +%{?!python_module:%define python_module() python3-%{**}} +%define skip_python2 1 Name: python-falcon Version: 3.0.1 Release: 0 @@ -33,40 +33,30 @@ Patch0: python-falcon-sphinx-pygments-style.patch BuildRequires: %{python_module PyYAML} BuildRequires: %{python_module Sphinx} BuildRequires: %{python_module ddt} -BuildRequires: %{python_module python-mimeparse >= 1.5.2} BuildRequires: %{python_module setuptools} -BuildRequires: %{python_module six >= 1.4.0} BuildRequires: %{python_module sphinx-tabs} # TODO: Cython support #BuildRequires: %%{python_module Cython} -%if 0%{?suse_version} >= 1550 # SECTION test requirements BuildRequires: %{python_module aiofiles} -BuildRequires: %{python_module aioredis} BuildRequires: %{python_module cbor2} -BuildRequires: %{python_module devel} -BuildRequires: %{python_module fakeredis} -BuildRequires: %{python_module fixtures >= 1.3.0} -BuildRequires: %{python_module jsonschema} BuildRequires: %{python_module msgpack-python} -BuildRequires: %{python_module pecan} BuildRequires: %{python_module pytest-asyncio} -BuildRequires: %{python_module pytest-httpx} BuildRequires: %{python_module pytest-runner} BuildRequires: %{python_module pytest} BuildRequires: %{python_module requests} BuildRequires: %{python_module testtools} BuildRequires: %{python_module ujson} -BuildRequires: %{python_module uvicorn} -BuildRequires: %{python_module websockets} -# /SECTION +%if 0%{?suse_version} >= 1550 +BuildRequires: %{python_module httpx if (%python-base without python36-base)} +BuildRequires: %{python_module uvicorn if (%python-base without python36-base)} +BuildRequires: %{python_module websockets if (%python-base without python36-base)} %endif +# /SECTION BuildRequires: fdupes BuildRequires: python-rpm-macros BuildRequires: python3-pygments-style-railscasts #Requires: python-Cython -Requires: python-python-mimeparse -Requires: python-six Requires(post): update-alternatives Requires(postun):update-alternatives Suggests: %{name}-doc @@ -115,20 +105,20 @@ popd %fdupes %{buildroot}%{$python_sitelib} } -%if 0%{?suse_version} >= 1550 -# We do not have the following package on Leap 15.3 -# python-httpx -# python-pytest-trio %check export LANG=en_US.UTF8 -%pytest tests -%endif +# there are no websockets and httpx for python 3.6 +python36_donttest=("--ignore" "tests/asgi") +if [ %{python3_version_nodots} -eq 36 ]; then + python3_donttest=("--ignore" "tests/asgi") +fi +%pytest "${$python_donttest[@]}" tests %post %{python_install_alternative falcon-bench falcon-inspect-app falcon-print-routes} %postun -%{python_uninstall_alternative falcon-bench falocn-inspect-app falcon-print-routes} +%python_uninstall_alternative falcon-bench %files %{python_files} %doc README.rst CHANGES.rst examples/ @@ -136,7 +126,8 @@ export LANG=en_US.UTF8 %python_alternative %{_bindir}/falcon-bench %python_alternative %{_bindir}/falcon-inspect-app %python_alternative %{_bindir}/falcon-print-routes -%{python_sitelib}/falcon* +%{python_sitelib}/falcon +%{python_sitelib}/falcon-%{version}*-info %files -n %{name}-doc %doc docs/_build/html