Blame python-fastapi.spec

ff1cd93
# For translations, check docs/*/docs/index.md
44d6223
%global sum_en  FastAPI framework
44d6223
%global sum_es  FastAPI framework
44d6223
# Missing translation (localized docs present, but untranslated)
43085cb
# Summary(de):    FastAPI framework
43085cb
# Missing translation (localized docs present, but untranslated)
44d6223
# Summary(fr):    FastAPI framework
44d6223
# Missing translation (localized docs present, but untranslated)
5b0d9b9
# Summary(id):    FastAPI framework
5b0d9b9
# Missing translation (localized docs present, but untranslated)
44d6223
# Summary(it):    FastAPI framework
44d6223
# Translation present, but the title was not translated
44d6223
%global sum_ja  FastAPI framework
03855a4
%global sum_ko  FastAPI 프레임워크
e2ce323
# Missing translation (localized docs present, but untranslated)
e2ce323
# %%global sum_pl  FastAPI framework
44d6223
%global sum_pt  Framework FastAPI
44d6223
# Missing translation (localized docs present, but untranslated)
44d6223
# %%global sum_ru  FastAPI framework
44d6223
# Missing translation (localized docs present, but untranslated)
44d6223
# %%global sum_sq  FastAPI framework
79dc1b0
%global sum_tr  FastAPI framework
44d6223
# Missing translation (localized docs present, but untranslated)
44d6223
# %%global sum_uk  FastAPI framework
44d6223
%global sum_zh  FastAPI 框架
44d6223
f41ab0b
Name:           python-fastapi
ff1cd93
Version:        0.70.1
1d4f7c9
Release:        %autorelease
44d6223
Summary:        %{sum_en}
9449886
9449886
License:        MIT
f41ab0b
URL:            https://github.com/tiangolo/fastapi
f41ab0b
Source0:        %{url}/archive/%{version}/fastapi-%{version}.tar.gz
9449886
BuildArch:      noarch
9449886
5c965b7
# A tiny difference in the OpenAPI schema in one test is not easily explained.
5c965b7
# Since we are using quite a few dependencies at different versions than those
5c965b7
# pinned upstream, it’s also hard to make a useful upstream bug report. For
5c965b7
# now, we just patch the expected schema downstream. The difference is
5c965b7
# trivial—just an added default value.
b300c57
Patch0:         fastapi-0.67.0-openapi-schema.patch
0d945b0
# Allow PyYAML 6.x
0d945b0
# https://github.com/tiangolo/fastapi/pull/4054
0d945b0
Patch1:         0001-Allow-PyYAML-6.x.patch
5c965b7
9449886
BuildRequires:  python3-devel
44d6223
a4fe319
Obsoletes:      python-fastapi-doc < 0.68.1-6
4a4e0b8
44d6223
Summary(en):    %{sum_en}
fdbe48f
Summary(es):    %{sum_es}
43085cb
# Summary(de):    %%{sum_de}
44d6223
# Summary(fr):    %%{sum_fr}
5b0d9b9
# Summary(id):    %%{sum_id}
44d6223
# Summary(it):    %%{sum_it}
44d6223
Summary(ja):    %{sum_ja}
44d6223
Summary(ko):    %{sum_ko}
e2ce323
# Summary(pl):    %{sum_pl}
44d6223
Summary(pt):    %{sum_pt}
44d6223
# Summary(ru):    %%{sum_ru}
44d6223
# Summary(sq):    %%{sum_sq}
79dc1b0
Summary(tr):    %{sum_tr}
44d6223
# Summary(uk):    %%{sum_uk}
44d6223
Summary(zh):    %{sum_zh}
44d6223
44d6223
%global common_description_en %{expand:
44d6223
FastAPI is a modern, fast (high-performance), web framework for building APIs
44d6223
with Python 3.6+ based on standard Python type hints.
44d6223
44d6223
The key features are:
44d6223
44d6223
  • Fast: Very high performance, on par with NodeJS and Go (thanks to Starlette
44d6223
    and Pydantic). One of the fastest Python frameworks available.
44d6223
44d6223
  • Fast to code: Increase the speed to develop features by about 200% to 300%.*
44d6223
  • Fewer bugs: Reduce about 40% of human (developer) induced errors.*
44d6223
  • Intuitive: Great editor support. Completion everywhere. Less time
44d6223
    debugging.
44d6223
  • Easy: Designed to be easy to use and learn. Less time reading docs.
44d6223
  • Short: Minimize code duplication. Multiple features from each parameter
44d6223
    declaration. Fewer bugs.
44d6223
  • Robust: Get production-ready code. With automatic interactive
44d6223
    documentation.
44d6223
  • Standards-based: Based on (and fully compatible with) the open standards
44d6223
    for APIs: OpenAPI (previously known as Swagger) and JSON Schema.
44d6223
44d6223
* estimation based on tests on an internal development team, building production
44d6223
  applications.}
