Sync from SUSE:SLFO:Main python-pytest-virtualenv revision 69c2ed0d916547d81c64c4a46a36dfcb
This commit is contained in:
parent
14f6f213ce
commit
917afa7a52
BIN
pytest-virtualenv-1.7.0.tar.gz
(Stored with Git LFS)
BIN
pytest-virtualenv-1.7.0.tar.gz
(Stored with Git LFS)
Binary file not shown.
BIN
pytest-virtualenv-1.8.0.tar.gz
(Stored with Git LFS)
Normal file
BIN
pytest-virtualenv-1.8.0.tar.gz
(Stored with Git LFS)
Normal file
Binary file not shown.
@ -1,3 +1,25 @@
|
|||||||
|
-------------------------------------------------------------------
|
||||||
|
Mon Nov 4 11:47:43 UTC 2024 - Daniel Garcia <daniel.garcia@suse.com>
|
||||||
|
|
||||||
|
- Remove not needed python-setuptools-git
|
||||||
|
|
||||||
|
-------------------------------------------------------------------
|
||||||
|
Tue Oct 22 06:08:51 UTC 2024 - Steve Kowalik <steven.kowalik@suse.com>
|
||||||
|
|
||||||
|
- Update to 1.8.0:
|
||||||
|
* Drop support for Python 2 and <3.6, removing compatibility code.
|
||||||
|
* Use stdlib unittest.mock instead of mock package.
|
||||||
|
* Removed usage of path.py and path in favour of pathlib.
|
||||||
|
* Modernised package.
|
||||||
|
* Added delete_workspace parameter to VirtualEnv.
|
||||||
|
* Removed extras_require.
|
||||||
|
- Switch to pyproject macros.
|
||||||
|
- No more greedy globs in %files.
|
||||||
|
- Removed patches, included upstream:
|
||||||
|
* remove_mock.patch
|
||||||
|
- Refreshed remove_virtualenv.patch
|
||||||
|
- Do not test with Python 3.12 and above due to an upstream bug.
|
||||||
|
|
||||||
-------------------------------------------------------------------
|
-------------------------------------------------------------------
|
||||||
Sat Jun 10 09:44:58 UTC 2023 - ecsos <ecsos@opensuse.org>
|
Sat Jun 10 09:44:58 UTC 2023 - ecsos <ecsos@opensuse.org>
|
||||||
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
#
|
#
|
||||||
# spec file
|
# spec file for package python-pytest-virtualenv
|
||||||
#
|
#
|
||||||
# Copyright (c) 2021 SUSE LLC
|
# Copyright (c) 2024 SUSE LLC
|
||||||
#
|
#
|
||||||
# All modifications and additions to the file contributed by third parties
|
# All modifications and additions to the file contributed by third parties
|
||||||
# remain the property of their copyright owners, unless otherwise agreed
|
# remain the property of their copyright owners, unless otherwise agreed
|
||||||
@ -16,9 +16,11 @@
|
|||||||
#
|
#
|
||||||
|
|
||||||
|
|
||||||
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
|
|
||||||
%global flavor @BUILD_FLAVOR@%{nil}
|
%global flavor @BUILD_FLAVOR@%{nil}
|
||||||
%if "%{flavor}" == "test"
|
%if "%{flavor}" == "test"
|
||||||
|
# https://github.com/man-group/pytest-plugins/issues/220
|
||||||
|
%define skip_python312 1
|
||||||
|
%define skip_python313 1
|
||||||
%define psuffix -test
|
%define psuffix -test
|
||||||
%bcond_without test
|
%bcond_without test
|
||||||
%else
|
%else
|
||||||
@ -27,38 +29,26 @@
|
|||||||
%endif
|
%endif
|
||||||
%{?sle15_python_module_pythons}
|
%{?sle15_python_module_pythons}
|
||||||
Name: python-pytest-virtualenv%{psuffix}
|
Name: python-pytest-virtualenv%{psuffix}
|
||||||
Version: 1.7.0
|
Version: 1.8.0
|
||||||
Release: 0
|
Release: 0
|
||||||
Summary: Virtualenv fixture for pytest
|
Summary: Virtualenv fixture for pytest
|
||||||
License: MIT
|
License: MIT
|
||||||
URL: https://github.com/manahl/pytest-plugins
|
URL: https://github.com/man-group/pytest-plugins
|
||||||
Source: https://files.pythonhosted.org/packages/source/p/pytest-virtualenv/pytest-virtualenv-%{version}.tar.gz
|
Source: https://files.pythonhosted.org/packages/source/p/pytest-virtualenv/pytest-virtualenv-%{version}.tar.gz
|
||||||
# PATCH-FIX-UPSTREAM remove_mock.patch gh#man-group/pytest-plugins#168 mcepl@suse.com
|
# PATCH-FIX-OPENSUSE remove dependency on the external module virtualenv
|
||||||
# remove dependency on the external module mock
|
Patch0: remove_virtualenv.patch
|
||||||
Patch0: remove_mock.patch
|
|
||||||
# PATCH-FIX-UPSTREAM remove_mock.patch gh#man-group/pytest-plugins#168 mcepl@suse.com
|
|
||||||
# and while at it, we can remove dependency on the external module
|
|
||||||
# virtualenv as well
|
|
||||||
Patch1: remove_virtualenv.patch
|
|
||||||
%if %{with test}
|
%if %{with test}
|
||||||
BuildRequires: %{python_module path.py}
|
BuildRequires: %{python_module pytest-virtualenv = %{version}}
|
||||||
BuildRequires: %{python_module pytest-fixture-config}
|
|
||||||
BuildRequires: %{python_module pytest-shutil}
|
|
||||||
BuildRequires: %{python_module pytest-virtualenv}
|
|
||||||
BuildRequires: %{python_module pytest}
|
|
||||||
%endif
|
%endif
|
||||||
BuildRequires: %{python_module setuptools-git}
|
BuildRequires: %{python_module pip}
|
||||||
BuildRequires: %{python_module setuptools}
|
BuildRequires: %{python_module setuptools}
|
||||||
%if 0%{?suse_version} <= 1500
|
BuildRequires: %{python_module wheel}
|
||||||
BuildRequires: %{python_module mock}
|
|
||||||
BuildRequires: %{python_module virtualenv}
|
|
||||||
%endif
|
|
||||||
BuildRequires: fdupes
|
BuildRequires: fdupes
|
||||||
BuildRequires: python-rpm-macros
|
BuildRequires: python-rpm-macros
|
||||||
Requires: python-path.py
|
Requires: python-importlib-metadata
|
||||||
|
Requires: python-pytest
|
||||||
Requires: python-pytest-fixture-config
|
Requires: python-pytest-fixture-config
|
||||||
Requires: python-pytest-shutil
|
Requires: python-pytest-shutil
|
||||||
Requires: python-setuptools
|
|
||||||
BuildArch: noarch
|
BuildArch: noarch
|
||||||
%python_subpackages
|
%python_subpackages
|
||||||
|
|
||||||
@ -71,25 +61,27 @@ what's installed.
|
|||||||
%autosetup -p1 -n pytest-virtualenv-%{version}
|
%autosetup -p1 -n pytest-virtualenv-%{version}
|
||||||
|
|
||||||
%build
|
%build
|
||||||
%python_build
|
%pyproject_wheel
|
||||||
|
|
||||||
%install
|
%install
|
||||||
%if !%{with test}
|
%if !%{with test}
|
||||||
%python_install
|
%pyproject_install
|
||||||
%python_expand %fdupes %{buildroot}%{$python_sitelib}
|
%python_expand %fdupes %{buildroot}%{$python_sitelib}
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
%check
|
%check
|
||||||
%if %{with test}
|
%if %{with test}
|
||||||
# Requires network access
|
# Requires network access
|
||||||
%pytest -k 'not test_installed_packages'
|
%pytest -k 'not (test_installed_packages or test_install_)'
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
%if !%{with test}
|
%if !%{with test}
|
||||||
%files %{python_files}
|
%files %{python_files}
|
||||||
%doc CHANGES.md README.md
|
%doc CHANGES.md README.md
|
||||||
%license LICENSE
|
%license LICENSE
|
||||||
%{python_sitelib}/*
|
%{python_sitelib}/pytest_virtualenv.py
|
||||||
|
%pycache_only %{python_sitelib}/__pycache__/pytest_virtualenv*.pyc
|
||||||
|
%{python_sitelib}/pytest_virtualenv-%{version}.dist-info
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
@ -1,29 +0,0 @@
|
|||||||
--- a/tests/unit/test_venv.py
|
|
||||||
+++ b/tests/unit/test_venv.py
|
|
||||||
@@ -1,4 +1,7 @@
|
|
||||||
-import mock
|
|
||||||
+try:
|
|
||||||
+ from unittest.mock import patch
|
|
||||||
+except ImportError:
|
|
||||||
+ from mock import patch
|
|
||||||
|
|
||||||
import pytest_virtualenv as venv
|
|
||||||
from pytest_shutil import env
|
|
||||||
@@ -6,7 +9,7 @@ from pytest_shutil import env
|
|
||||||
|
|
||||||
def test_PYTHONPATH_not_present_in_testing_env_if_set():
|
|
||||||
with env.set_env('PYTHONPATH', 'fred'):
|
|
||||||
- with mock.patch.object(venv.Workspace, 'run') as run:
|
|
||||||
+ with patch.object(venv.Workspace, 'run') as run:
|
|
||||||
venv.VirtualEnv()
|
|
||||||
call = run.mock_calls[0]
|
|
||||||
assert 'PYTHONPATH' not in call[2]['env']
|
|
||||||
@@ -18,7 +21,7 @@ def test_PYTHONPATH_not_present_in_testi
|
|
||||||
|
|
||||||
def test_PYTHONPATH_not_present_in_testing_env_if_unset():
|
|
||||||
with env.no_env('PYTHONPATH'):
|
|
||||||
- with mock.patch.object(venv.Workspace, 'run') as run:
|
|
||||||
+ with patch.object(venv.Workspace, 'run') as run:
|
|
||||||
venv.VirtualEnv()
|
|
||||||
call = run.mock_calls[0]
|
|
||||||
assert 'PYTHONPATH' not in call[2]['env']
|
|
@ -1,31 +1,17 @@
|
|||||||
---
|
Index: pytest-virtualenv-1.8.0/pytest_virtualenv.py
|
||||||
pytest_virtualenv.py | 2 +-
|
===================================================================
|
||||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
--- pytest-virtualenv-1.8.0.orig/pytest_virtualenv.py
|
||||||
|
+++ pytest-virtualenv-1.8.0/pytest_virtualenv.py
|
||||||
|
@@ -25,7 +25,7 @@ class FixtureConfig(Config):
|
||||||
|
|
||||||
--- a/pytest_virtualenv.py
|
|
||||||
+++ b/pytest_virtualenv.py
|
|
||||||
@@ -15,13 +15,19 @@ from pytest_shutil.workspace import Work
|
|
||||||
from pytest_shutil import run, cmdline
|
|
||||||
from pytest_fixture_config import Config, yield_requires_config
|
|
||||||
|
|
||||||
+PY2 = sys.version_info[0] == 2
|
|
||||||
+
|
|
||||||
|
|
||||||
class FixtureConfig(Config):
|
|
||||||
__slots__ = ('virtualenv_executable')
|
|
||||||
|
|
||||||
+
|
|
||||||
# Default values for system resource locations - patch this to change defaults
|
# Default values for system resource locations - patch this to change defaults
|
||||||
# Can be a string or list of them
|
# Can be a string or list of them
|
||||||
-DEFAULT_VIRTUALENV_FIXTURE_EXECUTABLE = [sys.executable, '-m', 'virtualenv']
|
-DEFAULT_VIRTUALENV_FIXTURE_EXECUTABLE = [sys.executable, '-m', 'virtualenv']
|
||||||
+if PY2:
|
+DEFAULT_VIRTUALENV_FIXTURE_EXECUTABLE = [sys.executable, '-m', 'venv']
|
||||||
+ DEFAULT_VIRTUALENV_FIXTURE_EXECUTABLE = [sys.executable, '-m', 'virtualenv']
|
|
||||||
+else:
|
|
||||||
+ DEFAULT_VIRTUALENV_FIXTURE_EXECUTABLE = [sys.executable, '-m', 'venv']
|
|
||||||
|
|
||||||
CONFIG = FixtureConfig(
|
CONFIG = FixtureConfig(
|
||||||
virtualenv_executable=os.getenv('VIRTUALENV_FIXTURE_EXECUTABLE', DEFAULT_VIRTUALENV_FIXTURE_EXECUTABLE),
|
virtualenv_executable=os.getenv('VIRTUALENV_FIXTURE_EXECUTABLE', DEFAULT_VIRTUALENV_FIXTURE_EXECUTABLE),
|
||||||
@@ -78,7 +84,7 @@ class PackageEntry(object):
|
@@ -82,7 +82,7 @@ class PackageEntry(object):
|
||||||
|
|
||||||
def match(self, package_type):
|
def match(self, package_type):
|
||||||
if package_type is self.ANY:
|
if package_type is self.ANY:
|
||||||
@ -34,32 +20,23 @@
|
|||||||
elif package_type is self.REL:
|
elif package_type is self.REL:
|
||||||
if self.isrel:
|
if self.isrel:
|
||||||
return True
|
return True
|
||||||
@@ -137,7 +143,8 @@ class VirtualEnv(Workspace):
|
@@ -146,7 +146,6 @@ class VirtualEnv(Workspace):
|
||||||
cmd = [self.virtualenv_cmd]
|
cmd = [self.virtualenv_cmd]
|
||||||
else:
|
else:
|
||||||
cmd = list(self.virtualenv_cmd)
|
cmd = list(self.virtualenv_cmd)
|
||||||
- cmd.extend(['-p', python or cmdline.get_real_python_executable()])
|
- cmd.extend(['-p', python or cmdline.get_real_python_executable()])
|
||||||
+ if PY2:
|
|
||||||
+ cmd.extend(['-p', python or cmdline.get_real_python_executable()])
|
|
||||||
cmd.extend(self.args)
|
cmd.extend(self.args)
|
||||||
cmd.append(str(self.virtualenv))
|
cmd.append(str(self.virtualenv))
|
||||||
self.run(cmd)
|
self.run(cmd)
|
||||||
--- a/tests/integration/test_tmpvirtualenv.py
|
Index: pytest-virtualenv-1.8.0/setup.py
|
||||||
+++ b/tests/integration/test_tmpvirtualenv.py
|
===================================================================
|
||||||
@@ -5,6 +5,8 @@ import textwrap
|
--- pytest-virtualenv-1.8.0.orig/setup.py
|
||||||
|
+++ pytest-virtualenv-1.8.0/setup.py
|
||||||
|
@@ -21,7 +21,6 @@ classifiers = [
|
||||||
|
install_requires = ['pytest-fixture-config',
|
||||||
|
'pytest-shutil',
|
||||||
|
'pytest',
|
||||||
|
- 'virtualenv',
|
||||||
|
'importlib-metadata',
|
||||||
|
]
|
||||||
|
|
||||||
import pytest_virtualenv as venv
|
|
||||||
|
|
||||||
+PY2 = sys.version_info[0] == 2
|
|
||||||
+
|
|
||||||
|
|
||||||
def check_member(name, ips):
|
|
||||||
return name in ips
|
|
||||||
@@ -15,4 +17,5 @@ def test_installed_packages():
|
|
||||||
ips = v.installed_packages()
|
|
||||||
assert len(ips) > 0
|
|
||||||
check_member('pip', ips)
|
|
||||||
- check_member('virtualenv', ips)
|
|
||||||
\ No newline at end of file
|
|
||||||
+ if PY2:
|
|
||||||
+ check_member('virtualenv', ips)
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user