14
0
Files
python-uvicorn/python-uvicorn.spec
Dirk Mueller a52e041210 - update to 0.28.0:
* Raise `ClientDisconnected` on `send()` when client
    disconnected (#2220) 12/02/24
  * Except `AttributeError` on `sys.stdin.fileno()` for Windows
    IIS10 (#1947) 29/02/24
  * Use `X-Forwarded-Proto` for WebSockets scheme when the proxy
    provides it (#2258) 01/03/24
  * Fix spurious LocalProtocolError errors when processing
    pipelined requests (#2243) 10/02/24
  * Fix nav overrides for newer version of Mkdocs Material
    (#2233) 26/01/24
  * Raise `ClientDisconnect(IOError)` on `send()` when client
    disconnected (#2218) 19/01/24
  * Bump ASGI WebSocket spec version to 2.4 (#2221) 20/01/24
  * Update `--root-path` to include the root path prefix in the
    full ASGI `path` as per the ASGI spec (#2213) 16/01/24
  * Use `__future__.annotations` on some internal modules (#2199)
    16/01/24

- Disable flacky test in s390x with current python-websockets,
  bsc#1217022

OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-uvicorn?expand=0&rev=34
2024-03-17 10:12:13 +00:00

112 lines
3.7 KiB
RPMSpec

#
# spec file for package python-uvicorn
#
# 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/
#
%{?sle15_python_module_pythons}
Name: python-uvicorn
Version: 0.28.0
Release: 0
Summary: An Asynchronous Server Gateway Interface server
License: BSD-3-Clause
URL: https://github.com/encode/uvicorn
Source: https://github.com/encode/uvicorn/archive/%{version}.tar.gz#/uvicorn-%{version}.tar.gz
# PATCH-FIX-UPSTREAM fix-websocket-tests.patch -- gh#encode/uvicorn#1929
Patch0: fix-websocket-tests.patch
BuildRequires: %{python_module base >= 3.8}
BuildRequires: %{python_module hatchling}
BuildRequires: %{python_module pip}
BuildRequires: %{python_module setuptools}
BuildRequires: %{python_module typing-extensions >= 4 if %python-base < 3.11}
BuildRequires: %{python_module wheel}
BuildRequires: fdupes
BuildRequires: python-rpm-macros
Requires: python-click >= 7.0
Requires: python-h11 >= 0.8.0
Requires: (python-typing-extensions >= 4 if python-base < 3.11)
Recommends: python-PyYAML >= 5.1
Recommends: python-httptools >= 0.4.0
Recommends: python-websockets >= 8.0
Suggests: python-uvloop >= 0.14.0
Suggests: python-watchfiles >= 0.13
Suggests: python-wsproto >= 1.2.0
Suggests: python-websockets
Requires(post): update-alternatives
Requires(postun): update-alternatives
BuildArch: noarch
# SECTION test requirements
BuildRequires: %{python_module PyYAML >= 5.1}
BuildRequires: %{python_module click >= 7.0}
BuildRequires: %{python_module h11 >= 0.8.0}
BuildRequires: %{python_module httptools >= 0.4.0}
BuildRequires: %{python_module httpx >= 0.18}
BuildRequires: %{python_module pytest-asyncio}
BuildRequires: %{python_module pytest-mock}
BuildRequires: %{python_module pytest}
BuildRequires: %{python_module python-dotenv}
BuildRequires: %{python_module requests}
BuildRequires: %{python_module trustme}
%if 0%{?suse_version} > 1500
BuildRequires: %{python_module uvloop >= 0.14.0}
%endif
BuildRequires: %{python_module websockets >= 8.0}
BuildRequires: %{python_module wsproto >= 1.2.0}
# We don't want watchfiles in Ring1
#BuildRequires: #{python_module watchfiles >= 0.13}
# /SECTION
%python_subpackages
%description
Uvicorn is an ASGI server implementation, using uvloop and httptools.
It supports HTTP/1.1 and WebSockets only.
%prep
%autosetup -p1 -n uvicorn-%{version}
%build
%pyproject_wheel
%install
%pyproject_install
%python_clone -a %{buildroot}%{_bindir}/uvicorn
%python_expand %fdupes %{buildroot}%{$python_sitelib}
%post
%python_install_alternative uvicorn
%postun
%python_uninstall_alternative uvicorn
%check
# Required for reporting bugs
%python_exec -m uvicorn --version
# No module python-a2wsgi
ignore="--ignore tests/middleware/test_wsgi.py"
# Disable flacky test in s390x with current python-websockets
%if "%{_arch}" == "s390x"
ignore+=" --ignore tests/protocols/test_websocket.py"
%endif
%pytest $ignore
%files %{python_files}
%doc README.md
%license LICENSE.md
%python_alternative %{_bindir}/uvicorn
%{python_sitelib}/uvicorn
%{python_sitelib}/uvicorn-%{version}*-info
%changelog