Remove support for Python 3.7 from %pyproject_buildrequires
Fedora 31 is EOL and was the last one with Python 3.7 packages. EL 8 has Python 3.6 but doesn'T have %generate_buildrequires.
This commit is contained in:
parent
59d092e9dd
commit
390b9713aa
@ -85,10 +85,6 @@ fi
|
|||||||
echo 'python%{python3_pkgversion}-devel'
|
echo 'python%{python3_pkgversion}-devel'
|
||||||
echo 'python%{python3_pkgversion}dist(pip) >= 19'
|
echo 'python%{python3_pkgversion}dist(pip) >= 19'
|
||||||
echo 'python%{python3_pkgversion}dist(packaging)'
|
echo 'python%{python3_pkgversion}dist(packaging)'
|
||||||
# The first part is for cases when %%{python3_version_nodots} is not yet available
|
|
||||||
if [ ! -z "%{?python3_version_nodots}" ] && [ %{python3_version_nodots} -lt 38 ]; then
|
|
||||||
echo 'python%{python3_pkgversion}dist(importlib-metadata)'
|
|
||||||
fi
|
|
||||||
# Check if we can generate dependencies on Python extras
|
# Check if we can generate dependencies on Python extras
|
||||||
if [ "%{py_dist_name []}" == "[]" ]; then
|
if [ "%{py_dist_name []}" == "[]" ]; then
|
||||||
extras_flag=%{?!_python_no_extras_requires:--generate-extras}
|
extras_flag=%{?!_python_no_extras_requires:--generate-extras}
|
||||||
|
@ -6,7 +6,7 @@ License: MIT
|
|||||||
|
|
||||||
# Keep the version at zero and increment only release
|
# Keep the version at zero and increment only release
|
||||||
Version: 0
|
Version: 0
|
||||||
Release: 36%{?dist}
|
Release: 37%{?dist}
|
||||||
|
|
||||||
# Macro files
|
# Macro files
|
||||||
Source001: macros.pyproject
|
Source001: macros.pyproject
|
||||||
@ -39,11 +39,6 @@ BuildArch: noarch
|
|||||||
BuildRequires: python3dist(pytest)
|
BuildRequires: python3dist(pytest)
|
||||||
BuildRequires: python3dist(pyyaml)
|
BuildRequires: python3dist(pyyaml)
|
||||||
BuildRequires: python3dist(packaging)
|
BuildRequires: python3dist(packaging)
|
||||||
%if 0%{fedora} < 32
|
|
||||||
# The %%if should not be needed, it works around:
|
|
||||||
# https://github.com/rpm-software-management/mock/issues/336
|
|
||||||
BuildRequires: (python3dist(importlib-metadata) if python3 < 3.8)
|
|
||||||
%endif
|
|
||||||
BuildRequires: python3dist(pip)
|
BuildRequires: python3dist(pip)
|
||||||
BuildRequires: python3dist(setuptools)
|
BuildRequires: python3dist(setuptools)
|
||||||
BuildRequires: python3dist(toml)
|
BuildRequires: python3dist(toml)
|
||||||
@ -109,6 +104,9 @@ export HOSTNAME="rpmbuild" # to speedup tox in network-less mock, see rhbz#1856
|
|||||||
%license LICENSE
|
%license LICENSE
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Tue Feb 02 2021 Miro Hrončok <mhroncok@redhat.com> - 0-37
|
||||||
|
- Remove support for Python 3.7 from %%pyproject_buildrequires
|
||||||
|
|
||||||
* Wed Jan 27 2021 Fedora Release Engineering <releng@fedoraproject.org> - 0-36
|
* Wed Jan 27 2021 Fedora Release Engineering <releng@fedoraproject.org> - 0-36
|
||||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
|
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import os
|
import os
|
||||||
import sys
|
import sys
|
||||||
import importlib
|
import importlib.metadata
|
||||||
import argparse
|
import argparse
|
||||||
import functools
|
import functools
|
||||||
import traceback
|
import traceback
|
||||||
@ -25,10 +25,6 @@ class EndPass(Exception):
|
|||||||
try:
|
try:
|
||||||
from packaging.requirements import Requirement, InvalidRequirement
|
from packaging.requirements import Requirement, InvalidRequirement
|
||||||
from packaging.utils import canonicalize_name, canonicalize_version
|
from packaging.utils import canonicalize_name, canonicalize_version
|
||||||
try:
|
|
||||||
import importlib.metadata as importlib_metadata
|
|
||||||
except ImportError:
|
|
||||||
import importlib_metadata
|
|
||||||
except ImportError as e:
|
except ImportError as e:
|
||||||
print_err('Import error:', e)
|
print_err('Import error:', e)
|
||||||
# already echoed by the %pyproject_buildrequires macro
|
# already echoed by the %pyproject_buildrequires macro
|
||||||
@ -100,7 +96,7 @@ class Requirements:
|
|||||||
try:
|
try:
|
||||||
# TODO: check if requirements with extras are satisfied
|
# TODO: check if requirements with extras are satisfied
|
||||||
installed = self.get_installed_version(requirement.name)
|
installed = self.get_installed_version(requirement.name)
|
||||||
except importlib_metadata.PackageNotFoundError:
|
except importlib.metadata.PackageNotFoundError:
|
||||||
print_err(f'Requirement not satisfied: {requirement_str}')
|
print_err(f'Requirement not satisfied: {requirement_str}')
|
||||||
installed = None
|
installed = None
|
||||||
if installed and installed in requirement.specifier:
|
if installed and installed in requirement.specifier:
|
||||||
@ -282,7 +278,7 @@ def python3dist(name, op=None, version=None, python3_pkgversion="3"):
|
|||||||
|
|
||||||
def generate_requires(
|
def generate_requires(
|
||||||
*, include_runtime=False, toxenv=None, extras=None,
|
*, include_runtime=False, toxenv=None, extras=None,
|
||||||
get_installed_version=importlib_metadata.version, # for dep injection
|
get_installed_version=importlib.metadata.version, # for dep injection
|
||||||
generate_extras=False, python3_pkgversion="3",
|
generate_extras=False, python3_pkgversion="3",
|
||||||
):
|
):
|
||||||
"""Generate the BuildRequires for the project in the current directory
|
"""Generate the BuildRequires for the project in the current directory
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
import importlib.metadata
|
||||||
import io
|
import io
|
||||||
|
|
||||||
import pytest
|
import pytest
|
||||||
@ -6,10 +7,6 @@ import yaml
|
|||||||
|
|
||||||
from pyproject_buildrequires import generate_requires
|
from pyproject_buildrequires import generate_requires
|
||||||
|
|
||||||
try:
|
|
||||||
import importlib.metadata as importlib_metadata
|
|
||||||
except ImportError:
|
|
||||||
import importlib_metadata
|
|
||||||
|
|
||||||
testcases = {}
|
testcases = {}
|
||||||
with Path(__file__).parent.joinpath('pyproject_buildrequires_testcases.yaml').open() as f:
|
with Path(__file__).parent.joinpath('pyproject_buildrequires_testcases.yaml').open() as f:
|
||||||
@ -35,7 +32,7 @@ def test_data(case_name, capsys, tmp_path, monkeypatch):
|
|||||||
try:
|
try:
|
||||||
return str(case['installed'][dist_name])
|
return str(case['installed'][dist_name])
|
||||||
except (KeyError, TypeError):
|
except (KeyError, TypeError):
|
||||||
raise importlib_metadata.PackageNotFoundError(
|
raise importlib.metadata.PackageNotFoundError(
|
||||||
f'info not found for {dist_name}'
|
f'info not found for {dist_name}'
|
||||||
)
|
)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user