mirror of
https://gitlab.alpinelinux.org/alpine/aports.git
synced 2025-08-05 21:37:15 +02:00
testing/py3-snapshottest: rebuild against python 3.12
This commit is contained in:
parent
fb7dabe819
commit
e44f223f7f
@ -2,7 +2,7 @@
|
||||
# Maintainer: Bart Ribbers <bribbers@disroot.org>
|
||||
pkgname=py3-snapshottest
|
||||
pkgver=0.6.0
|
||||
pkgrel=3
|
||||
pkgrel=4
|
||||
pkgdesc="Snapshot testing for pytest, unittest, Django, and Nose"
|
||||
url="https://github.com/syrusakbary/snapshottest"
|
||||
arch="noarch"
|
||||
@ -21,7 +21,9 @@ checkdepends="
|
||||
py3-six
|
||||
"
|
||||
subpackages="$pkgname-pyc"
|
||||
source="https://pypi.python.org/packages/source/s/snapshottest/snapshottest-$pkgver.tar.gz"
|
||||
source="https://pypi.python.org/packages/source/s/snapshottest/snapshottest-$pkgver.tar.gz
|
||||
importlib.patch
|
||||
"
|
||||
builddir="$srcdir/snapshottest-$pkgver"
|
||||
|
||||
build() {
|
||||
@ -38,4 +40,5 @@ package() {
|
||||
|
||||
sha512sums="
|
||||
0f39ec0b2255291d35bcc873b73b3802b427efd53b8d12ab373a76193dfe9d108534980f8081be38fadbf2392915e8e0d63547e5bf0479ea06d8d79cde4016ce snapshottest-0.6.0.tar.gz
|
||||
2ee20d34f7db1a736401d0b217576dad1b308bb69b578a17123cfeab3e363c0cfc0348e321c2f299f01324997034230c61ed3eba6145da1f726f64474d5aa39a importlib.patch
|
||||
"
|
||||
|
24
testing/py3-snapshottest/importlib.patch
Normal file
24
testing/py3-snapshottest/importlib.patch
Normal file
@ -0,0 +1,24 @@
|
||||
replace deprecated imp module
|
||||
|
||||
diff --git a/snapshottest/module.py b/snapshottest/module.py
|
||||
index 2f02c83..b0959ed 100644
|
||||
--- a/snapshottest/module.py
|
||||
+++ b/snapshottest/module.py
|
||||
@@ -1,7 +1,7 @@
|
||||
import codecs
|
||||
import errno
|
||||
import os
|
||||
-import imp
|
||||
+from importlib.machinery import SourceFileLoader
|
||||
from collections import defaultdict
|
||||
import logging
|
||||
|
||||
@@ -29,7 +29,7 @@ class SnapshotModule(object):
|
||||
|
||||
def load_snapshots(self):
|
||||
try:
|
||||
- source = imp.load_source(self.module, self.filepath)
|
||||
+ source = SourceFileLoader(self.module, self.filepath).load_module()
|
||||
# except FileNotFoundError: # Python 3
|
||||
except (IOError, OSError) as err:
|
||||
if err.errno == errno.ENOENT:
|
Loading…
Reference in New Issue
Block a user