44d6223
%global common_description_es %{expand:
44d6223
FastAPI es un web framework moderno y rápido (de alto rendimiento) para
44d6223
construir APIs con Python 3.6+ basado en las anotaciones de tipos estándar de
44d6223
Python.
44d6223
44d6223
Sus características principales son:
44d6223
44d6223
  • Rapidez: Alto rendimiento, a la par con NodeJS y Go (gracias a
44d6223
    Starlette y Pydantic). Uno de los frameworks de Python más rápidos.
44d6223
44d6223
  • Rápido de programar: Incrementa la velocidad de desarrollo entre 200% y
44d6223
    300%.*
44d6223
  • Menos errores: Reduce los errores humanos (de programador) aproximadamente
44d6223
    un 40%.*
44d6223
  • Intuitivo: Gran soporte en los editores con auto completado en todas
44d6223
    partes. Gasta menos tiempo debugging.
44d6223
  • Fácil: Está diseñado para ser fácil de usar y aprender. Gastando menos
44d6223
    tiempo leyendo documentación.
44d6223
  • Corto: Minimiza la duplicación de código. Múltiples funcionalidades con
44d6223
    cada declaración de parámetros. Menos errores.
44d6223
  • Robusto: Crea código listo para producción con documentación automática
44d6223
    interactiva.
44d6223
  • Basado en estándares: Basado y totalmente compatible con los estándares
44d6223
    abiertos para APIs: OpenAPI (conocido previamente como Swagger) y JSON
44d6223
    Schema.
44d6223
44d6223
* Esta estimación está basada en pruebas con un equipo de desarrollo interno
44d6223
  contruyendo aplicaciones listas para producción.}
