Compare commits

...

10 Commits

Author SHA1 Message Date
openeuler-ci-bot
1f9465022d
!13 Discard invalid package info when it is deprecated
From: @wang--ge 
Reviewed-by: @cherry530 
Signed-off-by: @cherry530
2024-04-07 08:22:13 +00:00
wang__ge
d86b8cefac discard invalid package info when it is deprecated 2024-04-07 15:53:25 +08:00
openeuler-ci-bot
6c2b1f5c9d
!12 Remove buildrequires python3-contextlib
From: @cherry530 
Reviewed-by: @dillon_chen 
Signed-off-by: @dillon_chen
2023-07-31 03:49:21 +00:00
cherry530
d785bb9a67 remove buildrequires python3-contextlib2.
Signed-off-by: cherry530 <707078654@qq.com>
2023-07-31 11:16:23 +08:00
openeuler-ci-bot
971c4d79c8
!10 Update package
From: @Wangjunqi123 
Reviewed-by: @xiezhipeng1 
Signed-off-by: @xiezhipeng1
2022-12-28 03:01:24 +00:00
Wangjunqi123
b983bfcbc9 update version to 1.7.0 2022-11-28 17:08:33 +08:00
openeuler-ci-bot
371a09b8f9
!8 【轻量级PR】:Fix bad date in changelog
From: @peijiankang 
Reviewed-by: @yangzhao_kl, @overweight 
Signed-off-by: @yangzhao_kl, @overweight
2022-06-10 01:16:29 +00:00
peijiankang
e1dc0aac3e Fix bad date in changelog 2022-06-09 10:20:49 +08:00
openeuler-ci-bot
0217239319 !5 Remove python2-pytest-virtualenv
From: @wang_yue111
Reviewed-by: @xiezhipeng1
Signed-off-by: @xiezhipeng1
2020-09-11 21:57:05 +08:00
wang_yue111
bc72e3d89f Remove python2-pytest-virtualenv 2020-09-11 16:15:46 +08:00
5 changed files with 108 additions and 82 deletions

View File

@ -0,0 +1,26 @@
From 0ec69cf350d7e5b3509d3c98860169145f72b25b Mon Sep 17 00:00:00 2001
From: wang__ge <wang__ge@126.com>
Date: Sun, 7 Apr 2024 15:42:22 +0800
Subject: [PATCH] discard invalid package info when it is deprecated
---
pytest_virtualenv.py | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/pytest_virtualenv.py b/pytest_virtualenv.py
index dbaf45b..fd7a0f8 100644
--- a/pytest_virtualenv.py
+++ b/pytest_virtualenv.py
@@ -226,6 +226,7 @@ class VirtualEnv(Workspace):
"for i in working_set: print(i.project_name + ' ' + i.version + ' ' + i.location)"
lines = self.run([self.python, "-c", code], capture=True).split('\n')
for line in [i.strip() for i in lines if i.strip()]:
- name, version, location = line.split()
- res[name] = PackageEntry(name, version, location)
+ if (not 'DeprecationWarning:' in line.split()):
+ name, version, location = line.split()
+ res[name] = PackageEntry(name, version, location)
return res
--
2.43.0

View File

