From f0b218afc27391ae84f46c81fcc354772e2bdfceb4119234338ac767385e5133 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adrian=20Schr=C3=B6ter?= Date: Fri, 3 May 2024 22:30:24 +0200 Subject: [PATCH] Sync from SUSE:SLFO:Main python-pytest-shutil revision ab2100e972d960fe9457a696b66cb77e --- .gitattributes | 23 +++++++ pytest-fixtures-pr171-remove-mock.patch | 72 +++++++++++++++++++ pytest-shutil-1.7.0.tar.gz | 3 + python-pytest-shutil.changes | 52 ++++++++++++++ python-pytest-shutil.spec | 92 +++++++++++++++++++++++++ 5 files changed, 242 insertions(+) create mode 100644 .gitattributes create mode 100644 pytest-fixtures-pr171-remove-mock.patch create mode 100644 pytest-shutil-1.7.0.tar.gz create mode 100644 python-pytest-shutil.changes create mode 100644 python-pytest-shutil.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/pytest-fixtures-pr171-remove-mock.patch b/pytest-fixtures-pr171-remove-mock.patch new file mode 100644 index 0000000..eb4f545 --- /dev/null +++ b/pytest-fixtures-pr171-remove-mock.patch @@ -0,0 +1,72 @@ +diff --git a/pytest-shutil/pytest_shutil/run.py b/pytest-shutil/pytest_shutil/run.py +index c5b421d..7d46aea 100644 +--- a/pytest-shutil/pytest_shutil/run.py ++++ b/pytest-shutil/pytest_shutil/run.py +@@ -11,7 +11,12 @@ + from contextlib import closing + import subprocess + +-from mock import patch ++try: ++ from unittest.mock import patch ++except ImportError: ++ # python 2 ++ from mock import patch ++ + import execnet + from six.moves import cPickle # @UnresolvedImport + +diff --git a/pytest-shutil/setup.py b/pytest-shutil/setup.py +index 4126831..3513d3e 100644 +--- a/pytest-shutil/setup.py ++++ b/pytest-shutil/setup.py +@@ -24,10 +24,11 @@ + + install_requires = ['six', + 'execnet', +- 'contextlib2', ++ 'contextlib2;python_version<"3"', + 'pytest', +- 'path.py', +- 'mock', ++ 'path; python_version >= "3.7"', ++ 'path.py; python_version < "3.7"', ++ 'mock; python_version<"3.3"', + 'termcolor' + ] + +diff --git a/pytest-shutil/tests/integration/test_run_integration.py b/pytest-shutil/tests/integration/test_run_integration.py +index d92c9da..bf20f3a 100644 +--- a/pytest-shutil/tests/integration/test_run_integration.py ++++ b/pytest-shutil/tests/integration/test_run_integration.py +@@ -8,7 +8,10 @@ + import textwrap + from uuid import uuid4 + +-import mock ++try: ++ from unittest import mock ++except ImportError: ++ import mock + + from pytest_shutil import run, workspace + from pytest_shutil.env import no_cov +diff --git a/pytest-shutil/tests/unit/test_run.py b/pytest-shutil/tests/unit/test_run.py +index 612d20d..c520e85 100644 +--- a/pytest-shutil/tests/unit/test_run.py ++++ b/pytest-shutil/tests/unit/test_run.py +@@ -3,7 +3,13 @@ + from subprocess import PIPE, STDOUT + + import pytest +-from mock import Mock, patch, sentinel, DEFAULT, call ++ ++try: ++ from unittest.mock import Mock, patch, sentinel, DEFAULT, call ++except ImportError: ++ # python 2 ++ from mock import Mock, patch, sentinel, DEFAULT, call ++ + from six.moves import cPickle + + from pytest_shutil import run diff --git a/pytest-shutil-1.7.0.tar.gz b/pytest-shutil-1.7.0.tar.gz new file mode 100644 index 0000000..c29e5af --- /dev/null +++ b/pytest-shutil-1.7.0.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d8165261de76e7508505c341d94c02b113dc963f274543abca74dbfabd021261 +size 23497 diff --git a/python-pytest-shutil.changes b/python-pytest-shutil.changes new file mode 100644 index 0000000..05bfd14 --- /dev/null +++ b/python-pytest-shutil.changes @@ -0,0 +1,52 @@ +------------------------------------------------------------------- +Sat Jun 10 11:50:04 UTC 2023 - ecsos + +- Add %{?sle15_python_module_pythons} + +------------------------------------------------------------------- +Mon Dec 5 11:16:10 UTC 2022 - Daniel Garcia + +- Disable test_pretty_formatter test that fails in osc build but it works when + run manually. + +------------------------------------------------------------------- +Thu Apr 21 21:51:01 UTC 2022 - Ben Greiner + +- Fixup fallout from SUSE's crusade against mock in the + pytest-fixtures family + * Replace remove-mock.patch with + pytest-fixtures-pr171-remove-mock.patch + * gh#man-group/pytest-plugins#171 + * Update build and runtime requirements + +------------------------------------------------------------------- +Wed Mar 23 06:45:41 UTC 2022 - Steve Kowalik + +- Add patch remove-mock.patch: + * Do not use external mock. + +------------------------------------------------------------------- +Fri Mar 13 12:37:42 UTC 2020 - Tomáš Chvátal + +- Build without python2 present + +------------------------------------------------------------------- +Sat Dec 28 18:31:07 UTC 2019 - Ondřej Súkup + +- fix python-path/python-path.py requires + +------------------------------------------------------------------- +Mon Jun 3 09:07:17 UTC 2019 - Tomáš Chvátal + +- Update to 1.7.0: + * Support pytest 4 + +------------------------------------------------------------------- +Fri Mar 22 07:23:42 UTC 2019 - John Vandenberg + +- Remove dependency on contextlib2 on Python 3 + +------------------------------------------------------------------- +Wed Feb 20 11:52:07 UTC 2019 - Tomáš Chvátal + +- Initial commit, neded by pytest-virtualenv diff --git a/python-pytest-shutil.spec b/python-pytest-shutil.spec new file mode 100644 index 0000000..a67b1d3 --- /dev/null +++ b/python-pytest-shutil.spec @@ -0,0 +1,92 @@ +# +# spec file for package python-pytest-shutil +# +# Copyright (c) 2022 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/ +# + + +%bcond_without python2 +%{?sle15_python_module_pythons} +Name: python-pytest-shutil +Version: 1.7.0 +Release: 0 +Summary: A goodie-bag of unix shell and environment tools for pytest +License: MIT +URL: https://github.com/manahl/pytest-plugins +Source: https://files.pythonhosted.org/packages/source/p/pytest-shutil/pytest-shutil-%{version}.tar.gz +# PATCH-FEATURE-UPSTREAM pytest-fixtures-pr171-remove-mock.patch -- gh#man-group#pytest-plugins#171 +Patch1: pytest-fixtures-pr171-remove-mock.patch +BuildRequires: %{python_module execnet} +BuildRequires: %{python_module path} +BuildRequires: %{python_module pytest} +BuildRequires: %{python_module setuptools-git} +BuildRequires: %{python_module setuptools} +BuildRequires: %{python_module six} +BuildRequires: %{python_module termcolor} +BuildRequires: fdupes +%if %{with python2} +BuildRequires: python-contextlib2 +BuildRequires: python-mock +BuildRequires: python-path.py +%endif +%if 0%{?suse_version} < 1550 +BuildRequires: python3-path.py +%else +BuildRequires: %{python_module path} +%endif +BuildRequires: python-rpm-macros +Requires: python-execnet +%if 0%{suse_version} < 1550 +Requires: python-path.py +%else +Requires: python-path +%endif +Requires: python-pytest +Requires: python-six +Requires: python-termcolor +%ifpython2 +Requires: python-contextlib2 +Requires: python-mock +Requires: python-path.py +%endif +BuildArch: noarch + +%python_subpackages + +%description +This library is a goodie-bag of Unix shell and environment management +tools for automated tests. + +%prep +%autosetup -p2 -n pytest-shutil-%{version} + +%build +%python_build + +%install +%python_install +%python_expand %fdupes %{buildroot}%{$python_sitelib} + +%check +# Disable test_pretty_formatter test that fails in osc build but it works when +# run manually. It should be something related to the shell and termcolor +%pytest -k "not test_pretty_formatter" + +%files %{python_files} +%doc README.md CHANGES.md +%license LICENSE +%{python_sitelib}/pytest_shutil +%{python_sitelib}/pytest_shutil-%{version}*-info + +%changelog