public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
* [rpms/python-pytest-golden] rawhide: Update to 1.0.1
@ 2026-08-23  5:43 Filipe Rosset
  0 siblings, 0 replies; only message in thread
From: Filipe Rosset @ 2026-08-23  5:43 UTC (permalink / raw)
  To: git-commits

            A new commit has been pushed.

            Repo   : rpms/python-pytest-golden
            Branch : rawhide
            Commit : 9fb937a07973a3df4313b5a53202619319ee6a03
            Author : Filipe Rosset <rosset.filipe@gmail.com>
            Date   : 2026-08-13T18:09:24-03:00
            Stats  : +9/-132 in 4 file(s)
            URL    : https://src.fedoraproject.org/rpms/python-pytest-golden/c/9fb937a07973a3df4313b5a53202619319ee6a03?branch=rawhide

            Log:
            Update to 1.0.1

Resolves: rhbz#2416623

The old version 0.2.2 was causing issues, eg:
https://github.com/oprypin/markdown-callouts/pull/24#issuecomment-5286289628

---
diff --git a/.gitignore b/.gitignore
index 62bc989..46e6986 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,2 +1,3 @@
 /pytest-golden-0.2.2.tar.gz
 /pytest-golden-0.2.2^20250215git6a7b677.tar.gz
+/pytest-golden-1.0.1.tar.gz

