Hello community,

here is the log from the commit of package python-ipdb for openSUSE:Factory 
checked in at 2020-12-16 11:00:55
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-ipdb (Old)
 and      /work/SRC/openSUSE:Factory/.python-ipdb.new.2328 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "python-ipdb"

Wed Dec 16 11:00:55 2020 rev:8 rq:856024 version:0.13.4

Changes:
--------
--- /work/SRC/openSUSE:Factory/python-ipdb/python-ipdb.changes  2020-06-29 
21:19:13.181942612 +0200
+++ /work/SRC/openSUSE:Factory/.python-ipdb.new.2328/python-ipdb.changes        
2020-12-16 11:00:56.831596987 +0100
@@ -1,0 +2,11 @@
+Tue Dec 15 12:52:40 UTC 2020 - Benjamin Greiner <c...@bnavigator.de>
+
+- Update to 0.13.4
+  * Add '-m' option [mrmino]
+- Switch to pyunittest macro to avoid external mock package
+- Upstream calls the entrypoint ipdb3, no reason to be different,
+  call proper python_clone for it.
+- Provide the old jupyter package name only for the primary
+  Python3 interpreter -- gh#openSUSE/python-rpm-macros#66
+
+-------------------------------------------------------------------

Old:
----
  ipdb-0.13.3.tar.gz

New:
----
  ipdb-0.13.4.tar.gz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ python-ipdb.spec ++++++
--- /var/tmp/diff_new_pack.0zZJOh/_old  2020-12-16 11:00:57.383597529 +0100
+++ /var/tmp/diff_new_pack.0zZJOh/_new  2020-12-16 11:00:57.383597529 +0100
@@ -19,7 +19,7 @@
 %{?!python_module:%define python_module() python-%{**} python3-%{**}}
 %define         skip_python2 1
 Name:           python-ipdb
-Version:        0.13.3
+Version:        0.13.4
 Release:        0
 Summary:        IPython-enabled pdb
 License:        BSD-3-Clause
@@ -36,7 +36,7 @@
 Provides:       python-jupyter_ipdb = %{version}
 Obsoletes:      python-jupyter_ipdb < %{version}
 BuildArch:      noarch
-%ifpython3
+%if "%{python_flavor}" == "python3" || "%{?python_provides}"  == "python3"
 Provides:       jupyter-ipdb = %{version}
 %endif
 %python_subpackages
@@ -54,28 +54,22 @@
 
 %install
 %python_install
+%python_clone -a %{buildroot}%{_bindir}/ipdb3
 %python_expand %fdupes %{buildroot}%{$python_sitelib}
-%if 0%{?have_python2} && ! 0%{?skip_python2}
-mv -v %{buildroot}%{_bindir}/ipdb{,-%{python2_bin_suffix}}
-%endif
-%if 0%{?have_python3} && ! 0%{?skip_python3}
-mv -v %{buildroot}%{_bindir}/ipdb{3,-%{python3_bin_suffix}}
-%endif
-%prepare_alternative ipdb
 
 %post
-%python_install_alternative ipdb
+%python_install_alternative ipdb3
 
 %postun
-%python_uninstall_alternative ipdb
+%python_uninstall_alternative ipdb3
 
 %check
-%python_exec setup.py test
+%pyunittest -v
 
 %files %{python_files}
 %doc AUTHORS HISTORY.txt README.rst
 %license COPYING.txt
