diff --git a/.gitignore b/.gitignore index 7bdde95..11ab87d 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,4 @@ /stestr-1.1.0.tar.gz /stestr-2.1.0.tar.gz /stestr-2.2.0.tar.gz +/stestr-2.3.1.tar.gz diff --git a/0001-Discover-python-executable-when-discover-is-not-used.patch b/0001-Discover-python-executable-when-discover-is-not-used.patch new file mode 100644 index 0000000..7444204 --- /dev/null +++ b/0001-Discover-python-executable-when-discover-is-not-used.patch @@ -0,0 +1,38 @@ +From 2dc62b3a102a9cbb8bd2620433fc57043feec397 Mon Sep 17 00:00:00 2001 +From: Alfredo Moralejo +Date: Tue, 14 May 2019 15:35:15 +0200 +Subject: [PATCH] Discover python executable when discover is not used + +Currently it's hardcoded to 'python' wich in some cases may not exist, +as in some distros with python3 only. + +This patch uses PYTHON env variable if defined or executable used to run +stestr. +--- + stestr/commands/run.py | 10 +++++++++- + 1 file changed, 9 insertions(+), 1 deletion(-) + +diff --git a/stestr/commands/run.py b/stestr/commands/run.py +index c269890..8930c0e 100644 +--- a/stestr/commands/run.py ++++ b/stestr/commands/run.py +@@ -348,7 +348,15 @@ def run_command(config='.stestr.conf', repo_type='file', + if ids.find('/') != -1: + root = ids.replace('.py', '') + ids = root.replace('/', '.') +- run_cmd = 'python -m subunit.run ' + ids ++ stestr_python = sys.executable ++ if os.environ.get('PYTHON'): ++ python_bin = os.environ.get('PYTHON') ++ elif stestr_python: ++ python_bin = stestr_python ++ else: ++ raise RuntimeError("The Python interpreter was not found and " ++ "PYTHON is not set") ++ run_cmd = python_bin + ' -m subunit.run ' + ids + + def run_tests(): + run_proc = [('subunit', output.ReturnCodeToSubunit( +-- +2.20.1 + diff --git a/python-stestr.spec b/python-stestr.spec index abaddc4..21a4b21 100644 --- a/python-stestr.spec +++ b/python-stestr.spec @@ -20,15 +20,19 @@ which enabled testr to work with any subunit emitting runner are gone. \ stestr hard codes python-subunit-isms into how it works. Name: python-%{pypi_name} -Version: 2.2.0 +Version: 2.3.1 Release: 1%{?dist} Summary: A test runner runner similar to testrepository License: ASL 2.0 URL: https://pypi.python.org/pypi/stestr Source0: https://files.pythonhosted.org/packages/source/s/%{pypi_name}/%{pypi_name}-%{version}.tar.gz +# Fix for finding python version until new release > 2.3.1 is available. +Patch1: 0001-Discover-python-executable-when-discover-is-not-used.patch BuildArch: noarch +BuildRequires: git + %description %{common_desc} @@ -144,7 +148,7 @@ It contains the documentation for stestr. %endif %prep -%autosetup -n %{pypi_name}-%{version} +%autosetup -n %{pypi_name}-%{version} -S git # Remove bundled egg-info rm -rf %{pypi_name}.egg-info rm -f test-requirements.txt requirements.txt @@ -231,6 +235,10 @@ PYTHON=%{__python3} %{__python3} setup.py test || : %endif %changelog +* Fri Jun 07 2019 Alfredo Moralejo - 2.3.1-1 +- Update to 2.3.1 +- Included patch "Discover python executable when discover is not used" + * Thu Feb 14 2019 Yatin Karel - 2.2.0-1 - Update to 2.2.0 and Enable py2 build for CentOS <= 7 diff --git a/sources b/sources index 4d59611..59289c0 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (stestr-2.2.0.tar.gz) = 5b1944057abd0f6e177e5313f07bb47357f88adee5cc26bbfbe9893e741acfe7ed9459a66b86c929cbd236845dde357af4a5cc5134c9cca516183d0128979147 +SHA512 (stestr-2.3.1.tar.gz) = 1a100f017a5f141e81282dc60c096d77a344479c643c3074e248849c1293fca3bfa16ad7e1ab13f58e844d3625449b51b74aff3723ed00e6f6ec7df3055bb391