Commit 1d01c238 authored by vin 01's avatar vin 01 Committed by Kevin Daudt
Browse files

community/salt: remove stale patch for python3.10 compatibility

It is broken and does not really work with python3.10 as it does not use
the import as name "importlib_metadata". It is also removed from salt:
https://github.com/saltstack/salt/commit/8e008cfd1ebf124cac7ff3b8b01373827cf9f70f
parent f8fb7490
Pipeline #126043 passed with stages
in 3 minutes and 41 seconds
......@@ -4,7 +4,7 @@
# Maintainer: Kevin Daudt <kdaudt@alpinelinux.org>
pkgname=salt
pkgver=3004.2
pkgrel=0
pkgrel=1
pkgdesc="parallel remote execution system"
url="https://github.com/saltstack/salt"
arch="noarch"
......@@ -30,7 +30,6 @@ source="https://pypi.io/packages/source/s/salt/salt-$pkgver.tar.gz
salt-syndic.confd
salt-syndic.initd
fix-cryptodome-dependency.patch
fix-python3.10-importlib_metadata.patch
"
options="!check" # depends on pytestsalt
......@@ -178,5 +177,4 @@ cfbbeb8023a383e7c42d84e3346edfd068c9ec7650c4ddc3caa38534da325a67497e1f06ca02cc1f
bafc6ea10cdafd0aef868feb35aecbe4ae6a7dff0ae42862bded85715ad763eb89e1ed27437866a7e5f2b9f7064e3c2a3fb59814487744ba4227238d95cf3818 salt-syndic.confd
d71133e834685304e0167554035ebbc861252f972bbe981cc71e45b70f15d94a28a02a369463c9a641372919689f96b62a0408b14f824ad986d536e52b1e5ec0 salt-syndic.initd
7df577b4a7befc6a37644cbe3e909df29f626f9ccc84d05245c5d2b6a4daeb3ad6bb95b9b3a82de70d50ddc27d15956b016c44c8ad9f878c760d388da86cacbe fix-cryptodome-dependency.patch
7f32ac9e1fc6a85817f4a99c59b594678a691f9e533ce5dbe9f9edb53471d38f2e7b8c72a9ed0ce09d84bd413639df9e51dc6bd501f7b1622d392839ac8f46a5 fix-python3.10-importlib_metadata.patch
"
--- a/salt/_compat.py
+++ b/salt/_compat.py
@@ -11,19 +11,23 @@
else:
import salt.ext.ipaddress as ipaddress
+if sys.version_info >= (3, 10):
+ # Python 3.10 will include a fix in importlib.metadata which allows us to
+ # get the distribution of a loaded entry-point
+ import importlib.metadata # pylint: disable=no-member,no-name-in-module
+else:
+ # importlib_metadata before version 3.3.0 does not include the functionality we need.
+ try:
+ import importlib_metadata
-# importlib_metadata before version 3.3.0 does not include the functionality we need.
-try:
- import importlib_metadata
-
- importlib_metadata_version = [
- int(part)
- for part in importlib_metadata.version("importlib_metadata").split(".")
- if part.isdigit()
- ]
- if tuple(importlib_metadata_version) < (3, 3, 0):
+ importlib_metadata_version = [
+ int(part)
+ for part in importlib_metadata.version("importlib_metadata").split(".")
+ if part.isdigit()
+ ]
+ if tuple(importlib_metadata_version) < (3, 3, 0):
+ # Use the vendored importlib_metadata
+ import salt.ext.importlib_metadata as importlib_metadata
+ except ImportError:
# Use the vendored importlib_metadata
import salt.ext.importlib_metadata as importlib_metadata
-except ImportError:
- # Use the vendored importlib_metadata
- import salt.ext.importlib_metadata as importlib_metadata
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment