diff --git a/pytest-console-scripts-0.2.0.tar.gz b/pytest-console-scripts-0.2.0.tar.gz deleted file mode 100644 index b1e27ba..0000000 --- a/pytest-console-scripts-0.2.0.tar.gz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:a88ac15d663b88ef8fd5d4929a1b50e782dd25eb84443de849ad78636ad3e699 -size 12298 diff --git a/pytest-console-scripts-1.2.1.tar.gz b/pytest-console-scripts-1.2.1.tar.gz new file mode 100644 index 0000000..d39fab4 --- /dev/null +++ b/pytest-console-scripts-1.2.1.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c7f258025110f1337c23499c2f6674b873d4adba2438be55895edf01451c5ce3 +size 13617 diff --git a/python-pytest-console-scripts.changes b/python-pytest-console-scripts.changes index 4709b71..6ae55e2 100644 --- a/python-pytest-console-scripts.changes +++ b/python-pytest-console-scripts.changes @@ -1,3 +1,16 @@ +------------------------------------------------------------------- +Wed Dec 8 08:33:48 UTC 2021 - pgajdos@suse.com + +- version update to 1.2.1 + * no upstream changelog +- deleted patches + - virtualenv-20.patch (upstreamed) + +------------------------------------------------------------------- +Wed Dec 8 07:33:48 UTC 2021 - pgajdos@suse.com + +- do not require pytest-runner for build, it is not needed + ------------------------------------------------------------------- Fri May 15 08:53:13 UTC 2020 - Tomáš Chvátal diff --git a/python-pytest-console-scripts.spec b/python-pytest-console-scripts.spec index 74542bf..287a142 100644 --- a/python-pytest-console-scripts.spec +++ b/python-pytest-console-scripts.spec @@ -1,7 +1,7 @@ # # spec file for package python-pytest-console-scripts # -# Copyright (c) 2020 SUSE LLC +# Copyright (c) 2021 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -19,24 +19,23 @@ %{?!python_module:%define python_module() python-%{**} python3-%{**}} %define skip_python2 1 Name: python-pytest-console-scripts -Version: 0.2.0 +Version: 1.2.1 Release: 0 Summary: Pytest plugin for testing console scripts License: MIT URL: https://github.com/kvas-it/pytest-console-scripts Source: https://files.pythonhosted.org/packages/source/p/pytest-console-scripts/pytest-console-scripts-%{version}.tar.gz -Patch0: virtualenv-20.patch BuildRequires: %{python_module setuptools} BuildRequires: fdupes BuildRequires: python-rpm-macros Requires: python-mock >= 2.0.0 Requires: python-pytest >= 4.0.0 -Requires: python-pytest-runner BuildArch: noarch # SECTION test requirements BuildRequires: %{python_module mock >= 2.0.0} BuildRequires: %{python_module pytest >= 4.0.0} BuildRequires: %{python_module pytest-runner} +BuildRequires: %{python_module setuptools_scm} BuildRequires: %{python_module virtualenv >= 20} # /SECTION %python_subpackages @@ -61,11 +60,12 @@ much as possible. %python_expand %fdupes %{buildroot}%{$python_sitelib} %check +sed -i 's:env python:env python3:' tests/test_run_scripts.py %pytest %files %{python_files} %license LICENSE -%doc README.rst +%doc README.md %{python_sitelib}/* %changelog diff --git a/virtualenv-20.patch b/virtualenv-20.patch deleted file mode 100644 index 57e4be0..0000000 --- a/virtualenv-20.patch +++ /dev/null @@ -1,106 +0,0 @@ -From 3ee9419066c5d789854b55112472444053d4c7b5 Mon Sep 17 00:00:00 2001 -From: Vasily Kuznetsov -Date: Fri, 13 Mar 2020 16:18:24 +0100 -Subject: [PATCH] Update the tests and make them compatible with virtualenv - v.20 (#31) - ---- - pytest_console_scripts.py | 5 ++++- - tests/test_run_scripts.py | 33 +++++++++++++++++++++++++-------- - 4 files changed, 42 insertions(+), 13 deletions(-) - -diff --git a/pytest_console_scripts.py b/pytest_console_scripts.py -index dbeb5ee..a5c0c1e 100644 ---- a/pytest_console_scripts.py -+++ b/pytest_console_scripts.py -@@ -146,7 +146,10 @@ def _restore_logger(self, config): - - def run_inprocess(self, command, *arguments, **options): - cmdargs = [command] + list(arguments) -- script = py.path.local(distutils.spawn.find_executable(command)) -+ script_path = distutils.spawn.find_executable(command) -+ if script_path is None: -+ raise FileNotFoundError('Cannot execute ' + command) -+ script = py.path.local(script_path) - stdin = options.get('stdin', StreamMock()) - stdout = StreamMock() - stderr = StreamMock() -diff --git a/tests/test_run_scripts.py b/tests/test_run_scripts.py -index 2a0a9d2..3f76d5d 100644 ---- a/tests/test_run_scripts.py -+++ b/tests/test_run_scripts.py -@@ -1,9 +1,8 @@ -+import json - import os - import subprocess - import sys - --import mock --import py - import pytest - import virtualenv - -@@ -32,6 +31,7 @@ def __init__(self, path): - dpp = self._distpackages_path() - if dpp is not None: - self.path.mkdir(dpp) -+ self.sys_path = self._get_sys_path() - - def _distpackages_path(self): - """Return (relative) path used for installing distribution packages. -@@ -51,18 +51,33 @@ def _distpackages_path(self): - parts = parts[parts.index('lib'):] - return os.path.join(*parts) - -- def _update_env(self, env): -+ def _get_sys_path(self): -+ """Return sys.path of this virtualenv.""" -+ result = self.run([ -+ 'python', '-c', -+ 'import json,sys; print(json.dumps(sys.path))', -+ ], skip_pythonpath=True) -+ assert result.returncode == 0 -+ return json.loads(str(result.stdout.read(), encoding='utf-8')) -+ -+ def _update_env(self, env, skip_pythonpath=False): - bin_dir = self.path.join('bin').strpath - env['PATH'] = bin_dir + ':' + env.get('PATH', '') -+ if 'PYTHONHOME' in env: -+ del env['PYTHONHOME'] - env['VIRTUAL_ENV'] = self.path.strpath -+ if skip_pythonpath: -+ return - # Make installed packages of the Python installation that runs this - # test accessible. This allows us to run tests in the virtualenv - # without installing all the dependencies there. -- env['PYTHONPATH'] = ':'.join(sys.path) -+ python_path = set(sys.path + self.sys_path) -+ env['PYTHONPATH'] = ':'.join(python_path) - -- def run(self, cmd, *args, **kw): -+ def run(self, cmd, skip_pythonpath=False, *args, **kw): - """Run a command in the virtualenv, return terminated process.""" -- self._update_env(kw.setdefault('env', dict(os.environ))) -+ self._update_env(kw.setdefault('env', dict(os.environ)), -+ skip_pythonpath=skip_pythonpath) - kw.setdefault('stdout', subprocess.PIPE) - kw.setdefault('stderr', subprocess.PIPE) - proc = subprocess.Popen(cmd, *args, **kw) -@@ -75,14 +90,16 @@ def install_console_script(self, cmd, script_path): - script_name = script_path.purebasename - setup_py = script_dir.join('setup.py') - setup_py.write(SETUP_TEMPLATE.format(cmd=cmd, script_name=script_name)) -- self.run(['python', 'setup.py', 'develop'], cwd=str(script_dir)) -+ result = self.run(['python', 'setup.py', 'develop'], -+ cwd=str(script_dir), skip_pythonpath=True) -+ assert result.returncode == 0 - - - @pytest.fixture(scope='session') - def pcs_venv(tmpdir_factory): - """Virtualenv for testing console scripts.""" - venv = tmpdir_factory.mktemp('venv') -- virtualenv.create_environment(venv.strpath) -+ virtualenv.cli_run([venv.strpath]) - yield VEnvWrapper(venv) -