diff --git a/0002-Restore-setup.cfg-for-setuptools-below-61.patch b/0002-Restore-setup.cfg-for-setuptools-below-61.patch new file mode 100644 index 0000000..9d71903 --- /dev/null +++ b/0002-Restore-setup.cfg-for-setuptools-below-61.patch @@ -0,0 +1,30 @@ +--- a/setup.cfg ++++ b/setup.cfg +@@ -1,4 +1,24 @@ +-[egg_info] +-tag_build = +-tag_date = 0 ++[options] ++packages = find: + ++python_requires = >=3.7 ++ ++include_package_data = True ++install_requires = ++ pathspec >= 0.5.3 ++ pyyaml ++ setuptools ++ ++test_suite = tests ++ ++[options.packages.find] ++exclude = ++ tests ++ tests.* ++ ++[options.package_data] ++yamllint = conf/*.yaml ++ ++[options.entry_points] ++console_scripts = ++ yamllint = yamllint.cli:run diff --git a/yamllint.spec b/yamllint.spec index 7aa8c52..b49aa35 100644 --- a/yamllint.spec +++ b/yamllint.spec @@ -10,6 +10,7 @@ License: GPLv3+ URL: https://github.com/adrienverge/yamllint Source0: https://pypi.python.org/packages/source/y/%{pypi_name}/%{pypi_name}-%{version}.tar.gz Patch0: 0001-Skip-test-on-quoted_strings-failing-if-PyYAML-is-too.patch +Patch1: 0002-Restore-setup.cfg-for-setuptools-below-61.patch BuildArch: noarch Requires: python%{python3_pkgversion}-pathspec @@ -18,6 +19,8 @@ Requires: python%{python3_pkgversion}-setuptools BuildRequires: python%{python3_pkgversion}-devel BuildRequires: python%{python3_pkgversion}-setuptools +BuildRequires: python%{python3_pkgversion}-wheel +BuildRequires: python%{python3_pkgversion}-pip BuildRequires: python%{python3_pkgversion}-pathspec BuildRequires: python%{python3_pkgversion}-PyYAML @@ -28,20 +31,20 @@ yamllint does not only check for syntax validity, but for weirdnesses like key repetition and cosmetic problems such as lines length, trailing spaces, indentation, etc. -%generate_buildrequires -%pyproject_buildrequires +# Don't use generate_buildrequires/pyproject_buildrequires macros since +# setuptools ≥ 61 is not available. %prep %autosetup -n %{pypi_name}-%{version} -p1 # Remove bundled egg-info rm -rf %{pypi_name}.egg-info +# Restore old setup.py/setup.cfg usage since setuptools ≥ 61 is not available +sed -i 's/^setup()$/setup(name="yamllint", version="%{version}")/' setup.py %build %pyproject_wheel %install -# Must do the subpackages' install first because the scripts in /usr/bin are -# overwritten with every setup.py install. %pyproject_install %check @@ -58,6 +61,7 @@ rm -rf %{pypi_name}.egg-info %changelog * Fri Apr 21 2023 Adrien Vergé - 1.31.0-1 - Update to latest upstream version +- Temporarily restore setup.py/setup.cfg since setuptools ≥ 61 is not available * Fri Apr 14 2023 Adrien Vergé - 1.30.0-2 - Update 'check' step to stop using setup.py