# # spec file # # Copyright (c) 2022 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 %{?!python_module:%define python_module() python-%{**} python3-%{**}} %define pypi_name cheroot %bcond_with python2 %bcond_with ringdisabled %define skip_python2 1 %define skip_python36 1 %define skip_python39 1 Name: python-%{pypi_name} Version: 8.6.0 Release: 2.1 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 # 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 BuildRequires: %{python_module jaraco.functools} BuildRequires: %{python_module more-itertools >= 2.6} BuildRequires: %{python_module setuptools >= 34.4} BuildRequires: %{python_module setuptools_scm >= 1.15.0} BuildRequires: %{python_module setuptools_scm_git_archive >= 1.0} BuildRequires: %{python_module six >= 1.11.0} BuildRequires: fdupes BuildRequires: python-rpm-macros >= 20210929 %if %{with python2} BuildRequires: python-backports.functools_lru_cache BuildRequires: python-selectors2 %endif # 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} BuildRequires: %{python_module portend} BuildRequires: %{python_module pyOpenSSL} BuildRequires: %{python_module pytest >= 4.6} BuildRequires: %{python_module pytest-forked} BuildRequires: %{python_module pytest-mock >= 1.11.0} BuildRequires: %{python_module pytest-xdist} 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 Requires: python-six >= 1.11.0 %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 # *smacks head against desk* Provides: python-Cheroot = %{version} BuildArch: noarch %ifpython2 Requires: python-backports.functools_lru_cache Requires: python-selectors2 %endif %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 '/--cov/ d' pytest.ini %build %python_build %install %python_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)" # https://github.com/cherrypy/cheroot/issues/502 donttest="$donttest or test_high_number_of_file_descriptors" %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 * Sat Apr 2 2022 Ben Greiner - Skip a test causing errors in pytest 7 -- gh#cherrypy/cheroot#502 * Sat Jan 22 2022 Ben Greiner - The work around needs to ignore the testfile from the sitelib * Sat Jan 22 2022 Ben Greiner - Work around xdist related conftest import error * Fri Jan 21 2022 Matej Cepl - Update to 8.6.0: - #384 via PR #385, PR #406: Exposed type stubs with annotations for public API - PR #401 (related to the PR #352 effort): Started reusing the the expriration_interval setting in the low-level select.select() invocation, effectively reducing the system load under the Windows OS when idle, that is noticeable on low-end hardware systems - Removed upstreamed patches - cheroot-pr370-py310-threaddeprecations.patch - cheroot-pr371-py310-threaddeprecations.patch - cheroot-c0b1b167-py310-threaddeprecations.patch - Add no-pypytools.patch removing the dependency on pypytools as we don't have PyPy in openSUSE at all. * Sun Dec 19 2021 Ben Greiner - Add patches fixing test suite failures due to Python 3.10 deprecations: * cheroot-pr370-py310-threaddeprecations.patch * cheroot-pr371-py310-threaddeprecations.patch * cheroot-c0b1b167-py310-threaddeprecations.patch - Skip threadexceptions plugin for Pytest 6.2 * Tue Oct 5 2021 Stefan Schubert - Added BuildRequires: alts * Thu Sep 30 2021 Stefan Schubert - Use libalternatives instead of update-alternatives. * Mon Mar 29 2021 Ben Greiner - Update BuildRequirements for testing: * only remove coverage options from pytest.ini * don't skip tests which had failed 2 years ago (gh#cherrypy/cheroot#200) -- except for two subtests still failing on some platforms presumably because of OBS specific network setups * skip the one test requiring python-jaraco.context in Factory staging so that we do not need that package in Ring1. * Fri Mar 19 2021 Steve Kowalik - 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 ` 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. * Mon May 25 2020 Petr Gajdos - %%python3_only -> %%python_alternative * Tue May 19 2020 Tomáš Chvátal - Add patch to fix build with python 3.8.3: * python383.patch * Thu May 7 2020 Pablo Suárez Hernández - Avoid possible race condition on persistent HTTP connections (bsc#1169604) - Added: * 0001-Avoid-race-condition-on-persistent-HTTP-connections.patch * Mon Mar 16 2020 Tomáš Chvátal - Fix build without python2 * Sat Mar 7 2020 Tomáš Chvátal - Update to 8.3.0: * cherrypy/cherrypy#910 via #243: Provide TLS-related details via WSGI environment interface. * #248: Fix parsing of the --bind CLI option for abstract UNIX sockets. * Wed Oct 23 2019 Marketa Calabkova - Update to 8.2.1 * Deprecated use of negative timeouts as alias for infinite timeouts in ThreadPool.stop. * For OPTION requests, bypass URI as path if it does not appear absolute. * Workers are now request-based, addressing the long-standing issue with keep-alive connections * Remove custom setup.cfg parser handling, allowing the project (including sdist) to build/run on setuptools 41.4. Now building cheroot requires setuptools 30.3 or later (for declarative config support) and preferably 34.4 or later (as indicated in pyproject.toml). * Fri Oct 4 2019 Marketa Calabkova - update to 7.0.0 * Refactored “open URL” behavior in webtest to rely on retry_call. * backports.functools_lru_cache is only required on Python 3.2 and earlier. * Fix race condition in threadpool shrink code. * Fri Sep 13 2019 Thomas Bechtold - update to 6.5.8: - Fix socket.SO_PEERCRED constant fallback value under PowerPC. - Fix race condition when toggling stats counting in the middle of request processing. - Improve post Python 3.9 compatibility checks. - Fix support of abstract namespace sockets - Fix HTTP parser to return 400 on invalid major-only HTTP version in Request-Line. - Drop cheroot_fix_so_peercred_ppc.patch . Applied upstream. * Thu Sep 5 2019 Michel Normand - Add cheroot_fix_so_peercred_ppc.patch to solve python 2.7 tests failures for PowerPC, boo#1147151 * Mon Sep 2 2019 Dan Čermák - Drop dependency on backports.functools_lru_cache for the python3 subpackage This fixes bsc#1149124 * Sun Jun 2 2019 Jan Engelhardt - Ensure neutrality of description. * Tue May 14 2019 Matej Cepl - Update to 6.5.5 bsc#1142582: - Sockets now collect statistics (bytes read and written) on Python 3 same as Python 2. - Ignore OpenSSL's 1.1+ Error 0 under any Python while wrapping a socket. - Switch off failing tests to avoid gh#cherrypy/cheroot#200 * Tue Mar 5 2019 Tomáš Chvátal - Update to 6.5.4: * too many changes to enumerate see CHANGES.rst - Make sure to execute testsuite * Fri Mar 31 2017 jmatejek@suse.com - initial commit