-
Notifications
You must be signed in to change notification settings - Fork 695
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
community/z3: ensure that the python bindings do not depend on importlib
See Z3Prover/z3#7042 Fixes #15727
- Loading branch information
Showing
2 changed files
with
34 additions
and
1 deletion.
There are no files selected for viewing
31 changes: 31 additions & 0 deletions
31
community/z3/0001-Use-built-in-importlib.resources-on-Python-3.9-7042.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
From 9ad4d50b5d859443e3ba004bd36c560af3673a55 Mon Sep 17 00:00:00 2001 | ||
From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= <[email protected]> | ||
Date: Tue, 5 Dec 2023 16:49:32 +0100 | ||
Subject: [PATCH] Use built-in `importlib.resources` on Python 3.9+ (#7042) | ||
|
||
Use built-in `importlib.resources` module rather than the external | ||
`importlib_resources` package on Python 3.9 and newer. The latter | ||
is only intended as a backport for old Python versions, and since modern | ||
Linux distributions may no longer support such old Python versions, | ||
they also no longer provide importlib_resources (this is the case | ||
on Gentoo). | ||
--- | ||
scripts/update_api.py | 5 ++++- | ||
1 file changed, 4 insertions(+), 1 deletion(-) | ||
|
||
diff --git a/scripts/update_api.py b/scripts/update_api.py | ||
index d426da34a..7d3d8899f 100755 | ||
--- a/scripts/update_api.py | ||
+++ b/scripts/update_api.py | ||
@@ -1831,7 +1831,10 @@ import atexit | ||
import sys, os | ||
import contextlib | ||
import ctypes | ||
-import importlib_resources | ||
+if sys.version_info >= (3, 9): | ||
+ import importlib.resources as importlib_resources | ||
+else: | ||
+ import importlib_resources | ||
from .z3types import * | ||
from .z3consts import * | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,14 +2,15 @@ | |
# Maintainer: Sören Tempel <[email protected]> | ||
pkgname=z3 | ||
pkgver=4.12.3 | ||
pkgrel=0 | ||
pkgrel=1 | ||
pkgdesc="Theorem prover from Microsoft Research" | ||
url="https://github.com/Z3Prover/z3" | ||
arch="all" | ||
license="MIT" | ||
makedepends="cmake python3 samurai" | ||
subpackages="$pkgname-dev py3-$pkgname:py3:noarch" | ||
source="https://github.com/Z3Prover/z3/archive/z3-$pkgver.tar.gz | ||
0001-Use-built-in-importlib.resources-on-Python-3.9-7042.patch | ||
" | ||
builddir="$srcdir/z3-z3-$pkgver" | ||
|
||
|
@@ -45,4 +46,5 @@ py3() { | |
|
||
sha512sums=" | ||
06d667b86e2d941e8cbcafe508392f5ef9307354a97428107e26ac7ef86246a86a0096fbf92034f2a3e47efe41f95ddc74460c2c4797aadec79e14020737afcb z3-4.12.3.tar.gz | ||
70c64ea3da608753bb8ba02d5d1217775184c7d45a4f7f6cb25a1dd9c6c9badc3357b5e59ee73c9820b80170d527c7d7e91678e7759bdfcb8f90db5f8561720c 0001-Use-built-in-importlib.resources-on-Python-3.9-7042.patch | ||
" |