Use %pypi_source to avoid cd'ing to flit_core all over the spec

This commit is contained in:
Miro Hrončok 2023-05-22 09:59:31 +02:00
parent e1a2de736e
commit a2c0dbcb0c
3 changed files with 8 additions and 9 deletions

1
.gitignore vendored
View File

@ -18,3 +18,4 @@
/flit-3.5.1.tar.gz
/flit-3.7.1.tar.gz
/flit-3.8.0.tar.gz
/flit_core-3.8.0.tar.gz

View File

@ -15,7 +15,7 @@ Summary: PEP 517 build backend for packages using Flit
License: BSD-3-Clause
URL: https://flit.pypa.io/
Source: https://github.com/pypa/flit/archive/%{version}/flit-%{version}.tar.gz
Source: %{pypi_source flit_core}
BuildArch: noarch
BuildRequires: python3-devel
@ -49,23 +49,21 @@ Requires: python(abi) = %{python3_version}
%prep
%autosetup -p1 -n flit-%{version}
%autosetup -p1 -n flit_core-%{version}
# Remove vendored tomli that flit_core includes to solve the circular dependency on older Pythons
# (flit_core requires tomli, but flit_core is needed to build tomli).
# We don't use this, as tomllib is a part of standard library since Python 3.11.
rm -rf flit_core/flit_core/vendor
rm -rf flit_core/vendor
%if %{without bootstrap}
%generate_buildrequires
cd flit_core
%pyproject_buildrequires
%endif
%build
cd flit_core
%if %{with bootstrap}
%{python3} -m flit_core.wheel
%else
@ -74,7 +72,6 @@ cd flit_core
%install
%if %{with bootstrap}
cd flit_core
%{python3} bootstrap_install.py --install-root %{buildroot} dist/flit_core-%{version}-py3-none-any.whl
# for consistency with %%pyproject_install:
rm %{buildroot}%{python3_sitelib}/flit_core-*.dist-info/RECORD
@ -90,14 +87,15 @@ rm -r %{buildroot}%{python3_sitelib}/flit_core/tests/
%check
%py3_check_import flit_core flit_core.buildapi
%if %{with tests}
cd flit_core
%pytest
%endif
%files -n python3-flit-core
%license LICENSE
%doc flit_core/README.rst
# README.rst is missing from the sdist,
# but it basically contains the %%description only,
# so probably not worth adding anyway.
%{python3_sitelib}/flit_core-*.dist-info/
%{python3_sitelib}/flit_core/

View File

@ -1 +1 @@
SHA512 (flit-3.8.0.tar.gz) = c4af79e1511e647303dc6b0913d8526586580db8d916aa7c4a52a9ebb281b375b6082e961ac8be05c0fc8ffdd8c3ec858fcba4e7faea25f465895288fa09c355
SHA512 (flit_core-3.8.0.tar.gz) = 914804e3f2040762381afe039272d9d6fdbcd3f3cf8b9eea854f2f1d95edcb01718fd6685476bc1cdc251dfc46ef80b40f087df881d8b963dcc3f3332fd32a46