-%python_alternative %{_bindir}/ipdb
+%python_alternative %{_bindir}/ipdb3
 %{python_sitelib}/*
 
 %changelog

++++++ ipdb-0.13.3.tar.gz -> ipdb-0.13.4.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/ipdb-0.13.3/HISTORY.txt new/ipdb-0.13.4/HISTORY.txt
--- old/ipdb-0.13.3/HISTORY.txt 2020-06-23 15:46:29.000000000 +0200
+++ new/ipdb-0.13.4/HISTORY.txt 2020-10-01 16:13:45.000000000 +0200
@@ -1,6 +1,13 @@
 Changelog
 =========
 
+0.13.4 (2020-10-01)
+-------------------
+
+- Add '-m' option
+  [mrmino]
+
+
 0.13.3 (2020-06-23)
 -------------------
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/ipdb-0.13.3/PKG-INFO new/ipdb-0.13.4/PKG-INFO
--- old/ipdb-0.13.3/PKG-INFO    2020-06-23 15:46:30.000000000 +0200
+++ new/ipdb-0.13.4/PKG-INFO    2020-10-01 16:13:46.000000000 +0200
@@ -1,6 +1,6 @@
 Metadata-Version: 1.2
 Name: ipdb
-Version: 0.13.3
+Version: 0.13.4
 Summary: IPython-enabled pdb
 Home-page: https://github.com/gotcha/ipdb
 Author: Godefroid Chapelle
@@ -178,6 +178,13 @@
         Changelog
         =========
         
+        0.13.4 (2020-10-01)
+        -------------------
+        
+        - Add '-m' option
+          [mrmino]
+        
+        
         0.13.3 (2020-06-23)
         -------------------
         
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/ipdb-0.13.3/ipdb/__main__.py 
new/ipdb-0.13.4/ipdb/__main__.py
--- old/ipdb-0.13.3/ipdb/__main__.py    2020-06-23 15:46:29.000000000 +0200
+++ new/ipdb-0.13.4/ipdb/__main__.py    2020-10-01 16:13:45.000000000 +0200
@@ -10,7 +10,7 @@
 
 from contextlib import contextmanager
 
-__version__ = '0.13.3'
+__version__ = '0.13.4'
 
 from IPython import get_ipython
 from IPython.core.debugger import BdbQuit_excepthook
@@ -217,7 +217,7 @@
 
 
 _usage = """\
-usage: python -m ipdb [-c command] ... pyfile [arg] ...
+usage: python -m ipdb [-m] [-c command] ... pyfile [arg] ...
 
 Debug the Python program given by pyfile.
 
@@ -228,6 +228,9 @@
 To let the script run until an exception occurs, use "-c continue".
 To let the script run up to a given line X in the debugged file, use
 "-c 'until X'"
+
+Option -m is available only in Python 3.7 and later.
+
 ipdb version %s.""" % __version__
 
 
@@ -242,29 +245,36 @@
         class Restart(Exception):
             pass
 
-    opts, args = getopt.getopt(sys.argv[1:], 'hc:', ['help', 'command='])
+    if sys.version_info >= (3, 7):
+        opts, args = getopt.getopt(sys.argv[1:], 'mhc:', ['help', 'command='])
+    else:
+        opts, args = getopt.getopt(sys.argv[1:], 'hc:', ['help', 'command='])
 
     commands = []
+    run_as_module = False
     for opt, optarg in opts:
         if opt in ['-h', '--help']:
             print(_usage)
             sys.exit()
         elif opt in ['-c', '--command']:
             commands.append(optarg)
+        elif opt in ['-m']:
+            run_as_module = True
 
     if not args:
         print(_usage)
         sys.exit(2)
 
     mainpyfile = args[0]     # Get script filename
-    if not os.path.exists(mainpyfile):
+    if not run_as_module and not os.path.exists(mainpyfile):
         print('Error:', mainpyfile, 'does not exist')
         sys.exit(1)
 
     sys.argv = args     # Hide "pdb.py" from argument list
 
     # Replace pdb's dir with script's dir in front of module search path.
-    sys.path[0] = os.path.dirname(mainpyfile)
+    if not run_as_module:
+        sys.path[0] = os.path.dirname(mainpyfile)
 
     # Note on saving/restoring sys.argv: it's a good idea when sys.argv was
     # modified by the script being debugged. It's a bad idea when it was
@@ -273,7 +283,10 @@
     pdb = _init_pdb(commands=commands)
     while 1:
         try:
-            pdb._runscript(mainpyfile)
+            if run_as_module:
+                pdb._runmodule(mainpyfile)
+            else:
+                pdb._runscript(mainpyfile)
             if pdb._user_requested_quit:
                 break
             print("The program finished and will be restarted")
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/ipdb-0.13.3/ipdb.egg-info/PKG-INFO 
new/ipdb-0.13.4/ipdb.egg-info/PKG-INFO
--- old/ipdb-0.13.3/ipdb.egg-info/PKG-INFO      2020-06-23 15:46:30.000000000 
+0200
+++ new/ipdb-0.13.4/ipdb.egg-info/PKG-INFO      2020-10-01 16:13:46.000000000 
+0200
@@ -1,6 +1,6 @@
 Metadata-Version: 1.2
 Name: ipdb
-Version: 0.13.3
+Version: 0.13.4
 Summary: IPython-enabled pdb
 Home-page: https://github.com/gotcha/ipdb
 Author: Godefroid Chapelle
@@ -178,6 +178,13 @@
         Changelog
         =========
         
+        0.13.4 (2020-10-01)
+        -------------------
+        
+        - Add '-m' option
+          [mrmino]
+        
+        
         0.13.3 (2020-06-23)
         -------------------
         
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/ipdb-0.13.3/ipdb.egg-info/SOURCES.txt 
new/ipdb-0.13.4/ipdb.egg-info/SOURCES.txt
--- old/ipdb-0.13.3/ipdb.egg-info/SOURCES.txt   2020-06-23 15:46:30.000000000 
+0200
+++ new/ipdb-0.13.4/ipdb.egg-info/SOURCES.txt   2020-10-01 16:13:46.000000000 
+0200
@@ -18,4 +18,5 @@
 ipdb.egg-info/zip-safe
 tests/__init__.py
 tests/test_config.py
-tests/test_import.py
\ No newline at end of file
+tests/test_import.py
+tests/test_opts.py
\ No newline at end of file
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/ipdb-0.13.3/setup.py new/ipdb-0.13.4/setup.py
--- old/ipdb-0.13.3/setup.py    2020-06-23 15:46:29.000000000 +0200
+++ new/ipdb-0.13.4/setup.py    2020-10-01 16:13:45.000000000 +0200
@@ -60,6 +60,9 @@
           # No support for python 3.0, 3.1, 3.2.
           ':python_version >= "3.4"': ['ipython >= 5.1.0'],
       },
+      tests_require=[
+          'mock'
+      ],
       entry_points={
           'console_scripts': ['%s = ipdb.__main__:main' % console_script]
       }
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/ipdb-0.13.3/tests/test_opts.py 
new/ipdb-0.13.4/tests/test_opts.py
--- old/ipdb-0.13.3/tests/test_opts.py  1970-01-01 01:00:00.000000000 +0100
+++ new/ipdb-0.13.4/tests/test_opts.py  2020-10-01 16:13:45.000000000 +0200
@@ -0,0 +1,55 @@
+# Copyright (c) 2012-2016 Marc Abramowitz and ipdb development team
+#
+# This file is part of ipdb.
+# Redistributable under the revised BSD license
+# https://opensource.org/licenses/BSD-3-Clause
+
+import unittest
+try:
+    from unittest.mock import patch
+except ImportError:
+    from mock import patch
+
+from getopt import GetoptError
+from ipdb.__main__ import main
+
+
+@patch('ipdb.__main__.debugger_cls')
+class OptsTest(unittest.TestCase):
+    def set_argv(self, *argv):
+        argv_patch = patch('ipdb.__main__.sys.argv', argv)
+        argv_patch.start()
+        self.addCleanup(argv_patch.stop)
+
+    @patch('ipdb.__main__.sys.version_info', (3, 7))
+    def test_debug_module_script(self, debugger_cls):
+        module_name = 'my_buggy_module'
+        self.set_argv('ipdb', '-m', module_name)
+
+        main()
+
+        debugger = debugger_cls.return_value
+        debugger._runmodule.assert_called_once_with(module_name)
+
+    @patch('ipdb.__main__.os.path.exists')
+    def test_debug_script(self, exists, debugger_cls):
+        script_name = 'my_buggy_script'
+        self.set_argv('ipdb', script_name)
+
+        main()
+
+        debugger = debugger_cls.return_value
+        debugger._runscript.assert_called_once_with(script_name)
+
+    def test_option_m_fallback_on_py36(self, debugger_cls):
+        self.set_argv('ipdb', '-m', 'my.module')
+        with patch('ipdb.__main__.sys.version_info', (3, 6)):
+            with self.assertRaises(GetoptError):
+                main()
+
+        with patch('ipdb.__main__.sys.version_info', (3, 7)):
+            self.set_argv('ipdb', '-m', 'my.module')
+            try:
+                main()
+            except GetoptError:
+                self.fail("GetoptError raised unexpectedly.")
_______________________________________________
openSUSE Commits mailing list -- commit@lists.opensuse.org
To unsubscribe, email commit-le...@lists.opensuse.org
List Netiquette: https://en.opensuse.org/openSUSE:Mailing_list_netiquette
List Archives: 
https://lists.opensuse.org/archives/list/commit@lists.opensuse.org

Reply via email to