@ -1,39 +0,0 @@
From 6bfb0f17a033c485948e09e6c18bc08f5948830c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= <miro@hroncok.cz>
Date: Thu, 23 Aug 2018 21:19:50 +0200
Subject: [PATCH] Instead of using the virtualenv command, use -m virtualenv
Fixes https://github.com/manahl/pytest-plugins/issues/79
---
pytest-virtualenv/pytest_virtualenv.py | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
diff --git a/pytest-virtualenv/pytest_virtualenv.py b/pytest-virtualenv/pytest_virtualenv.py
index a7981b3..e54039c 100644
--- a/pytest-virtualenv/pytest_virtualenv.py
+++ b/pytest-virtualenv/pytest_virtualenv.py
@@ -20,7 +20,8 @@ class FixtureConfig(Config):
__slots__ = ('virtualenv_executable')
# Default values for system resource locations - patch this to change defaults
-DEFAULT_VIRTUALENV_FIXTURE_EXECUTABLE = (cmdline.which('virtualenv') + ['virtualenv'])[0]
+# Can be a string or list of them
+DEFAULT_VIRTUALENV_FIXTURE_EXECUTABLE = [sys.executable, '-m', 'virtualenv']
CONFIG = FixtureConfig(
virtualenv_executable=os.getenv('VIRTUALENV_FIXTURE_EXECUTABLE', DEFAULT_VIRTUALENV_FIXTURE_EXECUTABLE),
@@ -132,9 +133,11 @@ def __init__(self, env=None, workspace=None, name='.env', python=None, args=None
del(self.env['PYTHONPATH'])
self.virtualenv_cmd = CONFIG.virtualenv_executable
- cmd = [self.virtualenv_cmd,
- '-p', python or cmdline.get_real_python_executable()
- ]
+ if isinstance(self.virtualenv_cmd, str):
+ 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)

Binary file not shown.

Binary file not shown.

View File

@ -1,72 +1,111 @@
%global with_tests 0%{?_with_tests:1} %global _empty_manifest_terminate_build 0
%global debug_package %{nil}
%bcond_without tests
Name: python-pytest-virtualenv Name: python-pytest-virtualenv
Version: 1.2.11 Version: 1.7.0
Release: 11 Release: 3
Summary: Virtualenv fixture for py.test Summary: Virtualenv fixture for py.test
License: MIT License: MIT
URL: https://pypi.python.org/pypi/pytest-virtualenv URL: https://github.com/manahl/pytest-plugins
Source0: https://files.pythonhosted.org/packages/source/p/pytest-virtualenv/pytest-virtualenv-1.2.11.tar.gz Source0: https://files.pythonhosted.org/packages/96/73/f3d34462e1d2de89bab407ba3dac5212e9e6996f5b4bc3c6930c68f51b62/pytest-virtualenv-1.7.0.tar.gz
Patch0: 0001-discard-invalid-package-info-when-it-is-deprecated.patch
BuildArch: noarch BuildArch: noarch
BuildRequires: python2-devel python3-devel python2-pytest python3-pytest
BuildRequires: python2-six python3-six python2-setuptools_git python3-setuptools_git
%if %{with_tests}
BuildRequires: python2-pytest-shutil python3-pytest-shutil
BuildRequires: python2-pytest-fixture-config python3-pytest-fixture-config python2-path python3-path
BuildRequires: python2-execnet python3-execnet python2-mock python3-mock python2-contextlib2
BuildRequires: python3-contextlib2 python2-virtualenv python3-virtualenv
%endif
Patch0: https://github.com/manahl/pytest-plugins/pull/91.patch
%description %description
Create a Python virtual environment in your test that cleans up on teardown. 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. The fixture has utility methods to install packages and list what's installed.
%package -n python2-pytest-virtualenv
Summary: Virtualenv fixture for py.test
%python_provide python2-pytest-virtualenv
Requires: python2-pytest python2-pytest-shutil python2-pytest-fixture-config
Requires: python2-path python2-execnet python2-contextlib2 python2-virtualenv
%description -n python2-pytest-virtualenv
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.
%package -n python3-pytest-virtualenv %package -n python3-pytest-virtualenv
Summary: Virtualenv fixture for py.test Summary: Virtualenv fixture for py.test
%python_provide python3-pytest-virtualenv Provides: python-pytest-virtualenv = %{version}-%{release}
Requires: python3-pytest python3-pytest-shutil python3-pytest-fixture-config BuildRequires: python3-devel
Requires: python3-path python3-execnet python3-contextlib2 python3-virtualenv BuildRequires: python3-pytest
BuildRequires: python3-six
BuildRequires: python3-setuptools_git
%if %{with tests}
BuildRequires: python3-pytest-shutil
BuildRequires: python3-pytest-fixture-config
BuildRequires: python3-path
BuildRequires: python3-execnet
BuildRequires: python3-mock
BuildRequires: python3-virtualenv
%endif
Requires: python3-pytest-fixture-config
Requires: python3-pytest-shutil
Requires: python3-pytest
Requires: python3-virtualenv
Requires: python3-mock
%description -n python3-pytest-virtualenv %description -n python3-pytest-virtualenv
Create a Python virtual environment in your test that cleans up on teardown. 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. The fixture has utility methods to install packages and list what's installed.
%package help
Summary: Development documents and examples for pytest-virtualenv
Provides: python3-pytest-virtualenv-doc
%description help
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 %prep
%autosetup -n pytest-virtualenv-%{version} %autosetup -n pytest-virtualenv-%{version} -p1
%build %build
%py2_build
%py3_build %py3_build
%install %install
%py2_install
%py3_install %py3_install
install -d -m755 %{buildroot}/%{_pkgdocdir}
if [ -d doc ]; then cp -arf doc %{buildroot}/%{_pkgdocdir}; fi
if [ -d docs ]; then cp -arf docs %{buildroot}/%{_pkgdocdir}; fi
if [ -d example ]; then cp -arf example %{buildroot}/%{_pkgdocdir}; fi
if [ -d examples ]; then cp -arf examples %{buildroot}/%{_pkgdocdir}; fi
pushd %{buildroot}
if [ -d usr/lib ]; then
find usr/lib -type f -printf "/%h/%f\n" >> filelist.lst
fi
if [ -d usr/lib64 ]; then
find usr/lib64 -type f -printf "/%h/%f\n" >> filelist.lst
fi
if [ -d usr/bin ]; then
find usr/bin -type f -printf "/%h/%f\n" >> filelist.lst
fi
if [ -d usr/sbin ]; then
find usr/sbin -type f -printf "/%h/%f\n" >> filelist.lst
fi
touch doclist.lst
if [ -d usr/share/man ]; then
find usr/share/man -type f -printf "/%h/%f.gz\n" >> doclist.lst
fi
popd
mv %{buildroot}/filelist.lst .
mv %{buildroot}/doclist.lst .
%if %{with_tests} %if %{with tests}
%check %check
%{__python2} setup.py test
%{__python3} setup.py test %{__python3} setup.py test
%endif %endif
%files -n python2-pytest-virtualenv %files -n python3-pytest-virtualenv -f filelist.lst
%doc README.md CHANGES.md %dir %{python3_sitelib}/*
%{python2_sitelib}/*
%files -n python3-pytest-virtualenv %files help -f doclist.lst
%{_docdir}/*
%doc README.md CHANGES.md %doc README.md CHANGES.md
%{python3_sitelib}/*
%changelog %changelog
* Sun Apr 07 2024 Ge Wang <wang__ge@126.com> - 1.7.0-3
- discard invalid package info when it is deprecated
* Mon Jul 31 2023 xu_ping <707078654@qq.com> - 1.7.0-2
- remove buildrequires python3-contextlib2
* Mon Nov 28 2022 wangjunqi <wangjunqi@kylinos.cn> - 1.7.0-1
- Update package to version 1.7.0
* Fri Sep 11 2020 wangyue<wangyue92@huawei.com> - 1.2.11-12
- Remove python2-pytest-virtualenv
* Mon Jan 13 2020 Senlin Xia<xiasenlin1@huawei.com> - 1.2.11-11 * Mon Jan 13 2020 Senlin Xia<xiasenlin1@huawei.com> - 1.2.11-11
- Modify %prep - Modify %prep