14
0
forked from pool/python-falcon
Files
python-falcon/python-falcon.spec

159 lines
4.9 KiB
RPMSpec
Raw Permalink Normal View History

#
# spec file for package python-falcon
#
# Copyright (c) 2025 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via https://bugs.opensuse.org/
#
%if 0%{?suse_version} > 1600
%bcond_without doc
%else
%bcond_with doc
%endif
%if 0%{?suse_version} > 1500
%bcond_without libalternatives
%else
%bcond_with libalternatives
%endif
%{?sle15_python_module_pythons}
Name: python-falcon
Version: 4.0.2
Release: 0
Summary: A web framework for building APIs and app backends
License: Apache-2.0
URL: https://falconframework.org
Accepting request 1144006 from home:bnavigator:branches:devel:languages:python - Update to 3.1.3 * This is a minor bugfix release that only pins the pytest-asyncio test dependency in order to prevent an incompatible version from interfering with the build workflow. * This release is otherwise identical to Falcon 3.1.2. - Update to 3.1.2 ## Summary * This is a minor point release fixing a couple of high impact bugs, as well as publishing binary wheels for the recently released CPython 3.12. ## Changes to Supported Platforms * Falcon is now supported (including binary wheels) on CPython 3.12. A couple of remaining stdlib deprecations from 3.11 and 3.12 will be addressed in Falcon 4.0. * As with the previous release, Python 3.5 & 3.6 remain deprecated and will no longer be supported in Falcon 4.0. * EOL Python 3.7 will no longer be actively supported in 4.0, but the framework should still continue to install from source. We may remove the support for 3.7 altogether later in the 4.x series if we are faced with incompatible ecosystem changes in typing, Cython, etc. ## Fixed * Some essential files were unintentionally omitted from the source distribution archive, rendering it unsuitable to run the test suite off. This has been fixed, and the sdist tarball should now be usable as a base for packaging Falcon in OS distributions. (#2051) * WebSocket implementation has been fixed to properly handle HTTPError and HTTPStatus exceptions raised by custom error handlers. The WebSocket connection is now correctly closed with OBS-URL: https://build.opensuse.org/request/show/1144006 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-falcon?expand=0&rev=50
2024-02-05 12:43:31 +00:00
Source: https://files.pythonhosted.org/packages/source/f/falcon/falcon-%{version}.tar.gz
# PATCH-FIX-UPSTREAM https://github.com/falconry/falcon/pull/2406 chore(tests/asgi): migrate to the new websockets async client
Patch0: websockets.patch
BuildRequires: %{python_module PyYAML}
BuildRequires: %{python_module Sphinx}
- Update to 4.0.1: * Overview + CPython 3.11 - 3.13 is now fully supported. + End-of-life Python 3.5, 3.6 & 3.7 are no longer supported. + End-of-life Python 3.8 is no longer actively supported. + Type checking support was introduced. + Falcon is no longer vendoring the python-mimeparse library. + A number of undocumented internal helpers were renamed to start with an underscore. + A number of previously deprecated methods, attributes and classes have now been removed. + We decided, on the other hand, to keep the deprecated falcon.API alias until Falcon 5.0. + The deprecated api_helpers was removed in favor of the app_helpers module. + The function falcon.http_date_to_dt now validates HTTP dates to have the correct timezone set. It now also returns timezone-aware datetime.datetime objects. + setup.cfg was dropped in favor of consolidating all static project configuration in pyproject.toml * New & Improved + A new path converter falcon.routing.PathConverter capable of matching segments that include / was added. + Similar to the existing falcon.routing.IntConverter, a new falcon.routing.FloatConverter has been added, allowing to convert path segments to float. + A new method falcon.Request.get_header_as_int was implemented. + A new property, falcon.Request.headers_lower, was added to provide a unified, self-documenting way to get a copy of all request headers with lowercase names to facilitate case-insensitive matching. OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-falcon?expand=0&rev=57
2024-11-02 06:34:21 +00:00
BuildRequires: %{python_module base >= 3.8}
BuildRequires: %{python_module ddt}
BuildRequires: %{python_module httpx}
- Update to 4.0.1: * Overview + CPython 3.11 - 3.13 is now fully supported. + End-of-life Python 3.5, 3.6 & 3.7 are no longer supported. + End-of-life Python 3.8 is no longer actively supported. + Type checking support was introduced. + Falcon is no longer vendoring the python-mimeparse library. + A number of undocumented internal helpers were renamed to start with an underscore. + A number of previously deprecated methods, attributes and classes have now been removed. + We decided, on the other hand, to keep the deprecated falcon.API alias until Falcon 5.0. + The deprecated api_helpers was removed in favor of the app_helpers module. + The function falcon.http_date_to_dt now validates HTTP dates to have the correct timezone set. It now also returns timezone-aware datetime.datetime objects. + setup.cfg was dropped in favor of consolidating all static project configuration in pyproject.toml * New & Improved + A new path converter falcon.routing.PathConverter capable of matching segments that include / was added. + Similar to the existing falcon.routing.IntConverter, a new falcon.routing.FloatConverter has been added, allowing to convert path segments to float. + A new method falcon.Request.get_header_as_int was implemented. + A new property, falcon.Request.headers_lower, was added to provide a unified, self-documenting way to get a copy of all request headers with lowercase names to facilitate case-insensitive matching. OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-falcon?expand=0&rev=57
2024-11-02 06:34:21 +00:00
BuildRequires: %{python_module myst-parser >= 2}
BuildRequires: %{python_module pip}
BuildRequires: %{python_module setuptools}
- Update to 4.0.1: * Overview + CPython 3.11 - 3.13 is now fully supported. + End-of-life Python 3.5, 3.6 & 3.7 are no longer supported. + End-of-life Python 3.8 is no longer actively supported. + Type checking support was introduced. + Falcon is no longer vendoring the python-mimeparse library. + A number of undocumented internal helpers were renamed to start with an underscore. + A number of previously deprecated methods, attributes and classes have now been removed. + We decided, on the other hand, to keep the deprecated falcon.API alias until Falcon 5.0. + The deprecated api_helpers was removed in favor of the app_helpers module. + The function falcon.http_date_to_dt now validates HTTP dates to have the correct timezone set. It now also returns timezone-aware datetime.datetime objects. + setup.cfg was dropped in favor of consolidating all static project configuration in pyproject.toml * New & Improved + A new path converter falcon.routing.PathConverter capable of matching segments that include / was added. + Similar to the existing falcon.routing.IntConverter, a new falcon.routing.FloatConverter has been added, allowing to convert path segments to float. + A new method falcon.Request.get_header_as_int was implemented. + A new property, falcon.Request.headers_lower, was added to provide a unified, self-documenting way to get a copy of all request headers with lowercase names to facilitate case-insensitive matching. OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-falcon?expand=0&rev=57
2024-11-02 06:34:21 +00:00
BuildRequires: %{python_module sphinx-design}
BuildRequires: %{python_module sphinx-tabs}
- Update to 4.0.1: * Overview + CPython 3.11 - 3.13 is now fully supported. + End-of-life Python 3.5, 3.6 & 3.7 are no longer supported. + End-of-life Python 3.8 is no longer actively supported. + Type checking support was introduced. + Falcon is no longer vendoring the python-mimeparse library. + A number of undocumented internal helpers were renamed to start with an underscore. + A number of previously deprecated methods, attributes and classes have now been removed. + We decided, on the other hand, to keep the deprecated falcon.API alias until Falcon 5.0. + The deprecated api_helpers was removed in favor of the app_helpers module. + The function falcon.http_date_to_dt now validates HTTP dates to have the correct timezone set. It now also returns timezone-aware datetime.datetime objects. + setup.cfg was dropped in favor of consolidating all static project configuration in pyproject.toml * New & Improved + A new path converter falcon.routing.PathConverter capable of matching segments that include / was added. + Similar to the existing falcon.routing.IntConverter, a new falcon.routing.FloatConverter has been added, allowing to convert path segments to float. + A new method falcon.Request.get_header_as_int was implemented. + A new property, falcon.Request.headers_lower, was added to provide a unified, self-documenting way to get a copy of all request headers with lowercase names to facilitate case-insensitive matching. OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-falcon?expand=0&rev=57
2024-11-02 06:34:21 +00:00
BuildRequires: %{python_module sphinxcontrib-copybutton}
BuildRequires: %{python_module websockets}
BuildRequires: %{python_module wheel}
BuildRequires: fdupes
BuildRequires: python-rpm-macros
%if %{with libalternatives}
BuildRequires: alts
Requires: alts
%else
Requires(post): update-alternatives
Requires(postun): update-alternatives
%endif
Suggests: %{name}-doc
BuildArch: noarch
# TODO: Cython support
#BuildRequires: %%{python_module Cython}
#Requires: python-Cython
# SECTION test requirements
BuildRequires: %{python_module aiofiles}
BuildRequires: %{python_module cbor2}
BuildRequires: %{python_module msgpack-python}
BuildRequires: %{python_module pytest-asyncio}
BuildRequires: %{python_module pytest}
BuildRequires: %{python_module requests}
BuildRequires: %{python_module testtools}
%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 >= 13.1 if (%python-base without python36-base)}
%endif
%if %{with doc}
BuildRequires: %{python_module pydata-sphinx-theme}
%endif
# /SECTION
%python_subpackages
%package -n %{name}-doc
Summary: Documentation files for %{name}
Provides: %{python_module falcon-doc = %{version}}
%description
Falcon is a Python framework for building cloud
APIs. It encourages the REST architectural style, and tries to do
as little as possible while remaining effective.
%description -n %{name}-doc
HTML documentation including API documentation and changelog for %{name}.
%prep
%autosetup -p1 -n falcon-%{version}
# remove unwanted shebang
sed -i '1s/^#!.*//' falcon/bench/bench.py falcon/cmd/inspect_app.py falcon/bench/dj/manage.py
chmod a-x falcon/bench/dj/manage.py
# we don't want to require rapidjson just for testing
rm tests/test_media_handlers.py
%build
export CFLAGS="%{optflags} -fno-strict-aliasing"
%pyproject_wheel
%if %{with doc}
export PYTHONPATH="$(pwd)"
pushd docs
make html
rm _build/html/.buildinfo
popd
%endif
%install
%pyproject_install
%python_clone -a %{buildroot}%{_bindir}/falcon-bench
%python_clone -a %{buildroot}%{_bindir}/falcon-inspect-app
%python_clone -a %{buildroot}%{_bindir}/falcon-print-routes
%python_group_libalternatives falcon-bench falcon-inspect-app falcon-print-routes
%python_expand %fdupes %{buildroot}%{$python_sitelib}
%if %{with doc}
mkdir -p %{buildroot}%{_defaultdocdir}/%{name}-doc
cp -ar docs/_build/html examples %{buildroot}%{_defaultdocdir}/%{name}-doc/
%fdupes %{buildroot}%{_defaultdocdir}/%{name}-doc/
%endif
%check
export LANG=en_US.UTF8
- Update to 4.0.1: * Overview + CPython 3.11 - 3.13 is now fully supported. + End-of-life Python 3.5, 3.6 & 3.7 are no longer supported. + End-of-life Python 3.8 is no longer actively supported. + Type checking support was introduced. + Falcon is no longer vendoring the python-mimeparse library. + A number of undocumented internal helpers were renamed to start with an underscore. + A number of previously deprecated methods, attributes and classes have now been removed. + We decided, on the other hand, to keep the deprecated falcon.API alias until Falcon 5.0. + The deprecated api_helpers was removed in favor of the app_helpers module. + The function falcon.http_date_to_dt now validates HTTP dates to have the correct timezone set. It now also returns timezone-aware datetime.datetime objects. + setup.cfg was dropped in favor of consolidating all static project configuration in pyproject.toml * New & Improved + A new path converter falcon.routing.PathConverter capable of matching segments that include / was added. + Similar to the existing falcon.routing.IntConverter, a new falcon.routing.FloatConverter has been added, allowing to convert path segments to float. + A new method falcon.Request.get_header_as_int was implemented. + A new property, falcon.Request.headers_lower, was added to provide a unified, self-documenting way to get a copy of all request headers with lowercase names to facilitate case-insensitive matching. OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-falcon?expand=0&rev=57
2024-11-02 06:34:21 +00:00
%pytest
%pre
%python_libalternatives_reset_alternative falcon-bench
%post
%python_install_alternative falcon-bench falcon-inspect-app falcon-print-routes
%postun
%python_uninstall_alternative falcon-bench
%files %{python_files}
%doc README.rst
%license LICENSE
%python_alternative %{_bindir}/falcon-bench
%python_alternative %{_bindir}/falcon-inspect-app
%python_alternative %{_bindir}/falcon-print-routes
%{python_sitelib}/falcon
%{python_sitelib}/falcon-%{version}.dist-info
%if %{with doc}
%files -n %{name}-doc
%doc %{_defaultdocdir}/%{name}-doc
%endif
%changelog