| |
@@ -1,3 +1,15 @@
|
| |
+ # This package corresponds to two PyPI projects (fastapi-slim, and fastapi)
|
| |
+ # co-developed in one repository. Since the two are versioned identically and
|
| |
+ # released at the same time, it makes sense to build them from a single source
|
| |
+ # package. (The fastapi-cli package is versioned and packaged separately.)
|
| |
+
|
| |
+ # Breaks a circular dependency on fastapi-cli by omitting it from fastapi’s
|
| |
+ # “standard” and “all” extras.
|
| |
+ %bcond bootstrap 1
|
| |
+
|
| |
+ %bcond orjson 1
|
| |
+ %bcond uvicorn 1
|
| |
+
|
| |
# For translations, check docs/*/docs/index.md
|
| |
# Note that there are many other localized versions of the documentation
|
| |
# *present*, but untranslated.
|
| |
@@ -18,11 +30,8 @@
|
| |
%global sum_yo Ìlànà wẹ́ẹ́bù FastAPI
|
| |
%global sum_zh FastAPI 框架
|
| |
|
| |
- %bcond orjson 1
|
| |
- %bcond uvicorn 1
|
| |
-
|
| |
Name: python-fastapi
|
| |
- Version: 0.110.3
|
| |
+ Version: 0.111.0
|
| |
Release: %autorelease
|
| |
Summary: %{sum_en}
|
| |
|
| |
@@ -39,6 +48,32 @@
|
| |
|
| |
BuildRequires: python3-devel
|
| |
|
| |
+ # Since requirements-tests.txt and requirements-docs-tests.txt contain
|
| |
+ # overly-strict version bounds and many unwanted
|
| |
+ # linting/coverage/typechecking/formatting dependencies
|
| |
+ # (https://docs.fedoraproject.org/en-US/packaging-guidelines/Python/#_linters),
|
| |
+ # we just list the test dependencies we *do* want manually rather than trying
|
| |
+ # to patch the requirements files. We preserve upstream’s lower bounds but
|
| |
+ # remove upper bounds, as we must try to make do with what we have.
|
| |
+ #
|
| |
+ # requirements-docs-tests.txt:
|
| |
+ # # For mkdocstrings and tests
|
| |
+ BuildRequires: %{py3_dist httpx} >= 0.23
|
| |
+ # requirements-tests.txt:
|
| |
+ BuildRequires: %{py3_dist pytest} >= 7.1.3
|
| |
+ BuildRequires: %{py3_dist dirty-equals} >= 0.6
|
| |
+ # https://github.com/tiangolo/fastapi/pull/5799
|
| |
+ BuildRequires: %{py3_dist sqlalchemy} >= 1.4.42
|
| |
+ BuildRequires: %{py3_dist databases[sqlite]} >= 0.7
|
| |
+ BuildRequires: %{py3_dist flask} >= 1.1.2
|
| |
+ BuildRequires: %{py3_dist anyio[trio]} >= 3.2.1
|
| |
+ # Omit python-jose[cryptography] because it has limited use in the tests, is
|
| |
+ # unsupported upstream (https://github.com/mpdavis/python-jose/issues/340,
|
| |
+ # https://github.com/mpdavis/python-jose/issues/332), and we would like to drop
|
| |
+ # it from Fedora.
|
| |
+ BuildRequires: %{py3_dist pyyaml} >= 5.3.1
|
| |
+ BuildRequires: %{py3_dist passlib[bcrypt]} >= 1.7.2
|
| |
+
|
| |
Summary(bn): %{sum_bn}
|
| |
Summary(de): %{sum_de}
|
| |
Summary(en): %{sum_en}
|
| |
@@ -467,9 +502,6 @@
|
| |
%description -l zh %{common_description_zh}
|
| |
|
| |
|
| |
- %pyproject_extras_subpkg -n python3-fastapi all
|
| |
-
|
| |
-
|
| |
%package -n python3-fastapi
|
| |
Summary: %{sum_en}
|
| |
|
| |
@@ -490,6 +522,9 @@
|
| |
Summary(yo): %{sum_yo}
|
| |
Summary(zh): %{sum_zh}
|
| |
|
| |
+ # https://docs.fedoraproject.org/en-US/packaging-guidelines/#_requiring_base_package
|
| |
+ Requires: python3-fastapi-slim = %{version}-%{release}
|
| |
+
|
| |
%description -n python3-fastapi %{common_description_en}
|
| |
|
| |
%description -n python3-fastapi -l bn %{common_description_bn}
|
| |
@@ -510,9 +545,61 @@
|
| |
%description -n python3-fastapi -l zh %{common_description_zh}
|
| |
|
| |
|
| |
+ %pyproject_extras_subpkg -n python3-fastapi -i %{python3_sitelib}/fastapi-%{version}.dist-info all
|
| |
+
|
| |
+
|
| |
+ %package -n python3-fastapi-slim
|
| |
+ Summary: %{sum_en}
|
| |
+
|
| |
+ Summary(bn): %{sum_bn}
|
| |
+ Summary(de): %{sum_de}
|
| |
+ Summary(en): %{sum_en}
|
| |
+ Summary(es): %{sum_es}
|
| |
+ Summary(fr): %{sum_fr}
|
| |
+ Summary(he): %{sum_he}
|
| |
+ Summary(hu): %{sum_hu}
|
| |
+ Summary(ja): %{sum_ja}
|
| |
+ Summary(ko): %{sum_ko}
|
| |
+ Summary(pl): %{sum_pl}
|
| |
+ Summary(pt): %{sum_pt}
|
| |
+ Summary(ru): %{sum_ru}
|
| |
+ Summary(tr): %{sum_tr}
|
| |
+ Summary(uk): %{sum_uk}
|
| |
+ Summary(yo): %{sum_yo}
|
| |
+ Summary(zh): %{sum_zh}
|
| |
+
|
| |
+ %description -n python3-fastapi-slim %{common_description_en}
|
| |
+
|
| |
+ %description -n python3-fastapi-slim -l bn %{common_description_bn}
|
| |
+ %description -n python3-fastapi-slim -l de %{common_description_de}
|
| |
+ %description -n python3-fastapi-slim -l en %{common_description_en}
|
| |
+ %description -n python3-fastapi-slim -l es %{common_description_es}
|
| |
+ %description -n python3-fastapi-slim -l fr %{common_description_fr}
|
| |
+ %description -n python3-fastapi-slim -l he %{common_description_he}
|
| |
+ %description -n python3-fastapi-slim -l hu %{common_description_hu}
|
| |
+ %description -n python3-fastapi-slim -l ja %{common_description_ja}
|
| |
+ %description -n python3-fastapi-slim -l ko %{common_description_ko}
|
| |
+ %description -n python3-fastapi-slim -l pl %{common_description_pl}
|
| |
+ %description -n python3-fastapi-slim -l pt %{common_description_pt}
|
| |
+ %description -n python3-fastapi-slim -l ru %{common_description_ru}
|
| |
+ %description -n python3-fastapi-slim -l tr %{common_description_tr}
|
| |
+ %description -n python3-fastapi-slim -l uk %{common_description_uk}
|
| |
+ %description -n python3-fastapi-slim -l yo %{common_description_yo}
|
| |
+ %description -n python3-fastapi-slim -l zh %{common_description_zh}
|
| |
+
|
| |
+
|
| |
+ %pyproject_extras_subpkg -n python3-fastapi-slim -i %{python3_sitelib}/fastapi_slim-%{version}.dist-info standard all
|
| |
+
|
| |
+
|
| |
%prep
|
| |
%autosetup -n fastapi-%{version} -p1
|
| |
|
| |
+ %if %{with bootstrap}
|
| |
+ # Break a dependency cycle with fastapi-cli by commenting out all dependencies
|
| |
+ # on it. Note that this removes it from the “standard” and “all” extra
|
| |
+ # metapackages.
|
| |
+ sed -r -i 's/("fastapi-cli(-slim)?\b.*",)/# \1/' pyproject.toml
|
| |
+ %endif
|
| |
%if %{without orjson}
|
| |
# Comment out all dependencies on orjson (for ORJSONResponse). Note that this
|
| |
# removes it from the “all” extra metapackage.
|
| |
@@ -524,64 +611,30 @@
|
| |
sed -r -i 's/("uvicorn\b.*",)/# \1/' pyproject.toml
|
| |
%endif
|
| |
|
| |
- # Comment out test dependencies that are only for linting/formatting/analysis,
|
| |
- # and will not be used.
|
| |
- #
|
| |
- # We won’t be running a type checker (mypy), so we don’t need any
|
| |
- # auto-generated PEP 561 stub packages.
|
| |
- #
|
| |
- # Dependency generation does not support -e, and we will generate the
|
| |
- # install-time dependencies without it.
|
| |
- #
|
| |
- # In general, we cannot respect exact-version pins, so we loosen them to lower
|
| |
- # bounds.
|
| |
- #
|
| |
- # Filter requirements-docs-tests.txt similarly, and reference the filtered
|
| |
- # version from requirements-tests-filtered.txt.
|
| |
- #
|
| |
- # Assume that newer versions of httpx are OK for docs; trying to get upstream
|
| |
- # to update this pin every time there is a new 0.x release is too
|
| |
- # tedious. Similarly, allow testing with Flask 3.x and anyio 4.x.
|
| |
- #
|
| |
- # Patch out python-jose because it has limited use in the tests, is unsupported
|
| |
- # upstream (https://github.com/mpdavis/python-jose/issues/340,
|
| |
- # https://github.com/mpdavis/python-jose/issues/332), and we would like to drop
|
| |
- # it from Fedora.
|
| |
- sed -r \
|
| |
- -e 's/^(mypy|ruff|coverage)\b/# &/' \
|
| |
- -e 's/^(types-(u|or)json)\b/# &/' \
|
| |
- -e 's/^(-e .)/# &/' \
|
| |
- -e 's/==/>=/' \
|
| |
- %if %{without orjson}
|
| |
- -e 's/^(orjson)\b/# &/' \
|
| |
- %endif
|
| |
- -e 's/((anyio\[trio\]|flask) [^,]*),<.*/\1/' \
|
| |
- -e 's/((pytest) [^,]*),<.*/\1/' \
|
| |
- -e 's/(requirements-docs-tests)(\.txt)/\1-filtered\2/' \
|
| |
- -e 's/^(python-jose)\b/# &/' \
|
| |
- requirements-tests.txt | tee requirements-tests-filtered.txt
|
| |
- sed -r \
|
| |
- -e 's/^(black)\b/# &/' \
|
| |
- -e 's/==/>=/' \
|
| |
- -e 's/((httpx) [^,]*),<.*/\1/' \
|
| |
- requirements-docs-tests.txt | tee requirements-docs-tests-filtered.txt
|
| |
-
|
| |
# Remove bundled js-termynal 0.0.1; since we are not building documentation, we
|
| |
# do this very bluntly:
|
| |
rm -rvf docs/*/docs/js docs/*/docs/css
|
| |
|
| |
|
| |
%generate_buildrequires
|
| |
- %pyproject_buildrequires -x all requirements-tests-filtered.txt
|
| |
+ export TIANGOLO_BUILD_PACKAGE='fastapi-slim'
|
| |
+ %pyproject_buildrequires -x standard,all
|
| |
+ (
|
| |
+ export TIANGOLO_BUILD_PACKAGE='fastapi'
|
| |
+ %pyproject_buildrequires
|
| |
+ ) | grep -vE '\bfastapi-slim\b'
|
| |
+ %pyproject_buildrequires -x all
|
| |
|
| |
|
| |
%build
|
| |
+ export TIANGOLO_BUILD_PACKAGE='fastapi-slim'
|
| |
+ %pyproject_wheel
|
| |
+ export TIANGOLO_BUILD_PACKAGE='fastapi'
|
| |
%pyproject_wheel
|
| |
|
| |
|
| |
%install
|
| |
%pyproject_install
|
| |
- %pyproject_save_files -L fastapi
|
| |
|
| |
|
| |
%check
|
| |
@@ -592,7 +645,8 @@
|
| |
ignore="${ignore-} --ignore=tests/test_tutorial/test_custom_response/test_tutorial009c.py"
|
| |
%endif
|
| |
|
| |
- # These require python-jose, which is unmaintained upstream and which we have chosen to drop as a test dependency.
|
| |
+ # These require python-jose, which is unmaintained upstream and which we have
|
| |
+ # chosen to drop as a test dependency.
|
| |
ignore="${ignore-} --ignore-glob=tests/test_tutorial/test_security/test_tutorial005*"
|
| |
|
| |
# Ignore all DeprecationWarning messages, as they pop up from various
|
| |
@@ -601,11 +655,18 @@
|
| |
%pytest -W 'ignore::DeprecationWarning' -k "${k-}" ${ignore-}
|
| |
|
| |
|
| |
- %files -n python3-fastapi -f %{pyproject_files}
|
| |
+ %files -n python3-fastapi
|
| |
+ %{python3_sitelib}/fastapi-%{version}.dist-info/
|
| |
+
|
| |
+
|
| |
+ %files -n python3-fastapi-slim
|
| |
%license LICENSE
|
| |
%doc CITATION.cff
|
| |
%doc README.md
|
| |
|
| |
+ %{python3_sitelib}/fastapi/
|
| |
+ %{python3_sitelib}/fastapi_slim-%{version}.dist-info/
|
| |
+
|
| |
|
| |
%changelog
|
| |
%autochangelog
|
| |
Upstream tag: 0.111.0
Upstream commit: 1c3e6918
Release monitoring project: 47977
Resolves: rhbz#2278772
If you need to do any change in this pull request, you can clone Packit's fork and push directly to the source branch of this PR (provided you have commit access to this repository):
Alternatively, if you already have the package repository cloned, you can just fetch the Packit's fork:
If you have the
koji_build
job configured as well, make sure to configure theallowed_pr_authors
and/orallowed_committers
(see the docs) since by default, Packit reacts only to its own PRs.Before pushing builds/updates, please remember to check the new version against the packaging guidelines.
For example, please:
:exclamation: Changed default for the changelog entry generated by Packit
We would like to bring to your attention a recent update regarding the default changelog entry generated by Packit during release syncing. Going forward, the default changelog entry will be generated as follows:
followed by a Bugzilla reference if thereis an open bug about a new upstream release.
This aligns with the Fedora Packaging Guidelines and has been agreed upon in this discussion. If you prefer a different behaviour, you can override this default in your configuration, e.g. by using custom command(s) in
changelog-entry
action (see example).