diff --git a/pytest-golden-drop-atomicwrites.patch b/pytest-golden-drop-atomicwrites.patch
deleted file mode 100644
index abf48a1..0000000
--- a/pytest-golden-drop-atomicwrites.patch
+++ /dev/null
@@ -1,118 +0,0 @@
-From fc511f1c7c8698f334f5cf265fd35e07088e3aaf Mon Sep 17 00:00:00 2001
-From: Ben Boeckel <mathstuf@gmail.com>
-Date: Thu, 31 Jul 2025 08:12:07 -0400
-Subject: [PATCH] atomicwrites: remove dependency
-
-The package has been abandoned. Open-code it instead.
----
- pyproject.toml          |  2 --
- pytest_golden/plugin.py | 55 ++++++++++++++++++++++++++++++++++++-----
- 2 files changed, 49 insertions(+), 8 deletions(-)
-
-diff --git a/pyproject.toml b/pyproject.toml
-index e12daa7..fe30915 100644
---- a/pyproject.toml
-+++ b/pyproject.toml
-@@ -33,7 +33,6 @@ requires-python = ">=3.9"
- dependencies = [
-     "pytest >=6.1.2",
-     "ruamel.yaml >=0.16.12, <1.0",
--    "atomicwrites >=1.4.0",
-     "testfixtures >=6.15.0",
- ]
- 
-@@ -74,7 +73,6 @@ test = [
- [tool.hatch.envs.types]
- dependencies = [
-     "mypy",
--    "types-atomicwrites",
- ]
- [tool.hatch.envs.types.scripts]
- check = "mypy {args} pytest_golden"
-diff --git a/pytest_golden/plugin.py b/pytest_golden/plugin.py
-index b693e97..77602be 100644
---- a/pytest_golden/plugin.py
-+++ b/pytest_golden/plugin.py
-@@ -4,25 +4,68 @@
- import dataclasses
- import inspect
- import logging
-+import os
- import pathlib
-+import sys
-+import tempfile
- import warnings
--from collections.abc import Collection, Sequence
--from typing import TYPE_CHECKING, Any, Callable, TypeVar
-+from collections.abc import Collection, Iterator, Sequence
-+from typing import IO, TYPE_CHECKING, Any, Callable, TypeVar
- 
--import atomicwrites
- import pytest
- 
- from . import yaml
- 
- if TYPE_CHECKING:
--    import os
--
-     from typing_extensions import Self
- 
- 
- _T = TypeVar("_T")
- 
- 
-+if sys.platform == "win32":
-+
-+    def _replace_atomic(src: os.PathLike[str], dst: os.PathLike[str]):
-+        from ctypes import WinError, windll
-+
-+        movefile_replace_existing = 0x1
-+        movefile_write_through = 0x8
-+
-+        rv = windll.kernel32.MoveFileExW(
-+            str(src),
-+            str(dst),
-+            movefile_write_through | movefile_replace_existing,
-+        )
-+        if not rv:
-+            raise WinError()
-+
-+else:
-+
-+    def _replace_atomic(src: os.PathLike[str], dst: os.PathLike[str]):
-+        os.rename(src, dst)
-+
-+
-+@contextlib.contextmanager
-+def atomic_write(dest: os.PathLike[str]) -> Iterator[IO[str]]:
-+    """Atomically write to the destination file."""
-+    dir = os.path.normpath(os.path.dirname(dest))
-+    fd, src = tempfile.mkstemp(prefix=os.path.basename(dest), dir=dir)
-+    os.close(fd)
-+    try:
-+        success = False
-+        with open(file=src, encoding="utf-8", mode="w") as file:
-+            yield file
-+            file.flush()
-+            os.fsync(file.fileno())
-+        path_src = pathlib.Path(src)
-+        _replace_atomic(path_src, dest)
-+        success = True
-+    finally:
-+        if not success:
-+            with contextlib.suppress(Exception):
-+                os.unlink(src)
-+
-+
- def pytest_addoption(parser):
-     parser.addoption(
-         "--update-goldens",
-@@ -203,7 +246,7 @@ def warn(*args):
-                 f_code.co_filename,
-                 f_code.co_firstlineno,
-             )
--        with atomicwrites.atomic_write(self.path, mode="w", encoding="utf-8", overwrite=True) as f:
-+        with atomic_write(self.path) as f:
-             yaml._rt.dump(outputs, f)
- 
-     @contextlib.contextmanager

diff --git a/python-pytest-golden.spec b/python-pytest-golden.spec
index 83fd38e..ccc57fb 100644
--- a/python-pytest-golden.spec
+++ b/python-pytest-golden.spec
@@ -1,20 +1,14 @@
-%global date            20250215
-%global commit          6a7b6776be95040d67bc6f709ab9ec8937b5be27
-%global shortcommit     %(c=%{commit}; echo ${c:0:7})
+%global forgeurl https://github.com/oprypin/pytest-golden
+Version:        1.0.1
+%forgemeta
 
 Name:           python-pytest-golden
-Version:        0.2.2^%{date}git%{shortcommit}
 Release:        %autorelease
 Summary:        Plugin for pytest that offloads expected outputs to data files
 
 License:        MIT
-URL:            https://github.com/oprypin/pytest-golden
-# PyPI tarball doesn't include tests
-#Source:         %%{url}/archive/v%%{version}/pytest-golden-%%{version}.tar.gz
-# latest release too old, will ask upstream to mergee PR =#8 and release
-Source:         %{url}/archive/%{commit}/pytest-golden-%{version}.tar.gz
-# Drop deprecated atomicwrites dependency
-Patch:          https://github.com/oprypin/pytest-golden/pull/8.patch#/pytest-golden-drop-atomicwrites.patch
+URL:            %{forgeurl}
+Source:         %{forgesource}
 
 BuildArch:      noarch
 BuildRequires:  python3-devel
@@ -32,8 +26,7 @@ Summary:        %{summary}
 %description -n python3-pytest-golden %_description
 
 %prep
-#autosetup -p1 -n pytest-golden-%%{version}
-%autosetup -p1 -n pytest-golden-%{commit}
+%forgeautosetup -p1
 
 %generate_buildrequires
 %pyproject_buildrequires
@@ -46,6 +39,7 @@ Summary:        %{summary}
 %pyproject_save_files -L pytest_golden
 
 %check
+%pyproject_check_import
 %pytest -v
 
 %files -n python3-pytest-golden -f %{pyproject_files}

diff --git a/sources b/sources
index 549e08e..fd2115b 100644
--- a/sources
+++ b/sources
@@ -1 +1 @@
-SHA512 (pytest-golden-0.2.2^20250215git6a7b677.tar.gz) = 9954f1b420351a6e86e032486bf3f71cbcaac25ab6b8f9d33cf76a6b86984e926ab79f9bb4eb81a5285878f9ad711eef7484762818a67b4399adfdde828f8a81
+SHA512 (pytest-golden-1.0.1.tar.gz) = 7f2301e8887d953ff3a692bf84680b131d7123a1f23bcde6b1b8c4a73e7a9127b00db4e0726759967b0fbba8e2fcd9508bbb8a388024bc26ac9b6de61004e2b9

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2026-08-23  5:43 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-08-23  5:43 [rpms/python-pytest-golden] rawhide: Update to 1.0.1 Filipe Rosset

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox