1
0
python-gunicorn/python-gunicorn.spec
Markéta Machová 711614fd06 Accepting request 1168546 from home:mcalabkova:branches:devel:languages:python
- Update to 22.0.0
  * use `utime` to notify workers liveness
  * migrate setup to pyproject.toml
  * fix numerous security vulnerabilities in HTTP parser (closing some 
    request smuggling vectors)
  * parsing additional requests is no longer attempted past unsupported 
    request framing
  * on HTTP versions < 1.1 support for chunked transfer is refused
  * requests conflicting configured or passed SCRIPT_NAME now produce 
    a verbose error
  * Trailer fields are no longer inspected for headers indicating secure 
    scheme
  * support Python 3.12
** Breaking changes **
  * minimum version is Python 3.7
  * the limitations on valid characters in the HTTP method have been bounded 
    to Internet Standards
  * requests specifying unsupported transfer coding (order) are refused by 
    default (rare)
  * HTTP methods are no longer casefolded by default (IANA method registry 
    contains none affected)
  * HTTP methods containing the number sign (#) are no longer accepted by 
    default (rare)
  * HTTP versions < 1.0 or >= 2.0 are no longer accepted by default (rare)
  * HTTP versions consisting of multiple digits or containing a prefix/suffix 
    are no longer accepted
  * HTTP header field names Gunicorn cannot safely map to variables are silently 
    dropped, as in other software
  * HTTP headers with empty field name are refused by default
  * requests with both Transfer-Encoding and Content-Length are refused by default

OBS-URL: https://build.opensuse.org/request/show/1168546
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-gunicorn?expand=0&rev=59
2024-04-22 09:19:09 +00:00

128 lines
3.7 KiB
RPMSpec

#
# spec file for package python-gunicorn
#
# Copyright (c) 2024 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/
#
%global flavor @BUILD_FLAVOR@%{nil}
%if "%{flavor}" == "test"
%define psuffix -test
%bcond_without test
%else
%define psuffix %{nil}
%bcond_with test
%endif
%define skip_python2 1
%{?sle15_python_module_pythons}
Name: python-gunicorn%{psuffix}
Version: 22.0.0
Release: 0
Summary: WSGI HTTP Server for UNIX
License: MIT
Group: Development/Languages/Python
URL: https://gunicorn.org
Source: https://files.pythonhosted.org/packages/source/g/gunicorn/gunicorn-%{version}.tar.gz
BuildRequires: %{python_module pip}
BuildRequires: %{python_module setuptools >= 3.0}
BuildRequires: %{python_module wheel}
BuildRequires: fdupes
BuildRequires: python-rpm-macros
Requires(post): update-alternatives
Requires(postun): update-alternatives
Suggests: python-evenlet
Suggests: python-gevent
Suggests: python-gthread
Suggests: python-setproctitle
Suggests: python-tornado
BuildArch: noarch
%if 0%{?sle_version} >= 150500
# Fixes the build on Leap
BuildRequires: %{python_module Sphinx}
%else
BuildRequires: python3-Sphinx
%endif
%if %{with test}
BuildRequires: %{python_module eventlet}
BuildRequires: %{python_module gevent >= 1.4}
BuildRequires: %{python_module gunicorn}
BuildRequires: %{python_module pytest-cov}
BuildRequires: %{python_module pytest}
%endif
%python_subpackages
%description
Gunicorn 'Green Unicorn' is a Python WSGI HTTP Server for UNIX. It's a pre-fork
worker model ported from Ruby's Unicorn_ project. The Gunicorn server is broadly
compatible with various web frameworks.
%if 0%{?suse_version} > 1500
%package -n python-gunicorn-doc
Summary: Documentation for %{name}
Group: Documentation/Other
Provides: %{python_module gunicorn-doc = %{version}}
%description -n python-gunicorn-doc
Gunicorn 'Green Unicorn' is a Python WSGI HTTP Server for UNIX. It's a pre-fork
worker model ported from Ruby's Unicorn_ project. The Gunicorn server is broadly
compatible with various web frameworks.
This package contains the documentation.
%endif
%prep
%setup -q -n gunicorn-%{version}
# remove version pinning for test requirements
sed -i 's/==.*//' requirements_test.txt
sed -i -e '/cover/d' requirements_test.txt
# do not check coverage
sed -i -e 's/--cov[^ ]*//' -e 's/--cov-report[^ ]*//' setup.cfg
%autopatch -p1
%if %{with test}
%check
%pytest
%else # without test
%build
%pyproject_wheel
sphinx-build -b html -d docs/build/doctrees docs/source docs/build/html
%install
%pyproject_install
%python_clone -a %{buildroot}%{_bindir}/gunicorn
%python_expand %fdupes %{buildroot}%{$python_sitelib}
%post
%python_install_alternative gunicorn
%postun
%python_uninstall_alternative gunicorn
%files %{python_files}
%license LICENSE
%python_alternative %{_bindir}/gunicorn
%{python_sitelib}/gunicorn
%{python_sitelib}/gunicorn-%{version}*-info
%if 0%{?suse_version} > 1500
%files -n python-gunicorn-doc
%license LICENSE
%endif
%doc README.rst NOTICE THANKS docs/build/html docs/source/news.rst
%endif
%changelog