From abca5b9c2dcad2d8486dad8bb5579785a078ada8a431b98f557d84c33b19e962 Mon Sep 17 00:00:00 2001 From: Dirk Mueller Date: Mon, 28 Apr 2025 16:51:46 +0000 Subject: [PATCH] - update to 0.0.17: * Improve logic for finding print statements * Ensure `print_callback` runs before formatting print args - update to 0.0.16: * add `include_print` config function OBS-URL: https://build.opensuse.org/package/show/devel:languages:python:pytest/python-pytest-examples?expand=0&rev=19 --- .gitattributes | 23 +++++++++++ .gitignore | 1 + newline.patch | 28 +++++++++++++ pytest_examples-0.0.12.tar.gz | 3 ++ pytest_examples-0.0.13.tar.gz | 3 ++ pytest_examples-0.0.15.tar.gz | 3 ++ pytest_examples-0.0.17.tar.gz | 3 ++ python-pytest-examples.changes | 75 ++++++++++++++++++++++++++++++++++ python-pytest-examples.spec | 70 +++++++++++++++++++++++++++++++ 9 files changed, 209 insertions(+) create mode 100644 .gitattributes create mode 100644 .gitignore create mode 100644 newline.patch create mode 100644 pytest_examples-0.0.12.tar.gz create mode 100644 pytest_examples-0.0.13.tar.gz create mode 100644 pytest_examples-0.0.15.tar.gz create mode 100644 pytest_examples-0.0.17.tar.gz create mode 100644 python-pytest-examples.changes create mode 100644 python-pytest-examples.spec diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..9b03811 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,23 @@ +## Default LFS +*.7z filter=lfs diff=lfs merge=lfs -text +*.bsp filter=lfs diff=lfs merge=lfs -text +*.bz2 filter=lfs diff=lfs merge=lfs -text +*.gem filter=lfs diff=lfs merge=lfs -text +*.gz filter=lfs diff=lfs merge=lfs -text +*.jar filter=lfs diff=lfs merge=lfs -text +*.lz filter=lfs diff=lfs merge=lfs -text +*.lzma filter=lfs diff=lfs merge=lfs -text +*.obscpio filter=lfs diff=lfs merge=lfs -text +*.oxt filter=lfs diff=lfs merge=lfs -text +*.pdf filter=lfs diff=lfs merge=lfs -text +*.png filter=lfs diff=lfs merge=lfs -text +*.rpm filter=lfs diff=lfs merge=lfs -text +*.tbz filter=lfs diff=lfs merge=lfs -text +*.tbz2 filter=lfs diff=lfs merge=lfs -text +*.tgz filter=lfs diff=lfs merge=lfs -text +*.ttf filter=lfs diff=lfs merge=lfs -text +*.txz filter=lfs diff=lfs merge=lfs -text +*.whl filter=lfs diff=lfs merge=lfs -text +*.xz filter=lfs diff=lfs merge=lfs -text +*.zip filter=lfs diff=lfs merge=lfs -text +*.zst filter=lfs diff=lfs merge=lfs -text diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..57affb6 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.osc diff --git a/newline.patch b/newline.patch new file mode 100644 index 0000000..8c2ec0b --- /dev/null +++ b/newline.patch @@ -0,0 +1,28 @@ +Index: pytest_examples-0.0.15/tests/test_run_examples.py +=================================================================== +--- pytest_examples-0.0.15.orig/tests/test_run_examples.py ++++ pytest_examples-0.0.15/tests/test_run_examples.py +@@ -171,6 +171,7 @@ def test_find_run_examples(example: Code + '@@ -4 +4 @@', + '-x =[1,2, 3]', + '+x = [1, 2, 3]', ++ '', + ] + + +@@ -205,6 +206,7 @@ def test_find_run_examples(example: Code + '@@ -4 +4 @@', + '-x·=[1,2,·3]', + '+x·=·[1,·2,·3]', ++ '', + ] + + +@@ -251,6 +253,7 @@ def test_find_run_examples(example: Code + '- 3', + '-]', + '+x = [1, 2, 3]', ++ '', + ] + + diff --git a/pytest_examples-0.0.12.tar.gz b/pytest_examples-0.0.12.tar.gz new file mode 100644 index 0000000..4eed509 --- /dev/null +++ b/pytest_examples-0.0.12.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:58da3a1d4d6b5efedbb1c0e4fc94472e44c6bb3e1e199822728d778d809c8ff7 +size 20429 diff --git a/pytest_examples-0.0.13.tar.gz b/pytest_examples-0.0.13.tar.gz new file mode 100644 index 0000000..8a16624 --- /dev/null +++ b/pytest_examples-0.0.13.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4d6fd78154953e84444f58f193eb6cc8d853bca7f0ee9f44ea75db043a2c19b5 +size 20445 diff --git a/pytest_examples-0.0.15.tar.gz b/pytest_examples-0.0.15.tar.gz new file mode 100644 index 0000000..477cefc --- /dev/null +++ b/pytest_examples-0.0.15.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2d6ced2d1f0d59863f81a4d2f193737464b8004a7670907c3bedef6306a5d660 +size 20771 diff --git a/pytest_examples-0.0.17.tar.gz b/pytest_examples-0.0.17.tar.gz new file mode 100644 index 0000000..0252206 --- /dev/null +++ b/pytest_examples-0.0.17.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3f02460c10de36646dab45825659fa4735441863af8c86388c22eb6113d038d8 +size 21211 diff --git a/python-pytest-examples.changes b/python-pytest-examples.changes new file mode 100644 index 0000000..3270e8a --- /dev/null +++ b/python-pytest-examples.changes @@ -0,0 +1,75 @@ +------------------------------------------------------------------- +Mon Apr 28 16:51:32 UTC 2025 - Dirk Müller + +- update to 0.0.17: + * Improve logic for finding print statements + * Ensure `print_callback` runs before formatting print args +- update to 0.0.16: + * add `include_print` config function + +------------------------------------------------------------------- +Fri Jan 17 16:49:17 UTC 2025 - Markéta Machová + +- update to 0.0.15 + * Adopt uv + * support for calling a function/coroutine + * Fix for single line docstrings + * Typechecking + * Allow matching prefix with curly braces +- add newline.patch to adapt tests to pytest 8.3.4 + +------------------------------------------------------------------- +Sun Aug 18 16:50:49 UTC 2024 - Dirk Müller + +- update to 0.0.13: + * Add new module to `sys.modules` so that namespace ops are + sound + +------------------------------------------------------------------- +Wed Jul 3 16:13:14 UTC 2024 - Dirk Müller + +- update to 0.0.12: + * Pin `ruff` version and prep for v0.0.12 release +- update to 0.0.11: + * Use `tb_lineno` to point to correct line in traceback + * Fix deprecation warnings in Python 3.12 + * Include tests in sdist + * `ruff` now requires the `check` specification + +- drop ruff05.patch, fix-traceback.patch, + support-python-312.patch, test-ruff-0.1.0.patch: upstream + +------------------------------------------------------------------- +Mon Jul 1 18:03:28 UTC 2024 - Dirk Müller + +- add ruff05.patch: fix exception with ruff 0.5.0 + +------------------------------------------------------------------- +Sat Mar 9 13:16:58 UTC 2024 - ecsos + +- Add %{?sle15_python_module_pythons} + +------------------------------------------------------------------- +Thu Mar 7 01:15:34 UTC 2024 - Steve Kowalik + +- Drop patch suppot-python-312.patch. +- Add patch support-python-312.patch, which is a rename of the previous + patch. +- Add patch fix-traceback.patch, support traceback changes of + Python 3.12. + +------------------------------------------------------------------- +Wed Jan 24 06:44:56 UTC 2024 - Steve Kowalik + +- Add patch suppot-python-312.patch: + * Support code changes in Python 3.12+. + +------------------------------------------------------------------- +Thu Oct 19 16:35:18 UTC 2023 - Ondřej Súkup + +- add test-ruff-0.1.0.patch to fix tests with ruvv-0.1.0 + +------------------------------------------------------------------- +Mon Oct 16 13:59:40 UTC 2023 - Ondřej Súkup + +- initial package diff --git a/python-pytest-examples.spec b/python-pytest-examples.spec new file mode 100644 index 0000000..7e74b39 --- /dev/null +++ b/python-pytest-examples.spec @@ -0,0 +1,70 @@ +# +# spec file for package python-pytest-examples +# +# Copyright (c) 2025 SUSE LLC +# +# All modifications and additions to the file contributed by third parties +# remain the property of their copyright owners, unless otherwise agreed +# upon. The license for this file, and modifications and additions to the +# file, is the same license as for the pristine package itself (unless the +# license for the pristine package is not an Open Source License, in which +# case the license is the MIT License). An "Open Source License" is a +# license that conforms to the Open Source Definition (Version 1.9) +# published by the Open Source Initiative. + +# Please submit bugfixes or comments via https://bugs.opensuse.org/ +# + + +%{?sle15_python_module_pythons} +Name: python-pytest-examples +Version: 0.0.17 +Release: 0 +Summary: Pytest plugin for testing examples in docstrings and markdown files +License: MIT +URL: https://github.com/pydantic/pytest-examples +# sdist without tests +Source: https://files.pythonhosted.org/packages/source/p/pytest-examples/pytest_examples-%{version}.tar.gz +# PATCH-FIX-UPSTREAM https://github.com/pydantic/pytest-examples/pull/54 adapt tests to pytest 8.3.4 +Patch: newline.patch +BuildRequires: %{python_module black} +BuildRequires: %{python_module hatchling} +BuildRequires: %{python_module pip} +BuildRequires: %{python_module pytest} +BuildRequires: %{python_module ruff} +BuildRequires: fdupes +BuildRequires: python-rpm-macros +Requires: python-black +Requires: python-pytest +Requires: python-ruff +BuildArch: noarch +%python_subpackages + +%description +Pytest plugin for testing Python code examples in docstrings and markdown files. + +`pytest-examples` can: +* lint code examples using `ruff` and `black` +* run code examples +* run code examples and check print statements are inlined correctly in the code + +It can also update code examples in place to format them and insert or update print statements. + +%prep +%autosetup -p1 -n pytest_examples-%{version} + +%build +%pyproject_wheel + +%install +%pyproject_install +%python_expand %fdupes %{buildroot}%{$python_sitelib} + +%check +%pytest + +%files %{python_files} +%{python_sitelib}/pytest_examples +%{python_sitelib}/pytest_examples-%{version}.dist-info + +%changelog