diff --git a/dev-python/pytest-textual-snapshot/Manifest b/dev-python/pytest-textual-snapshot/Manifest new file mode 100644 index 0000000000..3715cd71b8 --- /dev/null +++ b/dev-python/pytest-textual-snapshot/Manifest @@ -0,0 +1 @@ +DIST pytest_textual_snapshot-1.1.0.tar.gz 11391 BLAKE2B fc82f23e6e1eebd093694eba8fc419269dc88c9466dc601501ce346f4749f517d506aea977a3887f9cdf3cd60c87a845cea74eb7eb35d03607af22a8fa7890af SHA512 df667fc68b69ebe92ad669621203be0f89d0ec25c0a203b12a732cc56bd7a366f9ea24496bf9d3abceafa524cde506e7025deeb3d92f61d9e278ed56f8cf979e diff --git a/dev-python/pytest-textual-snapshot/files/pytest-textual-snapshot-1.1.0-syrupy-5-compat.patch b/dev-python/pytest-textual-snapshot/files/pytest-textual-snapshot-1.1.0-syrupy-5-compat.patch new file mode 100644 index 0000000000..52966c9590 --- /dev/null +++ b/dev-python/pytest-textual-snapshot/files/pytest-textual-snapshot-1.1.0-syrupy-5-compat.patch @@ -0,0 +1,29 @@ +diff --git a/pytest_textual_snapshot.py b/pytest_textual_snapshot.py +index 44c5fd4..902a002 100644 +--- a/pytest_textual_snapshot.py ++++ b/pytest_textual_snapshot.py +@@ -31,12 +31,12 @@ if TYPE_CHECKING: + + + class SVGImageExtension(SingleFileSnapshotExtension): +- _file_extension = "svg" ++ file_extension = "svg" + _write_mode = WriteMode.TEXT + +- def _read_snapshot_data_from_location(self, *args, **kwargs) -> Optional["SerializableData"]: ++ def read_snapshot_data_from_location(self, *args, **kwargs) -> Optional["SerializableData"]: + """Normalize SVG data right after they are loaded from persistent storage.""" +- data = super()._read_snapshot_data_from_location(*args, **kwargs) ++ data = super().read_snapshot_data_from_location(*args, **kwargs) + if data is not None: + data = normalize_svg(data) + return data +@@ -305,6 +305,8 @@ def retrieve_svg_diffs( + pass_count = 0 + + n = 0 ++ if not Path(tempdir.name).exists(): ++ return diffs, pass_count + for data_path in Path(tempdir.name).iterdir(): + ( + passed, diff --git a/dev-python/pytest-textual-snapshot/metadata.xml b/dev-python/pytest-textual-snapshot/metadata.xml new file mode 100644 index 0000000000..c50268859a --- /dev/null +++ b/dev-python/pytest-textual-snapshot/metadata.xml @@ -0,0 +1,12 @@ + + + + + falbrechtskirchinger@gmail.com + Florian Albrechtskirchinger + + + pytest-textual-snapshot + Textualize/pytest-textual-snapshot + + diff --git a/dev-python/pytest-textual-snapshot/pytest-textual-snapshot-1.1.0.ebuild b/dev-python/pytest-textual-snapshot/pytest-textual-snapshot-1.1.0.ebuild new file mode 100644 index 0000000000..d4257ab119 --- /dev/null +++ b/dev-python/pytest-textual-snapshot/pytest-textual-snapshot-1.1.0.ebuild @@ -0,0 +1,44 @@ +# Copyright 2026 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +DISTUTILS_USE_PEP517=poetry +PYTHON_COMPAT=( python3_{12..14} ) + +inherit distutils-r1 pypi + +DESCRIPTION="Snapshot testing for Textual apps" +HOMEPAGE=" + https://github.com/Textualize/pytest-textual-snapshot + https://pypi.org/project/pytest-textual-snapshot/ +" + +LICENSE="MIT" +SLOT="0" +KEYWORDS="~amd64 ~arm64" + +RDEPEND=" + >=dev-python/jinja2-3.0.0[${PYTHON_USEDEP}] + >=dev-python/pytest-8.0.0[${PYTHON_USEDEP}] + >=dev-python/rich-12.0.0[${PYTHON_USEDEP}] + >=dev-python/syrupy-5.0.0[${PYTHON_USEDEP}] + >=dev-python/textual-0.28.0[${PYTHON_USEDEP}] +" + +PATCHES=( + "${FILESDIR}/${PN}-1.1.0-syrupy-5-compat.patch" +) + +src_prepare() { + distutils-r1_src_prepare + + # Convert to proper Python package + mkdir pytest_textual_snapshot || die + + mv pytest_textual_snapshot.py pytest_textual_snapshot/__init__.py || die + mv resources pytest_textual_snapshot/ || die + + sed -i 's|"resources/\*\*/\*"|"pytest_textual_snapshot/resources/\*\*/\*"|' \ + pyproject.toml || die +}