[gentoo-commits] repo/gentoo:master commit in: dev-python/snapshottest/files/, dev-python/snapshottest/
commit: dbae7b6aecf8c3f3ccf7b0fdcc5251fa03d7711a Author: Arthur Zamarin gentoo org> AuthorDate: Fri Aug 4 15:50:43 2023 + Commit: Arthur Zamarin gentoo org> CommitDate: Fri Aug 4 15:52:50 2023 + URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=dbae7b6a dev-python/snapshottest: enable py3.12 Signed-off-by: Arthur Zamarin gentoo.org> .../files/snapshottest-0.6.0-py3.12-imp.patch | 41 ++ dev-python/snapshottest/snapshottest-0.6.0.ebuild | 5 +-- 2 files changed, 44 insertions(+), 2 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 ..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+marcellperg...@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 939e60178153..d01d038c7f3c 100644 --- a/dev-python/snapshottest/snapshottest-0.6.0.ebuild +++ b/dev-python/snapshottest/snapshottest-0.6.0.ebuild @@ -4,7 +4,7 @@ EAPI=8 DISTUTILS_USE_PEP517=setuptools -PYTHON_COMPAT=( python3_{9..11} ) +PYTHON_COMPAT=( python3_{10..12} ) inherit distutils-r1 @@ -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() {
[gentoo-commits] repo/gentoo:master commit in: dev-python/snapshottest/files/
commit: c400b5b5f554e3bb19899a948c2fcdb16915b888 Author: Michael Mair-Keimberger levelnine at> AuthorDate: Mon Jun 20 08:57:53 2022 + Commit: Andrew Ammerlaan gentoo org> CommitDate: Tue Jun 21 10:55:49 2022 + URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c400b5b5 dev-python/snapshottest: remove unused patch Package-Manager: Portage-3.0.30, Repoman-3.0.3 Signed-off-by: Michael Mair-Keimberger levelnine.at> Closes: https://github.com/gentoo/gentoo/pull/25994 Signed-off-by: Andrew Ammerlaan gentoo.org> .../files/snapshottest-0.5.1-remove-fastdiff.patch | 57 -- 1 file changed, 57 deletions(-) diff --git a/dev-python/snapshottest/files/snapshottest-0.5.1-remove-fastdiff.patch b/dev-python/snapshottest/files/snapshottest-0.5.1-remove-fastdiff.patch deleted file mode 100644 index ec12f15fe7a6.. --- a/dev-python/snapshottest/files/snapshottest-0.5.1-remove-fastdiff.patch +++ /dev/null @@ -1,57 +0,0 @@ -From 3e31b54d349eb136f0d96eb81309fdaf4ad35fcf Mon Sep 17 00:00:00 2001 -From: David Shepherd -Date: Sat, 15 Feb 2020 11:48:52 + -Subject: [PATCH] Revert "Use fastdiff for faster diffing" - -This reverts commit 56d9efdaa37c39c7f644726e0d34c89b09ff9568. - setup.py | 2 +- - snapshottest/diff.py | 9 + - 2 files changed, 6 insertions(+), 5 deletions(-) - -diff --git a/setup.py b/setup.py -index 1baefd8..690713e 100644 a/setup.py -+++ b/setup.py -@@ -23,7 +23,7 @@ - 'nose.plugins.0.10': - ['snapshottest = snapshottest.nose:SnapshotTestPlugin'] - }, --install_requires=['six>=1.10.0', 'termcolor', 'fastdiff>=0.1.4<1'], -+install_requires=['six>=1.10.0', 'termcolor'], - tests_require=tests_require, - extras_require={ - 'test': tests_require, -diff --git a/snapshottest/diff.py b/snapshottest/diff.py -index 5fddf66..83c599a 100644 a/snapshottest/diff.py -+++ b/snapshottest/diff.py -@@ -1,5 +1,5 @@ -+from difflib import Differ - from termcolor import colored --from fastdiff import compare - - from .sorted_dict import SortedDict - from .formatter import Formatter -@@ -23,6 +23,7 @@ def format_line(line): - class PrettyDiff(object): - def __init__(self, obj, snapshottest): - self.pretty = Formatter() -+self.differ = Differ() - self.snapshottest = snapshottest - if isinstance(obj, dict): - obj = SortedDict(**obj) -@@ -35,10 +36,10 @@ def __repr__(self): - return repr(self.obj) - - def get_diff(self, other): --text1 = 'Received \n\n' + self.pretty(self.obj) --text2 = 'Snapshot \n\n' + self.pretty(other) -+text1 = ['Received ', ''] + self.pretty(self.obj).splitlines(1) -+text2 = ['Snapshot ', ''] + self.pretty(other).splitlines(1) - --lines = list(compare(text2, text1)) -+lines = list(self.differ.compare(text2, text1)) - return [ - format_line(line) for line in lines - ]
[gentoo-commits] repo/gentoo:master commit in: dev-python/snapshottest/
commit: 490dbd930327f5cf4506253dd74ba7045c09b0d6 Author: Michał Górny gentoo org> AuthorDate: Thu Jun 16 08:08:52 2022 + Commit: Michał Górny gentoo org> CommitDate: Thu Jun 16 08:08:52 2022 + URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=490dbd93 dev-python/snapshottest: Remove old Signed-off-by: Michał Górny gentoo.org> dev-python/snapshottest/Manifest | 1 - dev-python/snapshottest/snapshottest-0.5.1.ebuild | 45 --- 2 files changed, 46 deletions(-) diff --git a/dev-python/snapshottest/Manifest b/dev-python/snapshottest/Manifest index 394a507020c5..8ca213e9a682 100644 --- a/dev-python/snapshottest/Manifest +++ b/dev-python/snapshottest/Manifest @@ -1,2 +1 @@ -DIST snapshottest-0.5.1.tar.gz 19312 BLAKE2B a8acfb09de9e58c7a929f71d10f3cc68d7eec31a9fa1ea0fe74ae8a574ceec315f7eab2f9e7cd326c34d981b5ede4c398b5f1352bd59c23be219eeb9a2c0e861 SHA512 1541c327c4238c816b55cf797f6104ad54ff62a2332517b3bf9a455bbee0abd49f6983a54dc7510d1e1c659d88e5f7d6c6aa396c0ece19e19957ea8cff42c673 DIST snapshottest-0.6.0.gh.tar.gz 19887 BLAKE2B d85b3025731dbe80c04388f8adf755f48f428df5f15496ad7e47d436ccfba0f8955833f576b12a38a3565a56deb49a425b67f9040bce69a7711be05558f0ef4e SHA512 7477668c0a61b4c282deb3eb9105cf06e8f644c931e2860a9a60dc2f8ed6de1eaf1ab100a816de200a39db8b488bda6ad33472265eecca707360dcbc9d8fafee diff --git a/dev-python/snapshottest/snapshottest-0.5.1.ebuild b/dev-python/snapshottest/snapshottest-0.5.1.ebuild deleted file mode 100644 index c49cc1e8330a.. --- a/dev-python/snapshottest/snapshottest-0.5.1.ebuild +++ /dev/null @@ -1,45 +0,0 @@ -# Copyright 2020-2021 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI=7 - -PYTHON_COMPAT=( python3_{7..10} ) -inherit distutils-r1 - -# no tests on pypi, no tags on github -COMMIT_HASH="4ac2b4fb09e9e7728bebb11967c164a914775d1d" - -DESCRIPTION="Snapshot Testing utils for Python" -HOMEPAGE="https://pypi.org/project/snapshottest/ - https://github.com/syrusakbary/snapshottest; -SRC_URI=" - https://github.com/syrusakbary/${PN}/archive/${COMMIT_HASH}.tar.gz - -> ${P}.tar.gz" -S="${WORKDIR}/${PN}-${COMMIT_HASH}" - -LICENSE="MIT" -SLOT="0" -KEYWORDS="~amd64 ~x86" - -RDEPEND=" - dev-python/six[${PYTHON_USEDEP}] - dev-python/termcolor[${PYTHON_USEDEP}] -" - -distutils_enable_tests pytest - -PATCHES=( - "${FILESDIR}/snapshottest-0.5.1-remove-fastdiff.patch" -) - -python_prepare_all() { - sed -e "s:'pytest-runner'(,|)::" -i setup.py || die - sed -r -e 's:--cov[[:space:]]*[[:graph:]]+::g' -i setup.cfg || die - distutils-r1_python_prepare_all -} - -python_test() { - distutils_install_for_testing - epytest tests examples/pytest - "${EPYTHON}" examples/unittest/test_demo.py || die "Tests failed with ${EPYTHON}" -}
[gentoo-commits] repo/gentoo:master commit in: dev-python/snapshottest/files/, dev-python/snapshottest/
commit: 35ab04bd6c3ae865362f230cb2c870aca2e5b6d4 Author: Michał Górny gentoo org> AuthorDate: Sun Jun 5 16:48:10 2022 + Commit: Michał Górny gentoo org> CommitDate: Sun Jun 5 16:48:57 2022 + URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=35ab04bd dev-python/snapshottest: Bump to 0.6.0 Signed-off-by: Michał Górny gentoo.org> dev-python/snapshottest/Manifest | 1 + .../files/snapshottest-0.6.0-remove-fastdiff.patch | 57 ++ dev-python/snapshottest/snapshottest-0.6.0.ebuild | 44 + 3 files changed, 102 insertions(+) diff --git a/dev-python/snapshottest/Manifest b/dev-python/snapshottest/Manifest index 8b4c61498610..394a507020c5 100644 --- a/dev-python/snapshottest/Manifest +++ b/dev-python/snapshottest/Manifest @@ -1 +1,2 @@ DIST snapshottest-0.5.1.tar.gz 19312 BLAKE2B a8acfb09de9e58c7a929f71d10f3cc68d7eec31a9fa1ea0fe74ae8a574ceec315f7eab2f9e7cd326c34d981b5ede4c398b5f1352bd59c23be219eeb9a2c0e861 SHA512 1541c327c4238c816b55cf797f6104ad54ff62a2332517b3bf9a455bbee0abd49f6983a54dc7510d1e1c659d88e5f7d6c6aa396c0ece19e19957ea8cff42c673 +DIST snapshottest-0.6.0.gh.tar.gz 19887 BLAKE2B d85b3025731dbe80c04388f8adf755f48f428df5f15496ad7e47d436ccfba0f8955833f576b12a38a3565a56deb49a425b67f9040bce69a7711be05558f0ef4e SHA512 7477668c0a61b4c282deb3eb9105cf06e8f644c931e2860a9a60dc2f8ed6de1eaf1ab100a816de200a39db8b488bda6ad33472265eecca707360dcbc9d8fafee diff --git a/dev-python/snapshottest/files/snapshottest-0.6.0-remove-fastdiff.patch b/dev-python/snapshottest/files/snapshottest-0.6.0-remove-fastdiff.patch new file mode 100644 index ..948f961aae0b --- /dev/null +++ b/dev-python/snapshottest/files/snapshottest-0.6.0-remove-fastdiff.patch @@ -0,0 +1,57 @@ +From 3e31b54d349eb136f0d96eb81309fdaf4ad35fcf Mon Sep 17 00:00:00 2001 +From: David Shepherd +Date: Sat, 15 Feb 2020 11:48:52 + +Subject: [PATCH] Revert "Use fastdiff for faster diffing" + +This reverts commit 56d9efdaa37c39c7f644726e0d34c89b09ff9568. +--- + setup.py | 2 +- + snapshottest/diff.py | 9 + + 2 files changed, 6 insertions(+), 5 deletions(-) + +diff --git a/setup.py b/setup.py +index 1baefd8..690713e 100644 +--- a/setup.py b/setup.py +@@ -23,7 +23,7 @@ + 'nose.plugins.0.10': + ['snapshottest = snapshottest.nose:SnapshotTestPlugin'] + }, +-install_requires=['six>=1.10.0', 'termcolor', 'fastdiff>=0.1.4,<1'], ++install_requires=['six>=1.10.0', 'termcolor'], + tests_require=tests_require, + extras_require={ + 'test': tests_require, +diff --git a/snapshottest/diff.py b/snapshottest/diff.py +index 5fddf66..83c599a 100644 +--- a/snapshottest/diff.py b/snapshottest/diff.py +@@ -1,5 +1,5 @@ ++from difflib import Differ + from termcolor import colored +-from fastdiff import compare + + from .sorted_dict import SortedDict + from .formatter import Formatter +@@ -23,6 +23,7 @@ def format_line(line): + class PrettyDiff(object): + def __init__(self, obj, snapshottest): + self.pretty = Formatter() ++self.differ = Differ() + self.snapshottest = snapshottest + if isinstance(obj, dict): + obj = SortedDict(**obj) +@@ -35,10 +36,10 @@ def __repr__(self): + return repr(self.obj) + + def get_diff(self, other): +-text1 = 'Received \n\n' + self.pretty(self.obj) +-text2 = 'Snapshot \n\n' + self.pretty(other) ++text1 = ['Received ', ''] + self.pretty(self.obj).splitlines(1) ++text2 = ['Snapshot ', ''] + self.pretty(other).splitlines(1) + +-lines = list(compare(text2, text1)) ++lines = list(self.differ.compare(text2, text1)) + return [ + format_line(line) for line in lines + ] diff --git a/dev-python/snapshottest/snapshottest-0.6.0.ebuild b/dev-python/snapshottest/snapshottest-0.6.0.ebuild new file mode 100644 index ..390ad2eb66f6 --- /dev/null +++ b/dev-python/snapshottest/snapshottest-0.6.0.ebuild @@ -0,0 +1,44 @@ +# Copyright 2020-2022 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +DISTUTILS_USE_PEP517=setuptools +PYTHON_COMPAT=( python3_{8..11} ) + +inherit distutils-r1 + +DESCRIPTION="Snapshot Testing utils for Python" +HOMEPAGE=" + https://github.com/syrusakbary/snapshottest/ + https://pypi.org/project/snapshottest/ +" +SRC_URI=" + https://github.com/syrusakbary/${PN}/archive/${PV}.tar.gz + -> ${P}.gh.tar.gz +" + +LICENSE="MIT" +SLOT="0" +KEYWORDS="~amd64 ~x86" + +RDEPEND=" + dev-python/six[${PYTHON_USEDEP}] + dev-python/termcolor[${PYTHON_USEDEP}] +" + +distutils_enable_tests pytest + +PATCHES=( + "${FILESDIR}/snapshottest-0.6.0-remove-fastdiff.patch" +) + +python_prepare_all() { + sed -i -e 's:--cov snapshottest::' setup.cfg || die + distutils-r1_python_prepare_all +} + +python_test() { + epytest tests
[gentoo-commits] repo/gentoo:master commit in: dev-python/snapshottest/
commit: 402c1607ca916a7b7ca5a00ce775f3304d344034 Author: Michał Górny gentoo org> AuthorDate: Sun May 23 13:10:36 2021 + Commit: Michał Górny gentoo org> CommitDate: Sun May 23 13:41:03 2021 + URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=402c1607 dev-python/snapshottest: Enable py3.9 & py3.10 Signed-off-by: Michał Górny gentoo.org> dev-python/snapshottest/snapshottest-0.5.1.ebuild | 20 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/dev-python/snapshottest/snapshottest-0.5.1.ebuild b/dev-python/snapshottest/snapshottest-0.5.1.ebuild index aec16c0b697..c49cc1e8330 100644 --- a/dev-python/snapshottest/snapshottest-0.5.1.ebuild +++ b/dev-python/snapshottest/snapshottest-0.5.1.ebuild @@ -1,10 +1,9 @@ -# Copyright 2020 Gentoo Authors +# Copyright 2020-2021 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 EAPI=7 -PYTHON_COMPAT=( python3_{7..8} ) -DISTUTILS_USE_SETUPTOOLS=bdepend +PYTHON_COMPAT=( python3_{7..10} ) inherit distutils-r1 # no tests on pypi, no tags on github @@ -13,24 +12,21 @@ COMMIT_HASH="4ac2b4fb09e9e7728bebb11967c164a914775d1d" DESCRIPTION="Snapshot Testing utils for Python" HOMEPAGE="https://pypi.org/project/snapshottest/ https://github.com/syrusakbary/snapshottest; -SRC_URI="https://github.com/syrusakbary/${PN}/archive/${COMMIT_HASH}.tar.gz -> ${P}.tar.gz" +SRC_URI=" + https://github.com/syrusakbary/${PN}/archive/${COMMIT_HASH}.tar.gz + -> ${P}.tar.gz" S="${WORKDIR}/${PN}-${COMMIT_HASH}" LICENSE="MIT" SLOT="0" KEYWORDS="~amd64 ~x86" -IUSE="test" -RESTRICT="!test? ( test )" RDEPEND=" dev-python/six[${PYTHON_USEDEP}] dev-python/termcolor[${PYTHON_USEDEP}] " -BDEPEND="${RDEPEND} - test? ( - dev-python/pytest[${PYTHON_USEDEP}] - ) -" + +distutils_enable_tests pytest PATCHES=( "${FILESDIR}/snapshottest-0.5.1-remove-fastdiff.patch" @@ -44,6 +40,6 @@ python_prepare_all() { python_test() { distutils_install_for_testing - pytest -vv tests examples/pytest || die "Tests failed with ${EPYTHON}" + epytest tests examples/pytest "${EPYTHON}" examples/unittest/test_demo.py || die "Tests failed with ${EPYTHON}" }
[gentoo-commits] repo/gentoo:master commit in: dev-python/snapshottest/
commit: 0855767c0af2f07608dccf7ba0500b50666b2aca Author: Jakov Smolic sartura hr> AuthorDate: Thu Oct 15 06:18:35 2020 + Commit: Michał Górny gentoo org> CommitDate: Fri Oct 16 18:21:23 2020 + URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=0855767c dev-python/snapshottest: correct DISTUTILS_USE_SETUPTOOLS Closes: https://bugs.gentoo.org/748885 Package-Manager: Portage-3.0.8, Repoman-3.0.1 Signed-off-by: Jakov Smolic sartura.hr> Signed-off-by: Michał Górny gentoo.org> dev-python/snapshottest/snapshottest-0.5.1.ebuild | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dev-python/snapshottest/snapshottest-0.5.1.ebuild b/dev-python/snapshottest/snapshottest-0.5.1.ebuild index f460c89932a..fce9e06a65d 100644 --- a/dev-python/snapshottest/snapshottest-0.5.1.ebuild +++ b/dev-python/snapshottest/snapshottest-0.5.1.ebuild @@ -3,8 +3,8 @@ EAPI=7 -PYTHON_COMPAT=( python3_{6,7,8} ) -DISTUTILS_USE_SETUPTOOLS=rdepend +PYTHON_COMPAT=( python3_{6..8} ) +DISTUTILS_USE_SETUPTOOLS=bdepend inherit distutils-r1 # no tests on pypi, no tags on github
[gentoo-commits] repo/gentoo:master commit in: dev-python/snapshottest/files/, dev-python/snapshottest/
commit: eff6347a4144e8b5a21dfb38702594651835e7ed Author: Patrick McLean sony com> AuthorDate: Wed May 6 23:46:28 2020 + Commit: Patrick McLean gentoo org> CommitDate: Thu May 7 00:16:24 2020 + URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=eff6347a dev-python/snapshottest: New package Copyright: Sony Interactive Entertainment Inc. Package-Manager: Portage-2.3.99, Repoman-2.3.22 Signed-off-by: Patrick McLean gentoo.org> dev-python/snapshottest/Manifest | 1 + .../files/snapshottest-0.5.1-remove-fastdiff.patch | 57 ++ dev-python/snapshottest/metadata.xml | 12 + dev-python/snapshottest/snapshottest-0.5.1.ebuild | 49 +++ 4 files changed, 119 insertions(+) diff --git a/dev-python/snapshottest/Manifest b/dev-python/snapshottest/Manifest new file mode 100644 index 000..8b4c6149861 --- /dev/null +++ b/dev-python/snapshottest/Manifest @@ -0,0 +1 @@ +DIST snapshottest-0.5.1.tar.gz 19312 BLAKE2B a8acfb09de9e58c7a929f71d10f3cc68d7eec31a9fa1ea0fe74ae8a574ceec315f7eab2f9e7cd326c34d981b5ede4c398b5f1352bd59c23be219eeb9a2c0e861 SHA512 1541c327c4238c816b55cf797f6104ad54ff62a2332517b3bf9a455bbee0abd49f6983a54dc7510d1e1c659d88e5f7d6c6aa396c0ece19e19957ea8cff42c673 diff --git a/dev-python/snapshottest/files/snapshottest-0.5.1-remove-fastdiff.patch b/dev-python/snapshottest/files/snapshottest-0.5.1-remove-fastdiff.patch new file mode 100644 index 000..ec12f15fe7a --- /dev/null +++ b/dev-python/snapshottest/files/snapshottest-0.5.1-remove-fastdiff.patch @@ -0,0 +1,57 @@ +From 3e31b54d349eb136f0d96eb81309fdaf4ad35fcf Mon Sep 17 00:00:00 2001 +From: David Shepherd +Date: Sat, 15 Feb 2020 11:48:52 + +Subject: [PATCH] Revert "Use fastdiff for faster diffing" + +This reverts commit 56d9efdaa37c39c7f644726e0d34c89b09ff9568. +--- + setup.py | 2 +- + snapshottest/diff.py | 9 + + 2 files changed, 6 insertions(+), 5 deletions(-) + +diff --git a/setup.py b/setup.py +index 1baefd8..690713e 100644 +--- a/setup.py b/setup.py +@@ -23,7 +23,7 @@ + 'nose.plugins.0.10': + ['snapshottest = snapshottest.nose:SnapshotTestPlugin'] + }, +-install_requires=['six>=1.10.0', 'termcolor', 'fastdiff>=0.1.4<1'], ++install_requires=['six>=1.10.0', 'termcolor'], + tests_require=tests_require, + extras_require={ + 'test': tests_require, +diff --git a/snapshottest/diff.py b/snapshottest/diff.py +index 5fddf66..83c599a 100644 +--- a/snapshottest/diff.py b/snapshottest/diff.py +@@ -1,5 +1,5 @@ ++from difflib import Differ + from termcolor import colored +-from fastdiff import compare + + from .sorted_dict import SortedDict + from .formatter import Formatter +@@ -23,6 +23,7 @@ def format_line(line): + class PrettyDiff(object): + def __init__(self, obj, snapshottest): + self.pretty = Formatter() ++self.differ = Differ() + self.snapshottest = snapshottest + if isinstance(obj, dict): + obj = SortedDict(**obj) +@@ -35,10 +36,10 @@ def __repr__(self): + return repr(self.obj) + + def get_diff(self, other): +-text1 = 'Received \n\n' + self.pretty(self.obj) +-text2 = 'Snapshot \n\n' + self.pretty(other) ++text1 = ['Received ', ''] + self.pretty(self.obj).splitlines(1) ++text2 = ['Snapshot ', ''] + self.pretty(other).splitlines(1) + +-lines = list(compare(text2, text1)) ++lines = list(self.differ.compare(text2, text1)) + return [ + format_line(line) for line in lines + ] diff --git a/dev-python/snapshottest/metadata.xml b/dev-python/snapshottest/metadata.xml new file mode 100644 index 000..592df77578d --- /dev/null +++ b/dev-python/snapshottest/metadata.xml @@ -0,0 +1,12 @@ + +http://www.gentoo.org/dtd/metadata.dtd;> + + +pyt...@gentoo.org +Python + + +sphinxcontrib-httpdomain +birkenfeld/sphinx-contrib + + diff --git a/dev-python/snapshottest/snapshottest-0.5.1.ebuild b/dev-python/snapshottest/snapshottest-0.5.1.ebuild new file mode 100644 index 000..f460c89932a --- /dev/null +++ b/dev-python/snapshottest/snapshottest-0.5.1.ebuild @@ -0,0 +1,49 @@ +# Copyright 2020 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +PYTHON_COMPAT=( python3_{6,7,8} ) +DISTUTILS_USE_SETUPTOOLS=rdepend +inherit distutils-r1 + +# no tests on pypi, no tags on github +COMMIT_HASH="4ac2b4fb09e9e7728bebb11967c164a914775d1d" + +DESCRIPTION="Snapshot Testing utils for Python" +HOMEPAGE="https://pypi.org/project/snapshottest/ + https://github.com/syrusakbary/snapshottest; +SRC_URI="https://github.com/syrusakbary/${PN}/archive/${COMMIT_HASH}.tar.gz -> ${P}.tar.gz" +S="${WORKDIR}/${PN}-${COMMIT_HASH}" + +LICENSE="MIT" +SLOT="0" +KEYWORDS="~amd64 ~x86" +IUSE="test" +RESTRICT="!test? ( test )" + +RDEPEND=" + dev-python/six[${PYTHON_USEDEP}] +