aports/testing/py3-bson/replace-pkgutil.patch
mio 23a7caf313 testing/py3-bson: rebuild against python 3.14, run tests
Replace removed `pkgutil` to fix `module 'pkgutil' has no attribute
'find_loader'` error.

Remove dependency on the deprecated `six` library.

Update `unittest.assertEquals` function calls.

Switch source url to GitHub repo and run tests.

Ref: https://gitlab.alpinelinux.org/alpine/aports/-/issues/18025
2026-04-03 03:52:29 +00:00

38 lines
1.1 KiB
Diff

Patch-Source: https://github.com/py-bson/bson/commit/4e6b4c206f7204034ef74bff8ae84a95d76d1684
---
From 4e6b4c206f7204034ef74bff8ae84a95d76d1684 Mon Sep 17 00:00:00 2001
From: Evgeny Chernyavskiy <evgeny.chernyavskiy@gmail.com>
Date: Thu, 27 Nov 2025 17:19:29 +0700
Subject: [PATCH] Replace deprecated `pkgutil` with `importlib`. Add Python
3.14 to the test matrix. (#140)
---
.github/workflows/main.yml | 2 +-
setup.py | 18 ++++++++----------
2 files changed, 9 insertions(+), 11 deletions(-)
diff --git a/setup.py b/setup.py
index 74d5002..0921062 100755
--- a/setup.py
+++ b/setup.py
@@ -4,7 +4,7 @@
# Copyright (c) 2015, Ayun Park. All rights reserved.
# For licensing, see LICENSE file included in the package.
import sys
-import pkgutil
+import importlib.util
from setuptools import setup
from setuptools.command.install import install
@@ -13,9 +13,7 @@ class NewInstall(install):
@staticmethod
def check_pymongo():
- if pkgutil.find_loader('pymongo'):
- return True
- return False
+ return importlib.util.find_spec('pymongo')
def run(self):
install.run(self)