diff --git a/python-flit.spec b/python-flit.spec index b8c2c96..4685a12 100644 --- a/python-flit.spec +++ b/python-flit.spec @@ -1,16 +1,10 @@ -# When bootstrapping new Python we need to build flit in bootstrap mode. -# The Python RPM dependency generators and pip are not yet available. -# When building in bootstrap mode, only flit-core is built. -%bcond bootstrap 0 - -# Tests are enabled by default, unless we bootstrap. -# Disable them to avoid a circular build dependency on requests-download and testpath. +# Tests are enabled by default # RHEL does not have all the test dependencies -%bcond tests %[%{without bootstrap} && ! %[%{defined rhel} && %{undefined epel}]] +%bcond tests %[! %[%{defined rhel} && %{undefined epel}]] Name: python-flit Version: 3.8.0 -Release: 2%{?dist} +Release: 3%{?dist} Summary: Simplified packaging of Python modules # ./flit/log.py: Apache-2.0 @@ -25,27 +19,14 @@ Source1: https://pypi.org/pypi?%3Aaction=list_classifiers#/classifiers.ls BuildArch: noarch BuildRequires: python3-devel -%if %{without bootstrap} -BuildRequires: pyproject-rpm-macros >= 0-40 -BuildRequires: python3-pip -%endif %if %{with tests} -# Runtime deps, others -BuildRequires: python3-requests -BuildRequires: python3-docutils -BuildRequires: python3-pygments -BuildRequires: python3-tomli-w - -# Test deps BuildRequires: /usr/bin/python BuildRequires: python3-pytest BuildRequires: python3-responses -BuildRequires: git-core - -# Test deps that require flit to build: BuildRequires: python3-testpath BuildRequires: python3-requests-download +BuildRequires: git-core %endif %global _description %{expand: @@ -64,10 +45,8 @@ so long as they can be imported on Python 3.} %description %_description -%if %{without bootstrap} %package -n python3-flit Summary: %{summary} -Requires: python3-flit-core = %{version}-%{release} # https://pypi.python.org/pypi/tornado # ./flit/log.py unknown version @@ -77,95 +56,52 @@ Provides: bundled(python3dist(tornado)) Recommends: python3-pygments %description -n python3-flit %_description -%endif - - -%package -n python3-flit-core -Summary: PEP 517 build backend for packages using Flit -Conflicts: python3-flit < 2.1.0-2 - -# RPM generators are not yet available when we bootstrap -%if %{with bootstrap} -Provides: python%{python3_pkgversion}dist(flit-core) = %{version} -Provides: python%{python3_version}dist(flit-core) = %{version} -Requires: python(abi) = %{python3_version} -%endif - -%description -n python3-flit-core -This provides a PEP 517 build backend for packages using Flit. -The only public interface is the API specified by PEP 517, -at flit_core.buildapi. %prep %autosetup -p1 -n flit-%{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 + +%generate_buildrequires +%pyproject_buildrequires + %build export FLIT_NO_NETWORK=1 - -# first, build flit_core with self -cd flit_core -%if %{with bootstrap} -%{python3} -m flit_core.wheel -%else %pyproject_wheel -cd - -# build of the main flit (needs flit_core) -export PYTHONPATH=$PWD:$PWD/flit_core -%pyproject_wheel -%endif %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 -%else %pyproject_install -%endif +%pyproject_save_files flit -# don't ship tests in flit_core package -# if upstream decides to change the installation, it can be removed: -# https://github.com/takluyver/flit/issues/403 -rm -r %{buildroot}%{python3_sitelib}/flit_core/tests/ -%if %{with tests} %check +%pyproject_check_import + +%if %{with tests} # flit attempts to download list of classifiers from PyPI, but not if it's cached # test_invalid_classifier fails without the list mkdir -p fake_cache/flit cp %{SOURCE1} fake_cache/flit export XDG_CACHE_HOME=$PWD/fake_cache +# This also runs tests of flit_core but deselecting them breaks the flit tests, +# so we run them anyway: %pytest %endif -%if %{without bootstrap} -%files -n python3-flit +%files -n python3-flit -f %{pyproject_files} %license LICENSE %doc README.rst -%{python3_sitelib}/flit-*.dist-info/ -%{python3_sitelib}/flit/ %{_bindir}/flit -%endif - - -%files -n python3-flit-core -%license LICENSE -%doc flit_core/README.rst -%{python3_sitelib}/flit_core-*.dist-info/ -%{python3_sitelib}/flit_core/ %changelog +* Fri May 19 2023 Miro HronĨok - 3.8.0-3 +- Fork python-flit-core from the python-flit package + * Fri Jan 20 2023 Fedora Release Engineering - 3.8.0-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild