Files
python-cheroot/python-cheroot.spec

139 lines
4.7 KiB
RPMSpec
Raw Normal View History

#
# spec file for package python-cheroot
#
# 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/
#
%if 0%{?suse_version} > 1500
%bcond_without libalternatives
%else
%bcond_with libalternatives
%endif
%define pypi_name cheroot
%bcond_with ringdisabled
%{?sle15_python_module_pythons}
Name: python-%{pypi_name}
Version: 10.0.1
Release: 0
Summary: Pure-python HTTP server
License: BSD-3-Clause
URL: https://github.com/cherrypy/cheroot
Source: https://files.pythonhosted.org/packages/source/c/%{pypi_name}/%{pypi_name}-%{version}.tar.gz
Source99: cheroot.rpmlintrc
# PATCH-FIX-OPENSUSE no-pypytools.patch mcepl@suse.com
# We don't have PyPy at all, so no need support for it
Patch0: no-pypytools.patch
# PATCH-FIX-UPSTREAM no-relative-imports.patch bsc#[0-9]+ mcepl@suse.com
Patch1: no-relative-imports.patch
# PATCH-FIX-SUSE increase-tests-timeouts.patch alarrosa@suse.com Tests take longer to run in s390x
Patch2: increase-tests-timeouts.patch
BuildRequires: %{python_module base >= 3.6}
BuildRequires: %{python_module importlib-metadata if %python-base < 3.8}
BuildRequires: %{python_module jaraco.functools}
BuildRequires: %{python_module more-itertools >= 2.6}
BuildRequires: %{python_module pip}
BuildRequires: %{python_module setuptools >= 34.4}
BuildRequires: %{python_module setuptools_scm >= 1.15.0}
BuildRequires: %{python_module wheel}
BuildRequires: fdupes
BuildRequires: python-rpm-macros >= 20210929
# SECTION test requirements
%if ! %{with ringdisabled}
# This is not in Ring1 for Staging. See check section
BuildRequires: %{python_module jaraco.context}
%endif
BuildRequires: %{python_module jaraco.text >= 3.1}
- Update to 8.5.2: * :issue:`358` via :pr:`359`: Fixed a regression from :pr:`199` that made the worker threads exit on invalid connection attempts and could make the whole server unresponsive once there was no workers left. *- by :user:`cameronbrunner`. * :cp-issue:`1873` via :pr:`340`: Resurrected an unintentionally removed feature of interrupting a server main thread by externally assigning an exception to the :py:meth:`HTTPServer.interrupt <cheroot.server.\ HTTPServer.interrupt>` property *- by :user:`liamstask`. * :pr:`350`: Fixed the incarnation of an earlier regression of not resetting the serving state on :py:data:``SIGINT`` originally fixed by :pr:`322` and :pr:`331` but reintroduced by the changes in :pr:`311` *- by :user:`liamstask`. * :issue:`305` via :pr:`311`: In :py:class:`~cheroot.connections.ConnectionManager`, process connections as they become active rather than waiting for a ``tick`` event, addressing performance degradation introduced in v8.1.0 *- by :user:`liamstask`. * :issue:`341` via :pr:`342`: Suppress legitimate OS errors expected on shutdown *- by :user:`webknjaz`. * :issue:`317` via :pr:`337`: Fixed a regression in 8.4.5 where the connections dictionary would change size during iteration, leading to a :py:exc:`RuntimeError` raised in the logs *- by :user:`liamstask`. * :issue:`328` via :pr:`322` and :pr:`331`: Fixed a regression introduced in the earlier refactoring in v8.4.4 via :pr:`309` that caused the :py:meth:`~cheroot.server.\ HTTPServer.serve` method to skip setting ``serving=False`` on :py:data:``SIGINT`` and :py:data:``SIGTERM`` *- by :user:`marc1n` and :user:`cristicbz`. * :issue:`312` via :pr:`313`: Fixed a regression introduced in the earlier refactoring in v8.4.4 via :pr:`309` that caused the connection manager to modify the selector map while looping over it *- by :user:`liamstask`. * :issue:`312` via :pr:`316`: Added a regression test for the error handling in :py:meth:`~cheroot.connections.\ ConnectionManager.get_conn` to ensure more stability *- by :user:`cyraxjoe`. * :issue:`304` via :pr:`309`: Refactored :py:class:`~\ cheroot.connections.ConnectionManager` to use :py:meth:`~\ selectors.BaseSelector.get_map` and reorganized the readable connection tracking *- by :user:`liamstask`. * :issue:`304` via :pr:`309`: Fixed the server shutdown sequence to avoid race condition resulting in accepting new connections while it is being terminated *- by :user:`liamstask`. * :pr:`282`: Fixed a race condition happening when an HTTP client attempts to reuse a persistent HTTP connection after it's been discarded on the server in :py:class:`~cheroot.\ server.HTTPRequest` but no TCP FIN packet has been received yet over the wire *- by :user:`meaksh`. * Fixed a significant performance regression introduced in v8.1.0 (:issue:`305` via :pr:`308`) * by :user:`mar10`. * Fixed TLS socket related unclosed resource warnings (:pr:`291` and :pr:`298`). * Made terminating keep-alive connections more graceful (:issue:`263` via :pr:`277`). - Dropped patches 0001-Avoid-race-condition-on-persistent-HTTP-connections.patch and python383.patch, they are included upstream. OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-cheroot?expand=0&rev=32
2021-03-19 05:51:10 +00:00
BuildRequires: %{python_module portend}
BuildRequires: %{python_module pyOpenSSL}
BuildRequires: %{python_module pytest >= 4.6}
- Update to 8.5.2: * :issue:`358` via :pr:`359`: Fixed a regression from :pr:`199` that made the worker threads exit on invalid connection attempts and could make the whole server unresponsive once there was no workers left. *- by :user:`cameronbrunner`. * :cp-issue:`1873` via :pr:`340`: Resurrected an unintentionally removed feature of interrupting a server main thread by externally assigning an exception to the :py:meth:`HTTPServer.interrupt <cheroot.server.\ HTTPServer.interrupt>` property *- by :user:`liamstask`. * :pr:`350`: Fixed the incarnation of an earlier regression of not resetting the serving state on :py:data:``SIGINT`` originally fixed by :pr:`322` and :pr:`331` but reintroduced by the changes in :pr:`311` *- by :user:`liamstask`. * :issue:`305` via :pr:`311`: In :py:class:`~cheroot.connections.ConnectionManager`, process connections as they become active rather than waiting for a ``tick`` event, addressing performance degradation introduced in v8.1.0 *- by :user:`liamstask`. * :issue:`341` via :pr:`342`: Suppress legitimate OS errors expected on shutdown *- by :user:`webknjaz`. * :issue:`317` via :pr:`337`: Fixed a regression in 8.4.5 where the connections dictionary would change size during iteration, leading to a :py:exc:`RuntimeError` raised in the logs *- by :user:`liamstask`. * :issue:`328` via :pr:`322` and :pr:`331`: Fixed a regression introduced in the earlier refactoring in v8.4.4 via :pr:`309` that caused the :py:meth:`~cheroot.server.\ HTTPServer.serve` method to skip setting ``serving=False`` on :py:data:``SIGINT`` and :py:data:``SIGTERM`` *- by :user:`marc1n` and :user:`cristicbz`. * :issue:`312` via :pr:`313`: Fixed a regression introduced in the earlier refactoring in v8.4.4 via :pr:`309` that caused the connection manager to modify the selector map while looping over it *- by :user:`liamstask`. * :issue:`312` via :pr:`316`: Added a regression test for the error handling in :py:meth:`~cheroot.connections.\ ConnectionManager.get_conn` to ensure more stability *- by :user:`cyraxjoe`. * :issue:`304` via :pr:`309`: Refactored :py:class:`~\ cheroot.connections.ConnectionManager` to use :py:meth:`~\ selectors.BaseSelector.get_map` and reorganized the readable connection tracking *- by :user:`liamstask`. * :issue:`304` via :pr:`309`: Fixed the server shutdown sequence to avoid race condition resulting in accepting new connections while it is being terminated *- by :user:`liamstask`. * :pr:`282`: Fixed a race condition happening when an HTTP client attempts to reuse a persistent HTTP connection after it's been discarded on the server in :py:class:`~cheroot.\ server.HTTPRequest` but no TCP FIN packet has been received yet over the wire *- by :user:`meaksh`. * Fixed a significant performance regression introduced in v8.1.0 (:issue:`305` via :pr:`308`) * by :user:`mar10`. * Fixed TLS socket related unclosed resource warnings (:pr:`291` and :pr:`298`). * Made terminating keep-alive connections more graceful (:issue:`263` via :pr:`277`). - Dropped patches 0001-Avoid-race-condition-on-persistent-HTTP-connections.patch and python383.patch, they are included upstream. OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-cheroot?expand=0&rev=32
2021-03-19 05:51:10 +00:00
BuildRequires: %{python_module pytest-forked}
BuildRequires: %{python_module pytest-mock >= 1.11.0}
BuildRequires: %{python_module pytest-rerunfailures}
BuildRequires: %{python_module pytest-xdist}
- Update to 8.5.2: * :issue:`358` via :pr:`359`: Fixed a regression from :pr:`199` that made the worker threads exit on invalid connection attempts and could make the whole server unresponsive once there was no workers left. *- by :user:`cameronbrunner`. * :cp-issue:`1873` via :pr:`340`: Resurrected an unintentionally removed feature of interrupting a server main thread by externally assigning an exception to the :py:meth:`HTTPServer.interrupt <cheroot.server.\ HTTPServer.interrupt>` property *- by :user:`liamstask`. * :pr:`350`: Fixed the incarnation of an earlier regression of not resetting the serving state on :py:data:``SIGINT`` originally fixed by :pr:`322` and :pr:`331` but reintroduced by the changes in :pr:`311` *- by :user:`liamstask`. * :issue:`305` via :pr:`311`: In :py:class:`~cheroot.connections.ConnectionManager`, process connections as they become active rather than waiting for a ``tick`` event, addressing performance degradation introduced in v8.1.0 *- by :user:`liamstask`. * :issue:`341` via :pr:`342`: Suppress legitimate OS errors expected on shutdown *- by :user:`webknjaz`. * :issue:`317` via :pr:`337`: Fixed a regression in 8.4.5 where the connections dictionary would change size during iteration, leading to a :py:exc:`RuntimeError` raised in the logs *- by :user:`liamstask`. * :issue:`328` via :pr:`322` and :pr:`331`: Fixed a regression introduced in the earlier refactoring in v8.4.4 via :pr:`309` that caused the :py:meth:`~cheroot.server.\ HTTPServer.serve` method to skip setting ``serving=False`` on :py:data:``SIGINT`` and :py:data:``SIGTERM`` *- by :user:`marc1n` and :user:`cristicbz`. * :issue:`312` via :pr:`313`: Fixed a regression introduced in the earlier refactoring in v8.4.4 via :pr:`309` that caused the connection manager to modify the selector map while looping over it *- by :user:`liamstask`. * :issue:`312` via :pr:`316`: Added a regression test for the error handling in :py:meth:`~cheroot.connections.\ ConnectionManager.get_conn` to ensure more stability *- by :user:`cyraxjoe`. * :issue:`304` via :pr:`309`: Refactored :py:class:`~\ cheroot.connections.ConnectionManager` to use :py:meth:`~\ selectors.BaseSelector.get_map` and reorganized the readable connection tracking *- by :user:`liamstask`. * :issue:`304` via :pr:`309`: Fixed the server shutdown sequence to avoid race condition resulting in accepting new connections while it is being terminated *- by :user:`liamstask`. * :pr:`282`: Fixed a race condition happening when an HTTP client attempts to reuse a persistent HTTP connection after it's been discarded on the server in :py:class:`~cheroot.\ server.HTTPRequest` but no TCP FIN packet has been received yet over the wire *- by :user:`meaksh`. * Fixed a significant performance regression introduced in v8.1.0 (:issue:`305` via :pr:`308`) * by :user:`mar10`. * Fixed TLS socket related unclosed resource warnings (:pr:`291` and :pr:`298`). * Made terminating keep-alive connections more graceful (:issue:`263` via :pr:`277`). - Dropped patches 0001-Avoid-race-condition-on-persistent-HTTP-connections.patch and python383.patch, they are included upstream. OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-cheroot?expand=0&rev=32
2021-03-19 05:51:10 +00:00
BuildRequires: %{python_module requests-toolbelt}
BuildRequires: %{python_module requests-unixsocket}
BuildRequires: %{python_module requests}
BuildRequires: %{python_module trustme}
BuildRequires: %{python_module urllib3 >= 1.25}
# /SECTION
Requires: python-jaraco.functools
Requires: python-more-itertools >= 2.6
%if %{with libalternatives}
Requires: alts
BuildRequires: alts
%else
Requires(post): update-alternatives
Requires(postun): update-alternatives
%endif
# the package and distribution name is lowercase-cheroot,
# but PyPI claims the name is capital-Cheroot
Provides: python-Cheroot = %{version}
BuildArch: noarch
%python_subpackages
%description
Cheroot is the pure-Python HTTP server used by CherryPy.
%prep
%autosetup -p1 -n cheroot-%{version} -p1
# do not check coverage
sed -i -e '/--cov/ d' pytest.ini
%build
%pyproject_wheel
%install
%pyproject_install
%python_clone -a %{buildroot}%{_bindir}/cheroot
%python_expand %fdupes %{buildroot}%{$python_sitelib}
%check
mkdir testclean
pushd testclean
%if %{with ringdisabled}
# skip this test file (1 test only) in Factory staging, because we
# do not want to add python-jaraco.context to Ring1
%python_expand pytest_opts+=" --ignore %{buildroot}%{$python_sitelib}/cheroot/test/test_wsgi.py"
%endif
# test_tls_client_auth[...-False-localhost-builtin] fails ocassionally on server-side OBS
donttest="(test_tls_client_auth and False-localhost-builtin)"
# looks like there's a bug with pytest.mark.forked
# https://github.com/cherrypy/cheroot/issues/511
donttest+=" or test_high_number_of_file_descriptor"
# Openssl 3.2 test failures gh#cherrypy/cheroot#645
donttest+=" or test_https_over_http_error"
%pytest --pyargs cheroot $pytest_opts -k "not ($donttest)"
popd
%pre
# If libalternatives is used: Removing old update-alternatives entries.
%python_libalternatives_reset_alternative cheroot
%post
%python_install_alternative cheroot
%postun
%python_uninstall_alternative cheroot
%files %{python_files}
%license LICENSE.md
%doc README.rst CHANGES.rst
%python_alternative %{_bindir}/cheroot
%{python_sitelib}/cheroot
%{python_sitelib}/cheroot-%{version}*-info
%changelog