From 843c5bab311b36af94cf73d3f41f154ee942e100282634cc84b6abe883d80602 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adrian=20Schr=C3=B6ter?= Date: Mon, 30 Jun 2025 17:50:53 +0200 Subject: [PATCH] Sync from SUSE:SLFO:Main python-pytest-run-parallel revision e502820fb0112e08b6804ca686a5bb34 --- .gitattributes | 23 +++++ i586.patch | 133 +++++++++++++++++++++++++++++ pytest_run_parallel-0.4.2.tar.gz | 3 + python-pytest-run-parallel.changes | 14 +++ python-pytest-run-parallel.spec | 63 ++++++++++++++ 5 files changed, 236 insertions(+) create mode 100644 .gitattributes create mode 100644 i586.patch create mode 100644 pytest_run_parallel-0.4.2.tar.gz create mode 100644 python-pytest-run-parallel.changes create mode 100644 python-pytest-run-parallel.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/i586.patch b/i586.patch new file mode 100644 index 0000000..7c7a115 --- /dev/null +++ b/i586.patch @@ -0,0 +1,133 @@ +From 1d51e5706a9983c99761c7a65e6d79cfb9bf7462 Mon Sep 17 00:00:00 2001 +From: Nathan Goldbaum +Date: Thu, 24 Apr 2025 08:42:02 -0600 +Subject: [PATCH 1/2] attempt to fix 32 bit architectures + +--- + src/pytest_run_parallel/plugin.py | 79 ++++++++++++++++--------------- + 1 file changed, 41 insertions(+), 38 deletions(-) + +diff --git a/src/pytest_run_parallel/plugin.py b/src/pytest_run_parallel/plugin.py +index 42d3d03..dc419b1 100644 +--- a/src/pytest_run_parallel/plugin.py ++++ b/src/pytest_run_parallel/plugin.py +@@ -65,52 +65,55 @@ def pytest_configure(config): + + + def wrap_function_parallel(fn, n_workers, n_iterations): +- barrier = threading.Barrier(n_workers) +- original_switch = sys.getswitchinterval() +- sys.setswitchinterval(0.000001) +- + @functools.wraps(fn) + def inner(*args, **kwargs): + errors = [] + skip = None + failed = None +- +- def closure(*args, **kwargs): +- for _ in range(n_iterations): +- barrier.wait() +- try: +- fn(*args, **kwargs) +- except Warning: +- pass +- except Exception as e: +- errors.append(e) +- except _pytest.outcomes.Skipped as s: +- nonlocal skip +- skip = s.msg +- except _pytest.outcomes.Failed as f: +- nonlocal failed +- failed = f +- +- workers = [] +- for _ in range(0, n_workers): +- worker_kwargs = kwargs +- workers.append( +- threading.Thread(target=closure, args=args, kwargs=worker_kwargs) +- ) +- +- num_completed = 0 ++ barrier = threading.Barrier(n_workers) ++ original_switch = sys.getswitchinterval() + try: +- for worker in workers: +- worker.start() +- num_completed += 1 +- finally: +- if num_completed < len(workers): +- barrier.abort() ++ sys.setswitchinterval(0.000001) ++ ++ def closure(*args, **kwargs): ++ for _ in range(n_iterations): ++ barrier.wait() ++ try: ++ fn(*args, **kwargs) ++ except Warning: ++ pass ++ except Exception as e: ++ errors.append(e) ++ except _pytest.outcomes.Skipped as s: ++ nonlocal skip ++ skip = s.msg ++ except _pytest.outcomes.Failed as f: ++ nonlocal failed ++ failed = f ++ ++ workers = [] ++ for _ in range(0, n_workers): ++ worker_kwargs = kwargs ++ workers.append( ++ threading.Thread( ++ target=closure, args=args, kwargs=worker_kwargs ++ ) ++ ) ++ ++ num_completed = 0 ++ try: ++ for worker in workers: ++ worker.start() ++ num_completed += 1 ++ finally: ++ if num_completed < len(workers): ++ barrier.abort() + +- for worker in workers: +- worker.join() ++ for worker in workers: ++ worker.join() + +- sys.setswitchinterval(original_switch) ++ finally: ++ sys.setswitchinterval(original_switch) + + if skip is not None: + pytest.skip(skip) + +From feed20573c21c15178793186beffe984b60ec17f Mon Sep 17 00:00:00 2001 +From: "pre-commit-ci-lite[bot]" + <117423508+pre-commit-ci-lite[bot]@users.noreply.github.com> +Date: Thu, 24 Apr 2025 14:47:11 +0000 +Subject: [PATCH 2/2] [pre-commit.ci lite] apply automatic fixes + +--- + src/pytest_run_parallel/plugin.py | 4 +--- + 1 file changed, 1 insertion(+), 3 deletions(-) + +diff --git a/src/pytest_run_parallel/plugin.py b/src/pytest_run_parallel/plugin.py +index dc419b1..5548cba 100644 +--- a/src/pytest_run_parallel/plugin.py ++++ b/src/pytest_run_parallel/plugin.py +@@ -95,9 +95,7 @@ def closure(*args, **kwargs): + for _ in range(0, n_workers): + worker_kwargs = kwargs + workers.append( +- threading.Thread( +- target=closure, args=args, kwargs=worker_kwargs +- ) ++ threading.Thread(target=closure, args=args, kwargs=worker_kwargs) + ) + + num_completed = 0 diff --git a/pytest_run_parallel-0.4.2.tar.gz b/pytest_run_parallel-0.4.2.tar.gz new file mode 100644 index 0000000..ef5f890 --- /dev/null +++ b/pytest_run_parallel-0.4.2.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e6e97cbbf5cdc754d37cdd35acf53e3174a748db070c8367ca526963c14fdb05 +size 48756 diff --git a/python-pytest-run-parallel.changes b/python-pytest-run-parallel.changes new file mode 100644 index 0000000..98d12fb --- /dev/null +++ b/python-pytest-run-parallel.changes @@ -0,0 +1,14 @@ +------------------------------------------------------------------- +Thu Apr 24 11:10:29 UTC 2025 - Markéta Machová + +- update to 0.4.2 + * Upgrade gh-action-pypi-publish to fix metadata error + * Remove deprecated argument in pytest_report_collectionfinish + * Report manually marked single-threaded tests + * Detect unsafe calls that occur under assigments +- Add i586.patch to fix behaviour on 32 bit + +------------------------------------------------------------------- +Tue Apr 22 12:12:29 UTC 2025 - Markéta Machová + +- Initial packaging (v0.4.0), needed by pydantic diff --git a/python-pytest-run-parallel.spec b/python-pytest-run-parallel.spec new file mode 100644 index 0000000..c33b94d --- /dev/null +++ b/python-pytest-run-parallel.spec @@ -0,0 +1,63 @@ +# +# spec file for package python-pytest-run-parallel +# +# 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/ +# + + +Name: python-pytest-run-parallel +Version: 0.4.2 +Release: 0 +Summary: A simple pytest plugin to run tests concurrently +License: MIT +URL: https://github.com/Quansight-Labs/pytest-run-parallel +Source: https://files.pythonhosted.org/packages/source/p/pytest-run-parallel/pytest_run_parallel-%{version}.tar.gz +# PATCH-FIX-UPSTREAM https://github.com/Quansight-Labs/pytest-run-parallel/pull/54 attempt to fix 32 bit architectures +Patch: i586.patch +BuildRequires: python-rpm-macros +BuildRequires: %{python_module pip} +BuildRequires: %{python_module setuptools >= 61.0.0} +# SECTION test requirements +BuildRequires: %{python_module pytest >= 6.2.0} +BuildRequires: %{python_module pytest-order} +BuildRequires: %{python_module hypothesis} +# /SECTION +BuildRequires: fdupes +Requires: python-pytest >= 6.2.0 +Suggests: python-psutil >= 6.1.1 +BuildArch: noarch +%python_subpackages + +%description +A simple pytest plugin to run tests concurrently + +%prep +%autosetup -p1 -n pytest_run_parallel-%{version} + +%build +%pyproject_wheel + +%install +%pyproject_install +%python_expand %fdupes %{buildroot}%{$python_sitelib} + +%check +%pytest + +%files %{python_files} +%license LICENSE +%{python_sitelib}/pytest_run_parallel +%{python_sitelib}/pytest_run_parallel-%{version}.dist-info + +%changelog