From 1056cd1a5f5352c29988d8e3a68aba58b9b7eab3 Mon Sep 17 00:00:00 2001 From: Tomáš Hrnčiar Date: May 04 2022 11:52:08 +0000 Subject: Add workaround so pep517 builds with Python 3.11 --- diff --git a/0001-python-3.11-workaround.patch b/0001-python-3.11-workaround.patch new file mode 100644 index 0000000..981def5 --- /dev/null +++ b/0001-python-3.11-workaround.patch @@ -0,0 +1,27 @@ +From d7e412d81677f67b587d5d49bc85550133f9b54b Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Hrn=C4=8Diar?= +Date: Fri, 25 Mar 2022 11:01:44 +0100 +Subject: [PATCH] python 3.11 workaround + +--- + pep517/in_process/__init__.py | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/pep517/in_process/__init__.py b/pep517/in_process/__init__.py +index c932313..573fb17 100644 +--- a/pep517/in_process/__init__.py ++++ b/pep517/in_process/__init__.py +@@ -7,6 +7,10 @@ from os.path import dirname, abspath, join as pjoin + from contextlib import contextmanager + + try: ++ # importlib.resources isn't ready in Python 3.11 ++ # https://github.com/pypa/pep517/issues/140 ++ raise ImportError ++ + import importlib.resources as resources + + def _in_proc_script_path(): +-- +2.33.1 + diff --git a/python-pep517.spec b/python-pep517.spec index a05f7d6..12f1edf 100644 --- a/python-pep517.spec +++ b/python-pep517.spec @@ -11,6 +11,8 @@ Summary: Wrappers to build Python packages using PEP 517 hooks License: MIT and ASL 2.0 URL: https://github.com/takluyver/pep517 Source0: %{pypi_source} +Patch1: 0001-python-3.11-workaround.patch + BuildArch: noarch BuildRequires: python3-devel @@ -35,7 +37,7 @@ for systems which build Python packages, specified in PEP 517. %prep -%autosetup -n %{pypi_name}-%{version} +%autosetup -p1 -n %{pypi_name}-%{version} # Don't run the linter as part of tests sed -i '/--flake8$/d' pytest.ini