Blob Blame History Raw
Name:           python-starlette
Version:        0.18.0
Release:        %autorelease
Summary:        The little ASGI library that shines

License:        BSD
BuildArch:      noarch

BuildRequires:  python3-devel

Obsoletes:      python-starlette-doc < 0.16.0-10

%global common_description %{expand:
Starlette is a lightweight ASGI framework/toolkit, which is ideal for building
high performance async services.

It is production-ready, and gives you the following:

  • Seriously impressive performance.
  • WebSocket support.
  • In-process background tasks.
  • Startup and shutdown events.
  • Test client built on requests.
  • CORS, GZip, Static Files, Streaming responses.
  • Session and Cookie support.
  • 100%% test coverage.
  • 100%% type annotated codebase.
  • Few hard dependencies.
  • Compatible with asyncio and trio backends.}

%description %{common_description}

%pyproject_extras_subpkg -n python3-starlette full

%package -n     python3-starlette
Summary:        %{summary}

%description -n python3-starlette %{common_description}

%autosetup -n starlette-%{version}

# Remove Gitter chat app from documentation; it relies on pre-compiled/minified
# JavaScript, which is not acceptable in Fedora. Since we are not building
# documentation, we do this very bluntly:
rm -vrf docs/js

# Produce a filtered version of requirements.txt, which contains testing
# dependencies.
# We do not need the “Optionals”, which correspond to the “full” extra we are
# already BR’ing; those for “Packaging”, which are for uploading to PyPI; or
# those for “Documentation”, so long as we are not able to build and package
# it; but we do need those for “Testing”, except linters, formatters, coverage
# analysis, and mypy-related dependencies.
# Loosen exact-version dependencies.
awk '
!NF { next }
$1 == "#" {
  o = $2 !~ /^(Optionals|Documentation|Packaging)$/
o {
  if ($1 ~ /^(black|coverage|(auto)?flake8?|isort|mypy|types-)/) { next }
  print $0
' requirements.txt | sed -r 's/==/>=/' | tee requirements-filtered.txt

%pyproject_buildrequires -x full requirements-filtered.txt


%pyproject_save_files starlette


%files -n python3-starlette -f %{pyproject_files}