43085cb
#%%global common_description_de %%{expand:…}
44d6223
#%%global common_description_fr %%{expand:…}
5b0d9b9
#%%global common_description_id %%{expand:…}
44d6223
#%%global common_description_it %%{expand:…}
44d6223
%global common_description_ja %{expand:
44d6223
FastAPI は、Pythonの標準である型ヒントに基づいてPython 3.6 以降でAPI
44d6223
を構築するための、モダンで、高速(高パフォーマンス)な、Web フレームワークです。
44d6223
44d6223
主な特徴:
44d6223
44d6223
  - 高速: NodeJS や Go 並みのとても高いパフォーマンス (Starlette と Pydantic
44d6223
    のおかげです)。最も高速な Python フレームワークの一つです。
44d6223
44d6223
  - 高速なコーディング: 開発速度を約 200%~300%向上させます。 *
44d6223
  - 少ないバグ: 開発者起因のヒューマンエラーを約 40%削減します。 *
44d6223
  - 直感的: 素晴らしいエディタのサポートや オートコンプリート。
44d6223
    デバッグ時間を削減します。
44d6223
  - 簡単: 簡単に利用、習得できるようにデザインされています。
44d6223
    ドキュメントを読む時間を削減します。
44d6223
  - 短い: コードの重複を最小限にしています。
44d6223
    各パラメータからの複数の機能。少ないバグ。
44d6223
  - 堅牢性:
44d6223
    自動対話ドキュメントを使用して、本番環境で使用できるコードを取得します。
44d6223
  - Standards-based: API
44d6223
    のオープンスタンダードに基づいており、完全に互換性があります: OpenAPI
44d6223
    (以前は Swagger として知られていました) や JSON スキーマ.
44d6223
44d6223
* 本番アプリケーションを構築している開発チームのテストによる見積もり。}
44d6223
%global common_description_ko %{expand:
44d6223
FastAPI는 현대적이고, 빠르며(고성능), 파이썬 표준 타입 힌트에 기초한
44d6223
Python3.6+의 API를 빌드하기 위한 웹 프레임워크입니다.
44d6223
44d6223
주요 특징으로:
44d6223
44d6223
  • 빠름: (Starlette과 Pydantic 덕분에) NodeJS 및 Go와 대등할 정도로 매우 높은
44d6223
    성능. 사용 가능한 가장 빠른 파이썬 프레임워크 중 하나.
44d6223
44d6223
  • 빠른 코드 작성: 약 200%에서 300%까지 기능 개발 속도 증가.*
44d6223
  • 적은 버그: 사람(개발자)에 의한 에러 약 40% 감소.*
44d6223
  • 직관적: 훌륭한 편집기 지원. 모든 곳에서 자동완성. 적은 디버깅 시간.
44d6223
  • 쉬움: 쉽게 사용하고 배우도록 설계. 적은 문서 읽기 시간.
44d6223
  • 짧음: 코드 중복 최소화. 각 매개변수 선언의 여러 기능. 적은 버그.
44d6223
  • 견고함: 준비된 프로덕션 용 코드를 얻으세요. 자동 대화형 문서와 함께.
44d6223
  • 표준 기반: API에 대한 (완전히 호환되는) 개방형 표준 기반: OpenAPI (이전에
44d6223
    Swagger로 알려졌던) 및 JSON 스키마.
44d6223
44d6223
* 내부 개발팀의 프로덕션 애플리케이션을 빌드한 테스트에 근거한 측정}
e2ce323
#%%global common_description_pl %%{expand:…}
44d6223
%global common_description_pt %{expand:
44d6223
FastAPI é um moderno e rápido (alta performance) framework web para construção
44d6223
de APIs com Python 3.6 ou superior, baseado nos type hints padrões do Python.
44d6223
44d6223
Os recursos chave são:
44d6223
44d6223
  • Rápido: alta performance, equivalente a NodeJS e Go (graças ao Starlette e
44d6223
    Pydantic). Um dos frameworks mais rápidos disponíveis.
44d6223
  • Rápido para codar: Aumenta a velocidade para desenvolver recursos entre
44d6223
    200% a 300%.*
44d6223
  • Poucos bugs: Reduz cerca de 40% de erros induzidos por humanos
44d6223
    (desenvolvedores).*
44d6223
  • Intuitivo: Grande suporte a IDEs. Auto-Complete em todos os lugares. Menos
44d6223
    tempo debugando.
44d6223
  • Fácil: Projetado para ser fácil de aprender e usar. Menos tempo lendo
44d6223
    documentação.
44d6223
  • Enxuto: Minimize duplicação de código. Múltiplos recursos para cada
44d6223
    declaração de parâmetro. Menos bugs.
44d6223
  • Robusto: Tenha código pronto para produção. E com documentação interativa
44d6223
    automática.
44d6223
  • Baseado em padrões: Baseado em (e totalmente compatível com) os padrões
44d6223
    abertos para APIs: OpenAPI (anteriormente conhecido como Swagger) e JSON
44d6223
    Schema.
44d6223
44d6223
* estimativas baseadas em testes realizados com equipe interna de
44d6223
  desenvolvimento, construindo aplicações em produção.}
44d6223
#%%global common_description_ru %%{expand:…}
44d6223
#%%global common_description_sq %%{expand:…}
79dc1b0
%global common_description_tr %{expand:
79dc1b0
FastAPI, Python 3.6+'nın standart type hintlerine dayanan modern ve hızlı
79dc1b0
(yüksek performanslı) API'lar oluşturmak için kullanılabilecek web framework'ü.
79dc1b0
79dc1b0
Ana özellikleri:
79dc1b0
79dc1b0
  • Hızlı: çok yüksek performanslı, NodeJS ve Go ile eşdeğer seviyede
79dc1b0
  performans sağlıyor, (Starlette ve Pydantic sayesinde.) Python'un en hızlı
79dc1b0
  frameworklerinden bir tanesi.
79dc1b0
79dc1b0
  • Kodlaması hızlı: Yeni özellikler geliştirmek neredeyse %200 - %300 daha hızlı.*
79dc1b0
  • Daha az bug: Geliştirici (insan) kaynaklı hatalar neredeyse %40 azaltıldı.*
79dc1b0
  • Sezgileri güçlü: Editor (otomatik-tamamlama) desteği harika. Otomatik
79dc1b0
    tamamlama her yerde. Debuglamak ile daha az zaman harcayacaksınız.
79dc1b0
  • Kolay: Öğrenmesi ve kullanması kolay olacak şekilde. Doküman okumak için
79dc1b0
    harcayacağınız süre azaltıldı.
79dc1b0
  • Kısa: Kod tekrarını minimuma indirdik. Fonksiyon parametrelerinin tiplerini
79dc1b0
    belirtmede farklı yollar sunarak karşılaşacağınız bug'ları azalttık.
79dc1b0
  • Güçlü: Otomatik dokümantasyon ile beraber, kullanıma hazır kod yaz.
79dc1b0
  • Standartlar belirli: Tamamiyle API'ların açık standartlara bağlı ve (tam
79dc1b0
    uyumlululuk içerisinde); OpenAPI (eski adıyla Swagger) ve JSON Schema.
