- add fix_pathlib.patch
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python:pytest/python-pytest-shutil?expand=0&rev=8
This commit is contained in:
parent
8caf53a9a1
commit
93876f418b
50
fix_pathlib.patch
Normal file
50
fix_pathlib.patch
Normal file
@ -0,0 +1,50 @@
|
|||||||
|
Index: pytest-shutil-1.7.0/pytest_shutil/workspace.py
|
||||||
|
===================================================================
|
||||||
|
--- pytest-shutil-1.7.0.orig/pytest_shutil/workspace.py
|
||||||
|
+++ pytest-shutil-1.7.0/pytest_shutil/workspace.py
|
||||||
|
@@ -8,9 +8,14 @@ import logging
|
||||||
|
import subprocess
|
||||||
|
|
||||||
|
try:
|
||||||
|
- from path import Path
|
||||||
|
+ from pathlib import Path
|
||||||
|
+ Path.isdir = Path.is_dir
|
||||||
|
+ Path.makedirs = Path.mkdir
|
||||||
|
except ImportError:
|
||||||
|
- from path import path as Path
|
||||||
|
+ try:
|
||||||
|
+ from path import Path
|
||||||
|
+ except ImportError:
|
||||||
|
+ from path import path as Path
|
||||||
|
|
||||||
|
import pytest
|
||||||
|
from six import string_types
|
||||||
|
Index: pytest-shutil-1.7.0/setup.py
|
||||||
|
===================================================================
|
||||||
|
--- pytest-shutil-1.7.0.orig/setup.py
|
||||||
|
+++ pytest-shutil-1.7.0/setup.py
|
||||||
|
@@ -24,9 +24,9 @@ classifiers = [
|
||||||
|
|
||||||
|
install_requires = ['six',
|
||||||
|
'execnet',
|
||||||
|
- 'contextlib2',
|
||||||
|
+ 'contextlib2;python_version<"3"',
|
||||||
|
'pytest',
|
||||||
|
- 'path.py',
|
||||||
|
+ 'path.py;python_version<"3"',
|
||||||
|
'mock',
|
||||||
|
'termcolor'
|
||||||
|
]
|
||||||
|
Index: pytest-shutil-1.7.0/tests/integration/test_run_integration.py
|
||||||
|
===================================================================
|
||||||
|
--- pytest-shutil-1.7.0.orig/tests/integration/test_run_integration.py
|
||||||
|
+++ pytest-shutil-1.7.0/tests/integration/test_run_integration.py
|
||||||
|
@@ -192,7 +192,7 @@ def test_run_in_subprocess_uses_passed_p
|
||||||
|
def test_run_in_subprocess_cd():
|
||||||
|
with workspace.Workspace() as ws:
|
||||||
|
with no_cov():
|
||||||
|
- cwd = run.run_in_subprocess(os.getcwd, cd=ws.workspace)()
|
||||||
|
+ cwd = run.run_in_subprocess(os.getcwd, cd=str(ws.workspace))()
|
||||||
|
assert os.path.realpath(cwd) == os.path.realpath(ws.workspace)
|
||||||
|
|
||||||
|
|
@ -2,6 +2,7 @@
|
|||||||
Sat Dec 28 17:36:29 UTC 2019 - Ondřej Súkup <mimi.vx@gmail.com>
|
Sat Dec 28 17:36:29 UTC 2019 - Ondřej Súkup <mimi.vx@gmail.com>
|
||||||
|
|
||||||
- fix dependency on python-path.py
|
- fix dependency on python-path.py
|
||||||
|
- add fix_pathlib.patch
|
||||||
|
|
||||||
-------------------------------------------------------------------
|
-------------------------------------------------------------------
|
||||||
Mon Jun 3 09:07:17 UTC 2019 - Tomáš Chvátal <tchvatal@suse.com>
|
Mon Jun 3 09:07:17 UTC 2019 - Tomáš Chvátal <tchvatal@suse.com>
|
||||||
|
@ -25,6 +25,7 @@ License: MIT
|
|||||||
Group: Development/Languages/Python
|
Group: Development/Languages/Python
|
||||||
URL: https://github.com/manahl/pytest-plugins
|
URL: https://github.com/manahl/pytest-plugins
|
||||||
Source: https://files.pythonhosted.org/packages/source/p/pytest-shutil/pytest-shutil-%{version}.tar.gz
|
Source: https://files.pythonhosted.org/packages/source/p/pytest-shutil/pytest-shutil-%{version}.tar.gz
|
||||||
|
Patch0: fix_pathlib.patch
|
||||||
BuildRequires: %{python_module execnet}
|
BuildRequires: %{python_module execnet}
|
||||||
BuildRequires: %{python_module mock}
|
BuildRequires: %{python_module mock}
|
||||||
BuildRequires: %{python_module path.py}
|
BuildRequires: %{python_module path.py}
|
||||||
@ -55,8 +56,7 @@ tools for automated tests.
|
|||||||
|
|
||||||
%prep
|
%prep
|
||||||
%setup -q -n pytest-shutil-%{version}
|
%setup -q -n pytest-shutil-%{version}
|
||||||
sed -i 's/contextlib2/contextlib2;python_version<"3"/' setup.py
|
%patch0 -p1
|
||||||
sed -i 's/path\.py/path\.py;python_version<"3"/' setup.py
|
|
||||||
|
|
||||||
%build
|
%build
|
||||||
%python_build
|
%python_build
|
||||||
|
Loading…
x
Reference in New Issue
Block a user