diff options
| author | Liguros - Gitlab CI/CD [develop] <gitlab@liguros.net> | 2023-08-04 18:22:13 +0000 |
|---|---|---|
| committer | Liguros - Gitlab CI/CD [develop] <gitlab@liguros.net> | 2023-08-04 18:22:13 +0000 |
| commit | 679fb44b8ec4cbe27030d595277d78ba29edf652 (patch) | |
| tree | 88f33e977eb83f607b58197d055c182d9335cdbf /dev-python/snapshottest | |
| parent | a39a991f78d548ae699c3b78adf355521834ff64 (diff) | |
| download | baldeagleos-repo-679fb44b8ec4cbe27030d595277d78ba29edf652.tar.gz baldeagleos-repo-679fb44b8ec4cbe27030d595277d78ba29edf652.tar.xz baldeagleos-repo-679fb44b8ec4cbe27030d595277d78ba29edf652.zip | |
Adding metadata
Diffstat (limited to 'dev-python/snapshottest')
| -rw-r--r-- | dev-python/snapshottest/files/snapshottest-0.6.0-py3.12-imp.patch | 41 | ||||
| -rw-r--r-- | dev-python/snapshottest/snapshottest-0.6.0.ebuild | 3 |
2 files changed, 43 insertions, 1 deletions
diff --git a/dev-python/snapshottest/files/snapshottest-0.6.0-py3.12-imp.patch b/dev-python/snapshottest/files/snapshottest-0.6.0-py3.12-imp.patch new file mode 100644 index 000000000000..64c1bf69bfe8 --- /dev/null +++ b/dev-python/snapshottest/files/snapshottest-0.6.0-py3.12-imp.patch @@ -0,0 +1,41 @@ +https://github.com/syrusakbary/snapshottest/pull/168 +From: MarcellPerger1 <102254594+MarcellPerger1@users.noreply.github.com> +Date: Tue, 18 Jul 2023 19:28:22 +0100 +Subject: [PATCH] Use importlib instead of imp + +--- a/snapshottest/module.py ++++ b/snapshottest/module.py +@@ -1,7 +1,8 @@ + import codecs + import errno + import os +-import imp ++import sys ++import importlib.util + from collections import defaultdict + import logging + +@@ -17,6 +18,14 @@ def _escape_quotes(text): + return text.replace("'", "\\'") + + ++def _load_source(module_name, filepath): ++ spec = importlib.util.spec_from_file_location(module_name, filepath) ++ module = importlib.util.module_from_spec(spec) ++ sys.modules[module_name] = module ++ spec.loader.exec_module(module) ++ return module ++ ++ + class SnapshotModule(object): + _snapshot_modules = {} + +@@ -33,7 +42,7 @@ def __init__(self, module, filepath): + + def load_snapshots(self): + try: +- source = imp.load_source(self.module, self.filepath) ++ source = _load_source(self.module, self.filepath) + # except FileNotFoundError: # Python 3 + except (IOError, OSError) as err: + if err.errno == errno.ENOENT: diff --git a/dev-python/snapshottest/snapshottest-0.6.0.ebuild b/dev-python/snapshottest/snapshottest-0.6.0.ebuild index 8612c0e9c10f..388b559bade5 100644 --- a/dev-python/snapshottest/snapshottest-0.6.0.ebuild +++ b/dev-python/snapshottest/snapshottest-0.6.0.ebuild @@ -30,7 +30,8 @@ RDEPEND=" distutils_enable_tests pytest PATCHES=( - "${FILESDIR}/snapshottest-0.6.0-remove-fastdiff.patch" + "${FILESDIR}/${PN}-0.6.0-remove-fastdiff.patch" + "${FILESDIR}/${PN}-0.6.0-py3.12-imp.patch" ) python_prepare_all() { |