79dc1b0
79dc1b0
* Bahsi geçen rakamsal ifadeler tamamiyle, geliştirme takımının kendi
79dc1b0
  sundukları ürünü geliştirirken yaptıkları testlere dayanmakta.}
44d6223
#%%global common_description_uk %%{expand:…}
44d6223
%global common_description_zh %{expand:
44d6223
FastAPI 是一个用于构建 API 的现代、快速(高性能)的 web 框架,使用 Python 3.6+
44d6223
并基于标准的 Python 类型提示。
44d6223
44d6223
关键特性:
44d6223
44d6223
  • 快速:可与 NodeJS 和 Go 比肩的极高性能(归功于 Starlette 和 Pydantic)。
44d6223
    最快的 Python web 框架之一。
44d6223
  • 高效编码:提高功能开发速度约 200% 至 300%。*
44d6223
  • 更少 bug:减少约 40% 的人为(开发者)导致错误。*
44d6223
  • 智能:极佳的编辑器支持。处处皆可自动补全,减少调试时间。
44d6223
  • 简单:设计的易于使用和学习,阅读文档的时间更短。
44d6223
  • 简短:使代码重复最小化。通过不同的参数声明实现丰富功能。bug 更少。
44d6223
  • 健壮:生产可用级别的代码。还有自动生成的交互式文档。
44d6223
  • 标准化:基于(并完全兼容)API 的相关开放标准:OpenAPI (以前被称为 Swagger)
44d6223
    和 JSON Schema。
44d6223
44d6223
* 根据对某个构建线上应用的内部开发团队所进行的测试估算得出。}
44d6223
44d6223
%description %{common_description_en}
44d6223
44d6223
%description -l en %{common_description_en}
44d6223
%description -l es %{common_description_es}
43085cb
#%%description -l de %%{common_description_de}
44d6223
#%%description -l fr %%{common_description_fr}
5b0d9b9
#%%description -l id %%{common_description_id}
44d6223
#%%description -l it %%{common_description_it}
44d6223
%description -l ja %{common_description_ja}
44d6223
%description -l ko %{common_description_ko}
e2ce323
#%%description -l pl %%{common_description_pl}
44d6223
%description -l pt %{common_description_pt}
44d6223
#%%description -l ru %%{common_description_ru}
44d6223
#%%description -l sq %%{common_description_sq}
79dc1b0
%description -l tr %{common_description_tr}
44d6223
#%%description -l uk %%{common_description_uk}
44d6223
%description -l zh %{common_description_zh}
44d6223
44d6223
f41ab0b
%pyproject_extras_subpkg -n python3-fastapi all
44d6223
44d6223
f41ab0b
%package -n     python3-fastapi
44d6223
Summary:        %{sum_en}
44d6223
44d6223
Summary(en):    %{sum_en}
44d6223
Summary(es):    %%{sum_es}
43085cb
# Summary(de):    %%{sum_de}
44d6223
# Summary(fr):    %%{sum_fr}
5b0d9b9
# Summary(id):    %%{sum_id}
44d6223
# Summary(it):    %%{sum_it}
44d6223
Summary(ja):    %{sum_ja}
44d6223
Summary(ko):    %{sum_ko}
e2ce323
# Summary(pl):    %%{sum_pl}
44d6223
Summary(pt):    %{sum_pt}
44d6223
# Summary(ru):    %%{sum_ru}
44d6223
# Summary(sq):    %%{sum_sq}
79dc1b0
Summary(tr):    %{sum_tr}
44d6223
# Summary(uk):    %%{sum_uk}
44d6223
Summary(zh):    %{sum_zh}
44d6223
f41ab0b
%description -n python3-fastapi %{common_description_en}
f41ab0b
f41ab0b
%description -n python3-fastapi -l en %{common_description_en}
f41ab0b
%description -n python3-fastapi -l es %{common_description_es}
f41ab0b
#%%description -n python3-fastapi -l de %%{common_description_de}
f41ab0b
#%%description -n python3-fastapi -l fr %%{common_description_fr}
f41ab0b
#%%description -n python3-fastapi -l id %%{common_description_id}
f41ab0b
#%%description -n python3-fastapi -l it %%{common_description_it}
f41ab0b
%description -n python3-fastapi -l ja %{common_description_ja}
f41ab0b
%description -n python3-fastapi -l ko %{common_description_ko}
f41ab0b
#%%description -n python3-fastapi -l pl %%{common_description_pl}
f41ab0b
%description -n python3-fastapi -l pt %{common_description_pt}
f41ab0b
#%%description -n python3-fastapi -l ru %%{common_description_ru}
f41ab0b
#%%description -n python3-fastapi -l sq %%{common_description_sq}
79dc1b0
%description -n python3-fastapi -l tr %{common_description_tr}
f41ab0b
#%%description -n python3-fastapi -l uk %%{common_description_uk}
f41ab0b
%description -n python3-fastapi -l zh %{common_description_zh}
44d6223
44d6223
9449886
%prep
f41ab0b
%autosetup -n fastapi-%{version} -p1
44d6223
44d6223
# Comment out all dependencies on orjson (for ORJSONResponse); it cannot be
44d6223
# packaged in Fedora until it builds with the stable Rust toolchain instead of
44d6223
# the nightly one. Note that this removes it from the “all” extra metapackage.
b286afb
sed -r -i 's/("orjson\b.*",)/# \1/' pyproject.toml
44d6223
# Loosen all dependencies that are pinned to exact versions. We have to try to
44d6223
# work with what is packaged.
b286afb
sed -r -i 's/==/>=/g' pyproject.toml
44d6223
# Comment out test dependencies that are only for linting/formatting/analysis,
44d6223
# and will not be used.
b286afb
sed -r -i 's/("(mypy|black|flake8|isort|autoflake)\b.*",)/# \1/' pyproject.toml
e886395
# We won’t be running a type checker (mypy), so we don’t need any
e886395
# auto-generated PEP 561 stub packages:
e886395
sed -r -i 's/("types-(u|or)json\b.*",)/# \1/' pyproject.toml
44d6223
# Selectively loosen dependencies that are perhaps arbitrarily pinned to
44d6223
# certain version ranges: first, those for which we choose to allow newer
b286afb
# versions…
24718a1
sed -r -i 's/("((httpx|pytest)\b)[^<"]*),[[:blank:]]*<[^"]*/\1/' pyproject.toml
44d6223
a4fe319
# Remove bundled js-termynal 0.0.1; since we are not building documentation, we
a4fe319
# do this very bluntly:
a4fe319
rm -rvf docs/*/docs/js docs/*/docs/css
352bf21
9449886
b358641
%generate_buildrequires
b358641
# Tests under tests/test_tutorial may require dependencies that are only in the
b358641
# dev extra.
a4fe319
%pyproject_buildrequires -x all,test,dev
b358641
b358641
9449886
%build
44d6223
%pyproject_wheel
44d6223
9449886
9449886
%install
44d6223
%pyproject_install
f41ab0b
%pyproject_save_files fastapi
44d6223
9449886
9449886
%check
3a68a2a
# FAILED tests/test_typing_python39.py::test_typing - TypeError: issubclass() a...
3a68a2a
#   Because upstream is behind on dependencies *and* does not test with Python
3a68a2a
#   3.10 yet, it’s hard to tell if this is a Python 3.10 issue or an
d44f8dd
#   incompatibility with the particular version of pydantic in Fedora. Until
d44f8dd
#   upstream at leasts supports Python 3.10 properly, it will be difficult to
d44f8dd
#   form a usable upstream bug report from this failure.
3a68a2a
#
44d6223
# Requires orjson:
24e0de6
#   tests/test_tutorial/test_custom_response/test_tutorial001b.py
44d6223
#   tests/test_default_response_class.py
44d6223
%pytest \
3a68a2a
    --ignore=tests/test_typing_python39.py \
bb28785
    --ignore=tests/test_tutorial/test_custom_response/test_tutorial001b.py \
44d6223
    --ignore=tests/test_default_response_class.py
9449886
44d6223
f41ab0b
%files -n python3-fastapi -f %{pyproject_files}
9449886
%license LICENSE
a4fe319
%doc CONTRIBUTING.md
9449886
%doc README.md
44d6223
44d6223
9449886
%changelog
1d4f7c9
%autochangelog