Script 'mail_helper' called by obssrc
Hello community,
here is the log from the commit of package python-ruamel.std.argparse for
openSUSE:Factory checked in at 2021-02-15 23:15:42
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-ruamel.std.argparse (Old)
and /work/SRC/openSUSE:Factory/.python-ruamel.std.argparse.new.28504 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-ruamel.std.argparse"
Mon Feb 15 23:15:42 2021 rev:5 rq:871389 version:0.8.3+hg.34
Changes:
--------
---
/work/SRC/openSUSE:Factory/python-ruamel.std.argparse/python-ruamel.std.argparse.changes
2021-02-10 21:31:25.450374493 +0100
+++
/work/SRC/openSUSE:Factory/.python-ruamel.std.argparse.new.28504/python-ruamel.std.argparse.changes
2021-02-15 23:17:44.079524347 +0100
@@ -1,0 +2,18 @@
+Thu Feb 11 16:27:11 UTC 2021 - Matej Cepl <[email protected]>
+
+- Add discover-name-of-the-pytest-executable-at-runtime.patch
+
+ Original code had hard-coded name of 'py.test', but that
+ coname uld be very flexible. Either this name is discovered
+ automagically, or the user can set variable PYTEST_EXECUTABLE,
+ which is honored.
+
+ Filed as https://sourceforge.net/p/ruamel-std-argparse/tickets/4/
+
+-------------------------------------------------------------------
+Wed Feb 10 17:38:06 UTC 2021 - Matej Cepl <[email protected]>
+
+- Add _service and pull from the upstream VCS
+ (https://sourceforge.net/p/ruamel-std-argparse/tickets/3/).
+
+-------------------------------------------------------------------
Old:
----
ruamel.std.argparse-0.8.3.tar.gz
New:
----
_service
code-0.8.3+hg.34.obscpio
code-0.8.3+hg.34.tar.gz
code.obsinfo
discover-name-of-the-pytest-executable-at-runtime.patch
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ python-ruamel.std.argparse.spec ++++++
--- /var/tmp/diff_new_pack.MpvRco/_old 2021-02-15 23:17:44.879525541 +0100
+++ /var/tmp/diff_new_pack.MpvRco/_new 2021-02-15 23:17:44.883525547 +0100
@@ -16,17 +16,25 @@
#
+%define skip_python2 1
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
Name: python-ruamel.std.argparse
-Version: 0.8.3
+Version: 0.8.3+hg.34
Release: 0
Summary: Enhancements to argparse
License: MIT
Group: Development/Languages/Python
URL: https://sourceforge.net/p/ruamel-std-argparse
-Source:
https://files.pythonhosted.org/packages/source/r/ruamel.std.argparse/ruamel.std.argparse-%{version}.tar.gz
+# Pull code from the checkout because of
https://sourceforge.net/p/ruamel-std-argparse/tickets/3/
+# Source:
https://files.pythonhosted.org/packages/source/r/ruamel.std.argparse/ruamel.std.argparse-%%{version}.tar.gz
+Source: code-%{version}.tar.gz
+# PATCH-FEATURE-OPENSUSE
discover-name-of-the-pytest-executable-at-runtime.patch
https://sourceforge.net/p/ruamel-std-argparse/tickets/4/ [email protected]
+# Automagically discover pytest executable name in runtime.
+Patch0: discover-name-of-the-pytest-executable-at-runtime.patch
+BuildRequires: %{python_module pytest}
BuildRequires: %{python_module setuptools}
BuildRequires: fdupes
+BuildRequires: git
BuildRequires: python-rpm-macros
Requires: python-ruamel.base
%ifpython2
@@ -41,7 +49,8 @@
smart formatter, and a decorator based wrapper.
%prep
-%setup -q -n ruamel.std.argparse-%{version}
+%setup -q -n code-%{version}
+%autopatch -p1
%build
%python_build
@@ -51,6 +60,9 @@
%python_install
%python_expand %fdupes %{buildroot}%{$python_sitelib}
+%check
+%pytest -vv
+
%files %{python_files}
%doc README.rst
%license LICENSE
++++++ _service ++++++
<services>
<service mode="disabled" name="obs_scm">
<param name="url">http://hg.code.sf.net/p/ruamel-std-argparse/code</param>
<param name="versionprefix">0.8.3+hg</param>
<param name="scm">hg</param>
</service>
<service mode="buildtime" name="tar" />
<service mode="buildtime" name="recompress">
<param name="file">*.tar</param>
<param name="compression">gz</param>
</service>
<service mode="disabled" name="set_version"/>
</services>
++++++ code.obsinfo ++++++
name: code
version: 0.8.3+hg.34
mtime: 1585554420
++++++ discover-name-of-the-pytest-executable-at-runtime.patch ++++++
>From d7373adeee526c67ff0cef83d166bd9579399c22 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Mat=C4=9Bj=20Cepl?= <[email protected]>
Date: Thu, 11 Feb 2021 17:17:49 +0100
Subject: [PATCH] Discover name of the pytest executable at runtime.
Original code had hard-coded name of 'py.test', but that name
could be very flexible. Either this name is discovered
automagically, or the user can set variable PYTEST_EXECUTABLE,
which is honored.
---
_test/__init__.py | 6 ++++++
_test/test_argparse.py | 20 +++++++++++---------
_test/test_program.py | 4 +++-
3 files changed, 20 insertions(+), 10 deletions(-)
create mode 100644 _test/__init__.py
--- /dev/null
+++ b/_test/__init__.py
@@ -0,0 +1,6 @@
+import os
+import os.path
+import sys
+
+PYTEST_EXECUTABLE = os.environ.get('PYTEST_EXECUTABLE') or \
+ os.path.basename(sys.argv[0])
--- a/_test/test_program.py
+++ b/_test/test_program.py
@@ -8,6 +8,7 @@ import sys
import pytest
from ruamel.std.argparse import ProgramBase, option, sub_parser, version
+from _test import PYTEST_EXECUTABLE
class Program(ProgramBase):
@@ -213,11 +214,12 @@ class TestProgram:
assert pho.start('optional arguments', '--extra')
assert pho.start('optional arguments', '--verbose')
+
def test_git_sub_sub_sub_parser(self, capsys, program):
with pytest.raises(SystemExit):
program._parse_args('git hihi oops -h'.split())
pho = ParseHelpOutput(capsys)
- assert pho.start('usage', 'py.test git hihi oops')
+ assert pho.start('usage', '{} git hihi oops'.format(PYTEST_EXECUTABLE))
assert pho.start('optional arguments', '--verbose')
def test_version(self, capsys, program):
--- a/_test/test_argparse.py
+++ b/_test/test_argparse.py
@@ -6,6 +6,7 @@ import pytest # NOQA < so flake doesn'
from ruamel.std.argparse import argparse, SmartFormatter
from textwrap import dedent
+from _test import PYTEST_EXECUTABLE
def exit(self=None, status=None, message=None):
@@ -43,16 +44,16 @@ def test_argparse(capsys):
parser.parse_args(['--help'])
out, err = capsys.readouterr()
full_help = dedent("""\
- usage: pytest [-h] [--verbose] [--list LIST] [--oneline]
+ usage: {} [-h] [--verbose] [--list LIST] [--oneline]
- {0}
+ {}
optional arguments:
-h, --help show this help message and exit
- --verbose {1}
- --list LIST {2}
+ --verbose {}
+ --list LIST {}
--oneline one line help
""").format(
- desc, help_verbose,
+ PYTEST_EXECUTABLE, desc, help_verbose,
help_list.lstrip().replace('\n ', '\n ').rstrip(),
)
assert full_help == out
@@ -90,16 +91,17 @@ def test_argparse_default(capsys):
parser.parse_args(['--help'])
out, err = capsys.readouterr()
full_help = dedent("""\
- usage: pytest [-h] [--verbose] [--list LIST] [--oneline]
+ usage: {} [-h] [--verbose] [--list LIST] [--oneline]
- {0}
+ {}
optional arguments:
-h, --help show this help message and exit
- --verbose {1} (default: False)
- --list LIST {2}
+ --verbose {}
+ --list LIST {}
(default: None)
--oneline one line help (default: False)
""").format(
+ PYTEST_EXECUTABLE,
desc, help_verbose,
help_list.lstrip().replace('\n ', '\n ').rstrip(),
)