Fix CI tests for setuptools 61+
This commit is contained in:
parent
5b7df3cdd7
commit
111dd87a26
@ -48,7 +48,11 @@ cd ..
|
|||||||
# Internal check for the value of %%{pyproject_build_lib}
|
# Internal check for the value of %%{pyproject_build_lib}
|
||||||
%if 0%{?fedora} >= 36 || 0%{?rhel} >= 10
|
%if 0%{?fedora} >= 36 || 0%{?rhel} >= 10
|
||||||
cd markupsafe-%{markupsafe_version}
|
cd markupsafe-%{markupsafe_version}
|
||||||
|
%if 0%{?fedora} >= 37 || 0%{?rhel} >= 10
|
||||||
|
test "%{pyproject_build_lib}" == "%{_builddir}/%{buildsubdir}/markupsafe-%{markupsafe_version}/build/lib.%{python3_platform}-cpython-%{python3_version_nodots}"
|
||||||
|
%else
|
||||||
test "%{pyproject_build_lib}" == "%{_builddir}/%{buildsubdir}/markupsafe-%{markupsafe_version}/build/lib.%{python3_platform}-%{python3_version}"
|
test "%{pyproject_build_lib}" == "%{_builddir}/%{buildsubdir}/markupsafe-%{markupsafe_version}/build/lib.%{python3_platform}-%{python3_version}"
|
||||||
|
%endif
|
||||||
cd ../tldr-%{tldr_version}
|
cd ../tldr-%{tldr_version}
|
||||||
test "%{pyproject_build_lib}" == "%{_builddir}/%{buildsubdir}/tldr-%{tldr_version}/build/lib"
|
test "%{pyproject_build_lib}" == "%{_builddir}/%{buildsubdir}/tldr-%{tldr_version}/build/lib"
|
||||||
cd ..
|
cd ..
|
||||||
|
@ -92,7 +92,11 @@ grep -E '/site-packages/__pycache__/$' %{pyproject_files} && exit 1 || true
|
|||||||
|
|
||||||
# Internal check for the value of %%{pyproject_build_lib} in an archful package
|
# Internal check for the value of %%{pyproject_build_lib} in an archful package
|
||||||
%if 0%{?fedora} >= 36 || 0%{?rhel} >= 10
|
%if 0%{?fedora} >= 36 || 0%{?rhel} >= 10
|
||||||
|
%if 0%{?fedora} >= 37 || 0%{?rhel} >= 10
|
||||||
|
test "%{pyproject_build_lib}" == "%{_builddir}/%{buildsubdir}/build/lib.%{python3_platform}-cpython-%{python3_version_nodots}"
|
||||||
|
%else
|
||||||
test "%{pyproject_build_lib}" == "%{_builddir}/%{buildsubdir}/build/lib.%{python3_platform}-%{python3_version}"
|
test "%{pyproject_build_lib}" == "%{_builddir}/%{buildsubdir}/build/lib.%{python3_platform}-%{python3_version}"
|
||||||
|
%endif
|
||||||
%else
|
%else
|
||||||
test "%{pyproject_build_lib}" == "$(echo %{_pyproject_builddir}/pip-req-build-*/build/lib.%{python3_platform}-%{python3_version})"
|
test "%{pyproject_build_lib}" == "$(echo %{_pyproject_builddir}/pip-req-build-*/build/lib.%{python3_platform}-%{python3_version})"
|
||||||
%endif
|
%endif
|
||||||
|
@ -1,11 +1,22 @@
|
|||||||
Name: python-setuptools
|
Name: python-setuptools
|
||||||
|
# on the CI we test different version of setuptools on different Fedora versions
|
||||||
|
# don't package software like this in Fedora please
|
||||||
|
%if 0%{?fedora} >= 37 || 0%{?rhel} >= 10
|
||||||
|
Version: 62.6.0
|
||||||
|
%else
|
||||||
Version: 57.0.0
|
Version: 57.0.0
|
||||||
|
%endif
|
||||||
Release: 0%{?dist}
|
Release: 0%{?dist}
|
||||||
Summary: Easily build and distribute Python packages
|
Summary: Easily build and distribute Python packages
|
||||||
# see the real Fedora package for explanation:
|
# see the real Fedora package for explanation:
|
||||||
License: MIT and (BSD or ASL 2.0)
|
License: MIT and (BSD or ASL 2.0)
|
||||||
URL: https://pypi.python.org/pypi/setuptools
|
URL: https://pypi.python.org/pypi/setuptools
|
||||||
Source0: %{pypi_source setuptools %{version}}
|
Source: %{pypi_source setuptools %{version}}
|
||||||
|
|
||||||
|
%if 0%{?fedora} >= 37 || 0%{?rhel} >= 10
|
||||||
|
# Patch from Fedora proper
|
||||||
|
Patch: https://src.fedoraproject.org/rpms/python-setuptools/raw/ebda604314b/f/Remove-optional-or-unpackaged-test-deps.patch
|
||||||
|
%endif
|
||||||
|
|
||||||
BuildArch: noarch
|
BuildArch: noarch
|
||||||
|
|
||||||
@ -41,6 +52,7 @@ Summary: %{summary}
|
|||||||
%prep
|
%prep
|
||||||
%autosetup -p1 -n setuptools-%{version}
|
%autosetup -p1 -n setuptools-%{version}
|
||||||
|
|
||||||
|
%if 0%{?fedora} < 37 && 0%{?rhel} < 10
|
||||||
# The following test deps are optional and either not desired or not available in Fedora:
|
# The following test deps are optional and either not desired or not available in Fedora:
|
||||||
sed -Ei setup.cfg -e '/\bpytest-(checkdocs|black|cov|mypy|enabler)\b/d' \
|
sed -Ei setup.cfg -e '/\bpytest-(checkdocs|black|cov|mypy|enabler)\b/d' \
|
||||||
-e '/\bflake8\b/d' \
|
-e '/\bflake8\b/d' \
|
||||||
@ -48,6 +60,8 @@ sed -Ei setup.cfg -e '/\bpytest-(checkdocs|black|cov|mypy|enabler)\b/d' \
|
|||||||
# Strip pytest options from the above
|
# Strip pytest options from the above
|
||||||
sed -i pytest.ini -e 's/ --flake8//' \
|
sed -i pytest.ini -e 's/ --flake8//' \
|
||||||
-e 's/ --cov//'
|
-e 's/ --cov//'
|
||||||
|
%endif
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
%generate_buildrequires
|
%generate_buildrequires
|
||||||
@ -73,7 +87,11 @@ rm pyproject.toml
|
|||||||
|
|
||||||
%if %{with tests}
|
%if %{with tests}
|
||||||
# We only run a subset of tests to speed things up and be less fragile
|
# We only run a subset of tests to speed things up and be less fragile
|
||||||
PYTHONPATH=$(pwd) %pytest --ignore=pavement.py -k "sdist"
|
PRE_BUILT_SETUPTOOLS_WHEEL=%{_pyproject_wheeldir}/setuptools-%{version}-py3-none-any.whl \
|
||||||
|
PYTHONPATH=$(pwd) %pytest --ignore=pavement.py \
|
||||||
|
--ignore=setuptools/tests/test_develop.py \
|
||||||
|
--ignore=setuptools/tests/config/test_apply_pyprojecttoml.py \
|
||||||
|
-k "sdist" -n %{_smp_build_ncpus}
|
||||||
%else
|
%else
|
||||||
%pyproject_check_import
|
%pyproject_check_import
|
||||||
%endif
|
%endif
|
||||||
|
Loading…
Reference in New Issue
Block a user