- Remove not needed python-setuptools-git
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python:pytest/python-pytest-virtualenv?expand=0&rev=17
This commit is contained in:
commit
68d9faaf48
23
.gitattributes
vendored
Normal file
23
.gitattributes
vendored
Normal file
@ -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
|
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
||||
.osc
|
3
_multibuild
Normal file
3
_multibuild
Normal file
@ -0,0 +1,3 @@
|
||||
<multibuild>
|
||||
<package>test</package>
|
||||
</multibuild>
|
BIN
pytest-virtualenv-1.7.0.tar.gz
(Stored with Git LFS)
Normal file
BIN
pytest-virtualenv-1.7.0.tar.gz
(Stored with Git LFS)
Normal file
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.
56
python-pytest-virtualenv.changes
Normal file
56
python-pytest-virtualenv.changes
Normal file
@ -0,0 +1,56 @@
|
||||
-------------------------------------------------------------------
|
||||
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>
|
||||
|
||||
- Add %{?sle15_python_module_pythons}
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Mon Nov 15 07:23:10 UTC 2021 - Steve Kowalik <steven.kowalik@suse.com>
|
||||
|
||||
- Inject multibuild to break up a build loop.
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Sun Dec 13 21:55:46 UTC 2020 - Matej Cepl <mcepl@suse.com>
|
||||
|
||||
- We don't need to break Python 2.7
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Fri Dec 11 22:44:02 UTC 2020 - Matej Cepl <mcepl@suse.com>
|
||||
|
||||
- Add remove_mock.patch to remove dependency on the external mock
|
||||
package (gh#man-group/pytest-plugins#168). Also add
|
||||
remove_virtualenv.patch to remove dependency on external
|
||||
virtualenv package.
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Mon Jun 3 08:53:22 UTC 2019 - Tomáš Chvátal <tchvatal@suse.com>
|
||||
|
||||
- Update to 1.7.0:
|
||||
* Support pytest 4
|
||||
* Support python 3.7
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Wed Feb 13 09:13:26 UTC 2019 - Tomáš Chvátal <tchvatal@suse.com>
|
||||
|
||||
- Initial commit, needed by pytest-runner
|
87
python-pytest-virtualenv.spec
Normal file
87
python-pytest-virtualenv.spec
Normal file
@ -0,0 +1,87 @@
|
||||
#
|
||||
# spec file for package python-pytest-virtualenv
|
||||
#
|
||||
# Copyright (c) 2024 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/
|
||||
#
|
||||
|
||||
|
||||
%global flavor @BUILD_FLAVOR@%{nil}
|
||||
%if "%{flavor}" == "test"
|
||||
# https://github.com/man-group/pytest-plugins/issues/220
|
||||
%define skip_python312 1
|
||||
%define skip_python313 1
|
||||
%define psuffix -test
|
||||
%bcond_without test
|
||||
%else
|
||||
%define psuffix %{nil}
|
||||
%bcond_with test
|
||||
%endif
|
||||
%{?sle15_python_module_pythons}
|
||||
Name: python-pytest-virtualenv%{psuffix}
|
||||
Version: 1.8.0
|
||||
Release: 0
|
||||
Summary: Virtualenv fixture for pytest
|
||||
License: MIT
|
||||
URL: https://github.com/man-group/pytest-plugins
|
||||
Source: https://files.pythonhosted.org/packages/source/p/pytest-virtualenv/pytest-virtualenv-%{version}.tar.gz
|
||||
# PATCH-FIX-OPENSUSE remove dependency on the external module virtualenv
|
||||
Patch0: remove_virtualenv.patch
|
||||
%if %{with test}
|
||||
BuildRequires: %{python_module pytest-virtualenv = %{version}}
|
||||
%endif
|
||||
BuildRequires: %{python_module pip}
|
||||
BuildRequires: %{python_module setuptools}
|
||||
BuildRequires: %{python_module wheel}
|
||||
BuildRequires: fdupes
|
||||
BuildRequires: python-rpm-macros
|
||||
Requires: python-importlib-metadata
|
||||
Requires: python-pytest
|
||||
Requires: python-pytest-fixture-config
|
||||
Requires: python-pytest-shutil
|
||||
BuildArch: noarch
|
||||
%python_subpackages
|
||||
|
||||
%description
|
||||
Create a Python virtual environment in your test that cleans up on
|
||||
teardown. The fixture has utility methods to install packages and list
|
||||
what's installed.
|
||||
|
||||
%prep
|
||||
%autosetup -p1 -n pytest-virtualenv-%{version}
|
||||
|
||||
%build
|
||||
%pyproject_wheel
|
||||
|
||||
%install
|
||||
%if !%{with test}
|
||||
%pyproject_install
|
||||
%python_expand %fdupes %{buildroot}%{$python_sitelib}
|
||||
%endif
|
||||
|
||||
%check
|
||||
%if %{with test}
|
||||
# Requires network access
|
||||
%pytest -k 'not (test_installed_packages or test_install_)'
|
||||
%endif
|
||||
|
||||
%if !%{with test}
|
||||
%files %{python_files}
|
||||
%doc CHANGES.md README.md
|
||||
%license LICENSE
|
||||
%{python_sitelib}/pytest_virtualenv.py
|
||||
%pycache_only %{python_sitelib}/__pycache__/pytest_virtualenv*.pyc
|
||||
%{python_sitelib}/pytest_virtualenv-%{version}.dist-info
|
||||
%endif
|
||||
|
||||
%changelog
|
29
remove_mock.patch
Normal file
29
remove_mock.patch
Normal file
@ -0,0 +1,29 @@
|
||||
--- 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']
|
42
remove_virtualenv.patch
Normal file
42
remove_virtualenv.patch
Normal file
@ -0,0 +1,42 @@
|
||||
Index: pytest-virtualenv-1.8.0/pytest_virtualenv.py
|
||||
===================================================================
|
||||
--- pytest-virtualenv-1.8.0.orig/pytest_virtualenv.py
|
||||
+++ pytest-virtualenv-1.8.0/pytest_virtualenv.py
|
||||
@@ -25,7 +25,7 @@ class FixtureConfig(Config):
|
||||
|
||||
# Default values for system resource locations - patch this to change defaults
|
||||
# Can be a string or list of them
|
||||
-DEFAULT_VIRTUALENV_FIXTURE_EXECUTABLE = [sys.executable, '-m', 'virtualenv']
|
||||
+DEFAULT_VIRTUALENV_FIXTURE_EXECUTABLE = [sys.executable, '-m', 'venv']
|
||||
|
||||
CONFIG = FixtureConfig(
|
||||
virtualenv_executable=os.getenv('VIRTUALENV_FIXTURE_EXECUTABLE', DEFAULT_VIRTUALENV_FIXTURE_EXECUTABLE),
|
||||
@@ -82,7 +82,7 @@ class PackageEntry(object):
|
||||
|
||||
def match(self, package_type):
|
||||
if package_type is self.ANY:
|
||||
- return True
|
||||
+ return True
|
||||
elif package_type is self.REL:
|
||||
if self.isrel:
|
||||
return True
|
||||
@@ -146,7 +146,6 @@ class VirtualEnv(Workspace):
|
||||
cmd = [self.virtualenv_cmd]
|
||||
else:
|
||||
cmd = list(self.virtualenv_cmd)
|
||||
- cmd.extend(['-p', python or cmdline.get_real_python_executable()])
|
||||
cmd.extend(self.args)
|
||||
cmd.append(str(self.virtualenv))
|
||||
self.run(cmd)
|
||||
Index: pytest-virtualenv-1.8.0/setup.py
|
||||
===================================================================
|
||||
--- 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',
|
||||
]
|
||||
|
Loading…
Reference in New Issue
Block a user