15
0
forked from pool/python-falcon
Files
python-falcon/python-falcon.spec
Nico Krapp 8bba6cd630 - Update to 4.1.0
* CPython 3.14 is now fully supported. (#2413)
  * Although the Falcon 4.x series is only guaranteed to support Python 3.10+,
    this release still supports 3.8 & 3.9 at runtime using the pure Python wheel.
  * Falcon 4.2 is expected to drop the end-of-life Python 3.8 completely (but
    runtime support will continue for 3.9 on a best effort basis).
  * StaticRoute now renders Etag headers. It also checks If-None-Match in requests
    and returns HTTP 304 response if appropriate. (#2243)
  * StaticRoute now sets the Last-Modified header when serving static files. The
    improved implementation also checks the value of the If-Modified-Since header,
    and renders an HTTP 304 response when the requested file has not been modified. (#2244)
  * Similar to create_environ(), the create_scope() testing helper now preserves the
    raw URI path, and propagates it to the created ASGI connection scope as the
    raw_path byte string (according to the ASGI specification). (#2262)
  * Two new media_type constants, falcon.MEDIA_CSV and falcon.MEDIA_PARQUET, were
    added in order to provide better support for Python data analysis applications
    out of the box. (#2335)
  * Support for allowing cross-origin private network access was added to the built-in
    CORSMiddleware. The new feature is off by default, and can be enabled by passing
    the keyword argument allow_private_network=True to CORSMiddleware during
    initialization. (#2381)
  * The falcon.secure_filename() utility function can now ensure that the length of the
    sanitized filename does not exceed the requested limit (passed via the max_length
    argument). In addition, a new option, max_secure_filename_length, was added to
    MultipartParseOptions in order to automatically populate this argument when
    referencing a body part’s secure_filename. (#2420)
  * The unset_cookie() method now accepts a same_site parameter (with underscore) for
    consistency with set_cookie(). The previous samesite parameter (without underscore)
    is now deprecated (referencing it will emit a deprecation warning). (#2453)
  * A new method, __rich__, has been added to falcon.testing.Result for facilitating

OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-falcon?expand=0&rev=70
2025-10-28 16:25:43 +00:00

157 lines
4.8 KiB
RPMSpec

#
# 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.1.0
Release: 0
Summary: A web framework for building APIs and app backends
License: Apache-2.0
URL: https://falconframework.org
Source: https://files.pythonhosted.org/packages/source/f/falcon/falcon-%{version}.tar.gz
BuildRequires: %{python_module PyYAML}
BuildRequires: %{python_module Sphinx}
BuildRequires: %{python_module base >= 3.8}
BuildRequires: %{python_module ddt}
BuildRequires: %{python_module httpx}
BuildRequires: %{python_module myst-parser >= 2}
BuildRequires: %{python_module pip}
BuildRequires: %{python_module setuptools}
BuildRequires: %{python_module sphinx-design}
BuildRequires: %{python_module sphinx-tabs}
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
%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