Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package python-ipdb for openSUSE:Factory checked in at 2021-09-22 22:13:03 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-ipdb (Old) and /work/SRC/openSUSE:Factory/.python-ipdb.new.1899 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-ipdb" Wed Sep 22 22:13:03 2021 rev:9 rq:920993 version:0.13.9 Changes: -------- --- /work/SRC/openSUSE:Factory/python-ipdb/python-ipdb.changes 2020-12-16 11:00:56.831596987 +0100 +++ /work/SRC/openSUSE:Factory/.python-ipdb.new.1899/python-ipdb.changes 2021-09-22 22:13:25.628346465 +0200 @@ -1,0 +2,8 @@ +Sun Sep 19 11:40:19 UTC 2021 - Ben Greiner <[email protected]> + +- Update to 0.13.9 + * Add the convenience function ``iex()` + * Do not instantiate IPython on import + * Add support for pyproject.toml as configuration file + +------------------------------------------------------------------- Old: ---- ipdb-0.13.4.tar.gz New: ---- ipdb-0.13.9.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-ipdb.spec ++++++ --- /var/tmp/diff_new_pack.B3ebwY/_old 2021-09-22 22:13:26.240346973 +0200 +++ /var/tmp/diff_new_pack.B3ebwY/_new 2021-09-22 22:13:26.244346977 +0200 @@ -1,7 +1,7 @@ # # spec file for package python-ipdb # -# 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,20 +19,24 @@ %{?!python_module:%define python_module() python-%{**} python3-%{**}} %define skip_python2 1 Name: python-ipdb -Version: 0.13.4 +Version: 0.13.9 Release: 0 Summary: IPython-enabled pdb License: BSD-3-Clause Group: Development/Languages/Python URL: https://github.com/gotcha/ipdb Source: https://files.pythonhosted.org/packages/source/i/ipdb/ipdb-%{version}.tar.gz -BuildRequires: %{python_module ipython >= 5.1} +BuildRequires: %{python_module decorator} +BuildRequires: %{python_module ipython >= 7.10} BuildRequires: %{python_module setuptools} +BuildRequires: %{python_module toml >= 0.10.2} BuildRequires: fdupes BuildRequires: python-rpm-macros -Requires: python-ipython >= 5.1 +Recommends: python-decorator +Recommends: python-ipython >= 7.10 +Recommends: python-toml >= 0.10.2 Requires(post): update-alternatives -Requires(postun): update-alternatives +Requires(postun):update-alternatives Provides: python-jupyter_ipdb = %{version} Obsoletes: python-jupyter_ipdb < %{version} BuildArch: noarch ++++++ ipdb-0.13.4.tar.gz -> ipdb-0.13.9.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ipdb-0.13.4/AUTHORS new/ipdb-0.13.9/AUTHORS --- old/ipdb-0.13.4/AUTHORS 2020-10-01 16:13:45.000000000 +0200 +++ new/ipdb-0.13.9/AUTHORS 2021-06-02 13:43:42.000000000 +0200 @@ -23,3 +23,4 @@ Wilfred WouterVH zvodd +d1618033 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ipdb-0.13.4/HISTORY.txt new/ipdb-0.13.9/HISTORY.txt --- old/ipdb-0.13.4/HISTORY.txt 2020-10-01 16:13:45.000000000 +0200 +++ new/ipdb-0.13.9/HISTORY.txt 2021-06-02 13:43:42.000000000 +0200 @@ -1,6 +1,50 @@ Changelog ========= +0.13.9 (2021-06-02) +------------------- + +- Fix again when `pyproject.toml` does not contain `tool` section. + [markab108] + + +0.13.8 (2021-05-26) +------------------- + +- Fix when `pyproject.toml` does not contain `tool` section. + [anjos] + +- Add the convenience function ``iex()``. + [alanbernstein] + + +0.13.7 (2021-03-16) +------------------- + +- Do not instantiate IPython on import + [adamchainz] + + +0.13.6 (2021-03-08) +------------------- + +- Fix broken parsing of pyproject.toml + [alexandrebarbaruiva] + + +0.13.5 (2021-03-02) +------------------- + +- Add support for pyproject.toml as configuration file + [alexandrebarbaruiva] + +- For users using python 3.4, install 6.0.0 <= IPython < 7.0.0, + for users using python 3.5, install 7.0.0 <= IPython < 7.10.0, + for users using python 3.6, install 7.10.0 <= IPython < 7.17.0, + for users using python>3.6, install IPython >= 7.17.0. + [d1618033] + + 0.13.4 (2020-10-01) ------------------- diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ipdb-0.13.4/PKG-INFO new/ipdb-0.13.9/PKG-INFO --- old/ipdb-0.13.4/PKG-INFO 2020-10-01 16:13:46.000000000 +0200 +++ new/ipdb-0.13.9/PKG-INFO 2021-06-02 13:43:43.000000000 +0200 @@ -1,6 +1,6 @@ Metadata-Version: 1.2 Name: ipdb -Version: 0.13.4 +Version: 0.13.9 Summary: IPython-enabled pdb Home-page: https://github.com/gotcha/ipdb Author: Godefroid Chapelle @@ -47,11 +47,11 @@ Using configuration file ++++++++++++++++++++++++ - It's possible to set up context using a `.ipdb` file on your home folder or `setup.cfg` - on your project folder. You can also set your file location via env var `$IPDB_CONFIG`. - Your environment variable has priority over the home configuration file, - which in turn has priority over the setup config file. Currently, only context setting - is available. + It's possible to set up context using a `.ipdb` file on your home folder, `setup.cfg` + or `pyproject.toml` on your project folder. You can also set your file location via + env var `$IPDB_CONFIG`. Your environment variable has priority over the home + configuration file, which in turn has priority over the setup config file. + Currently, only context setting is available. A valid setup.cfg is as follows @@ -68,6 +68,14 @@ context=5 + A valid pyproject.toml is as follows + + :: + + [tool.ipdb] + context=5 + + The post-mortem function, ``ipdb.pm()``, is equivalent to the magic function ``%debug``. @@ -106,6 +114,16 @@ Adding a context manager implies dropping Python 2.4 support. Use ``ipdb==0.6`` with 2.4. + Or you can use ``iex`` as a function decorator to launch ipdb if an exception is raised: + + .. code-block:: python + + from ipdb import iex + + @iex + def main(): + [...] + .. warning:: Using ``from future import print_function`` for Python 3 compat implies dropping Python 2.5 support. Use ``ipdb<=0.8`` with 2.5. @@ -140,6 +158,8 @@ Pull requests should take care of updating the changelog ``HISTORY.txt``. + Under the unreleased section, add your changes and your username. + Manual testing ++++++++++++++ @@ -147,6 +167,12 @@ install IPython and run ``python manual_test.py`` and check if your changes are in effect. If possible, create automated tests for better behaviour control. + Automated testing + +++++++++++++++++ + + To run automated tests locally, create a virtual environment, install `coverage` + and run `coverage run setup.py test`. + Third-party support ------------------- @@ -178,6 +204,50 @@ Changelog ========= + 0.13.9 (2021-06-02) + ------------------- + + - Fix again when `pyproject.toml` does not contain `tool` section. + [markab108] + + + 0.13.8 (2021-05-26) + ------------------- + + - Fix when `pyproject.toml` does not contain `tool` section. + [anjos] + + - Add the convenience function ``iex()``. + [alanbernstein] + + + 0.13.7 (2021-03-16) + ------------------- + + - Do not instantiate IPython on import + [adamchainz] + + + 0.13.6 (2021-03-08) + ------------------- + + - Fix broken parsing of pyproject.toml + [alexandrebarbaruiva] + + + 0.13.5 (2021-03-02) + ------------------- + + - Add support for pyproject.toml as configuration file + [alexandrebarbaruiva] + + - For users using python 3.4, install 6.0.0 <= IPython < 7.0.0, + for users using python 3.5, install 7.0.0 <= IPython < 7.10.0, + for users using python 3.6, install 7.10.0 <= IPython < 7.17.0, + for users using python>3.6, install IPython >= 7.17.0. + [d1618033] + + 0.13.4 (2020-10-01) ------------------- diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ipdb-0.13.4/README.rst new/ipdb-0.13.9/README.rst --- old/ipdb-0.13.4/README.rst 2020-10-01 16:13:45.000000000 +0200 +++ new/ipdb-0.13.9/README.rst 2021-06-02 13:43:42.000000000 +0200 @@ -39,11 +39,11 @@ Using configuration file ++++++++++++++++++++++++ -It's possible to set up context using a `.ipdb` file on your home folder or `setup.cfg` -on your project folder. You can also set your file location via env var `$IPDB_CONFIG`. -Your environment variable has priority over the home configuration file, -which in turn has priority over the setup config file. Currently, only context setting -is available. +It's possible to set up context using a `.ipdb` file on your home folder, `setup.cfg` +or `pyproject.toml` on your project folder. You can also set your file location via +env var `$IPDB_CONFIG`. Your environment variable has priority over the home +configuration file, which in turn has priority over the setup config file. +Currently, only context setting is available. A valid setup.cfg is as follows @@ -60,6 +60,14 @@ context=5 +A valid pyproject.toml is as follows + +:: + + [tool.ipdb] + context=5 + + The post-mortem function, ``ipdb.pm()``, is equivalent to the magic function ``%debug``. @@ -98,6 +106,16 @@ Adding a context manager implies dropping Python 2.4 support. Use ``ipdb==0.6`` with 2.4. +Or you can use ``iex`` as a function decorator to launch ipdb if an exception is raised: + +.. code-block:: python + + from ipdb import iex + + @iex + def main(): + [...] + .. warning:: Using ``from future import print_function`` for Python 3 compat implies dropping Python 2.5 support. Use ``ipdb<=0.8`` with 2.5. @@ -132,6 +150,8 @@ Pull requests should take care of updating the changelog ``HISTORY.txt``. +Under the unreleased section, add your changes and your username. + Manual testing ++++++++++++++ @@ -139,6 +159,12 @@ install IPython and run ``python manual_test.py`` and check if your changes are in effect. If possible, create automated tests for better behaviour control. +Automated testing ++++++++++++++++++ + +To run automated tests locally, create a virtual environment, install `coverage` +and run `coverage run setup.py test`. + Third-party support ------------------- diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ipdb-0.13.4/ipdb/__init__.py new/ipdb-0.13.9/ipdb/__init__.py --- old/ipdb-0.13.4/ipdb/__init__.py 2020-10-01 16:13:45.000000000 +0200 +++ new/ipdb-0.13.9/ipdb/__init__.py 2021-06-02 13:43:42.000000000 +0200 @@ -4,7 +4,7 @@ # Redistributable under the revised BSD license # https://opensource.org/licenses/BSD-3-Clause -from ipdb.__main__ import set_trace, post_mortem, pm, run # noqa +from ipdb.__main__ import set_trace, post_mortem, pm, run, iex # noqa from ipdb.__main__ import runcall, runeval, launch_ipdb_on_exception # noqa from ipdb.stdout import sset_trace, spost_mortem, spm # noqa diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ipdb-0.13.4/ipdb/__main__.py new/ipdb-0.13.9/ipdb/__main__.py --- old/ipdb-0.13.4/ipdb/__main__.py 2020-10-01 16:13:45.000000000 +0200 +++ new/ipdb-0.13.9/ipdb/__main__.py 2021-06-02 13:43:42.000000000 +0200 @@ -8,9 +8,9 @@ import os import sys -from contextlib import contextmanager +from decorator import contextmanager -__version__ = '0.13.4' +__version__ = '0.13.9' from IPython import get_ipython from IPython.core.debugger import BdbQuit_excepthook @@ -22,34 +22,36 @@ import ConfigParser as configparser -shell = get_ipython() -if shell is None: - # Not inside IPython - # Build a terminal app in order to force ipython to load the - # configuration - ipapp = TerminalIPythonApp() - # Avoid output (banner, prints) - ipapp.interact = False - ipapp.initialize(['--no-term-title']) - shell = ipapp.shell -else: - # Running inside IPython - - # Detect if embed shell or not and display a message - if isinstance(shell, InteractiveShellEmbed): - sys.stderr.write( - "\nYou are currently into an embedded ipython shell,\n" - "the configuration will not be loaded.\n\n" - ) - -# Let IPython decide about which debugger class to use -# This is especially important for tools that fiddle with stdout -debugger_cls = shell.debugger_cls +def _get_debugger_cls(): + shell = get_ipython() + if shell is None: + # Not inside IPython + # Build a terminal app in order to force ipython to load the + # configuration + ipapp = TerminalIPythonApp() + # Avoid output (banner, prints) + ipapp.interact = False + ipapp.initialize(["--no-term-title"]) + shell = ipapp.shell + else: + # Running inside IPython + + # Detect if embed shell or not and display a message + if isinstance(shell, InteractiveShellEmbed): + sys.stderr.write( + "\nYou are currently into an embedded ipython shell,\n" + "the configuration will not be loaded.\n\n" + ) + + # Let IPython decide about which debugger class to use + # This is especially important for tools that fiddle with stdout + return shell.debugger_cls def _init_pdb(context=None, commands=[]): if context is None: context = os.getenv("IPDB_CONTEXT_SIZE", get_context_from_config()) + debugger_cls = _get_debugger_cls() try: p = debugger_cls(context=context) except TypeError: @@ -140,7 +142,7 @@ filepaths = [] # Low priority goes first in the list - for cfg_file in ("setup.cfg", ".ipdb"): + for cfg_file in ("setup.cfg", ".ipdb", "pyproject.toml"): cwd_filepath = os.path.join(os.getcwd(), cfg_file) if os.path.isfile(cwd_filepath): filepaths.append(cwd_filepath) @@ -170,7 +172,17 @@ # only if they use setup.cfg if filepath.endswith('setup.cfg'): with open(filepath) as f: + parser.remove_section("ipdb") read_func(f) + # To use on pyproject.toml, put [tool.ipdb] section + elif filepath.endswith('pyproject.toml'): + import toml + toml_file = toml.load(filepath) + if "tool" in toml_file and "ipdb" in toml_file["tool"]: + if not parser.has_section("ipdb"): + parser.add_section("ipdb") + for key, value in toml_file["tool"]["ipdb"].items(): + parser.set("ipdb", key, str(value)) else: read_func(ConfigFile(filepath)) return parser @@ -216,6 +228,10 @@ pass +# iex is a concise alias +iex = launch_ipdb_on_exception() + + _usage = """\ usage: python -m ipdb [-m] [-c command] ... pyfile [arg] ... diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ipdb-0.13.4/ipdb.egg-info/PKG-INFO new/ipdb-0.13.9/ipdb.egg-info/PKG-INFO --- old/ipdb-0.13.4/ipdb.egg-info/PKG-INFO 2020-10-01 16:13:46.000000000 +0200 +++ new/ipdb-0.13.9/ipdb.egg-info/PKG-INFO 2021-06-02 13:43:42.000000000 +0200 @@ -1,6 +1,6 @@ Metadata-Version: 1.2 Name: ipdb -Version: 0.13.4 +Version: 0.13.9 Summary: IPython-enabled pdb Home-page: https://github.com/gotcha/ipdb Author: Godefroid Chapelle @@ -47,11 +47,11 @@ Using configuration file ++++++++++++++++++++++++ - It's possible to set up context using a `.ipdb` file on your home folder or `setup.cfg` - on your project folder. You can also set your file location via env var `$IPDB_CONFIG`. - Your environment variable has priority over the home configuration file, - which in turn has priority over the setup config file. Currently, only context setting - is available. + It's possible to set up context using a `.ipdb` file on your home folder, `setup.cfg` + or `pyproject.toml` on your project folder. You can also set your file location via + env var `$IPDB_CONFIG`. Your environment variable has priority over the home + configuration file, which in turn has priority over the setup config file. + Currently, only context setting is available. A valid setup.cfg is as follows @@ -68,6 +68,14 @@ context=5 + A valid pyproject.toml is as follows + + :: + + [tool.ipdb] + context=5 + + The post-mortem function, ``ipdb.pm()``, is equivalent to the magic function ``%debug``. @@ -106,6 +114,16 @@ Adding a context manager implies dropping Python 2.4 support. Use ``ipdb==0.6`` with 2.4. + Or you can use ``iex`` as a function decorator to launch ipdb if an exception is raised: + + .. code-block:: python + + from ipdb import iex + + @iex + def main(): + [...] + .. warning:: Using ``from future import print_function`` for Python 3 compat implies dropping Python 2.5 support. Use ``ipdb<=0.8`` with 2.5. @@ -140,6 +158,8 @@ Pull requests should take care of updating the changelog ``HISTORY.txt``. + Under the unreleased section, add your changes and your username. + Manual testing ++++++++++++++ @@ -147,6 +167,12 @@ install IPython and run ``python manual_test.py`` and check if your changes are in effect. If possible, create automated tests for better behaviour control. + Automated testing + +++++++++++++++++ + + To run automated tests locally, create a virtual environment, install `coverage` + and run `coverage run setup.py test`. + Third-party support ------------------- @@ -178,6 +204,50 @@ Changelog ========= + 0.13.9 (2021-06-02) + ------------------- + + - Fix again when `pyproject.toml` does not contain `tool` section. + [markab108] + + + 0.13.8 (2021-05-26) + ------------------- + + - Fix when `pyproject.toml` does not contain `tool` section. + [anjos] + + - Add the convenience function ``iex()``. + [alanbernstein] + + + 0.13.7 (2021-03-16) + ------------------- + + - Do not instantiate IPython on import + [adamchainz] + + + 0.13.6 (2021-03-08) + ------------------- + + - Fix broken parsing of pyproject.toml + [alexandrebarbaruiva] + + + 0.13.5 (2021-03-02) + ------------------- + + - Add support for pyproject.toml as configuration file + [alexandrebarbaruiva] + + - For users using python 3.4, install 6.0.0 <= IPython < 7.0.0, + for users using python 3.5, install 7.0.0 <= IPython < 7.10.0, + for users using python 3.6, install 7.10.0 <= IPython < 7.17.0, + for users using python>3.6, install IPython >= 7.17.0. + [d1618033] + + 0.13.4 (2020-10-01) ------------------- diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ipdb-0.13.4/ipdb.egg-info/requires.txt new/ipdb-0.13.9/ipdb.egg-info/requires.txt --- old/ipdb-0.13.4/ipdb.egg-info/requires.txt 2020-10-01 16:13:46.000000000 +0200 +++ new/ipdb-0.13.9/ipdb.egg-info/requires.txt 2021-06-02 13:43:42.000000000 +0200 @@ -2,6 +2,25 @@ [:python_version == "2.7"] ipython<6.0.0,>=5.1.0 +toml>=0.10.2 +decorator<5.0.0 -[:python_version >= "3.4"] -ipython>=5.1.0 +[:python_version == "3.4"] +ipython<7.0.0,>=6.0.0 +toml>=0.10.2 +decorator<5.0.0 + +[:python_version == "3.5"] +ipython<7.10.0,>=7.0.0 +toml>=0.10.2 +decorator + +[:python_version == "3.6"] +ipython<7.17.0,>=7.10.0 +toml>=0.10.2 +decorator + +[:python_version > "3.6"] +ipython>=7.17.0 +toml>=0.10.2 +decorator diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ipdb-0.13.4/setup.py new/ipdb-0.13.9/setup.py --- old/ipdb-0.13.4/setup.py 2020-10-01 16:13:45.000000000 +0200 +++ new/ipdb-0.13.9/setup.py 2021-06-02 13:43:42.000000000 +0200 @@ -53,15 +53,19 @@ test_suite='tests', python_requires=">=2.7", install_requires=[ - 'setuptools' + 'setuptools', ], extras_require={ - ':python_version == "2.7"': ['ipython >= 5.1.0, < 6.0.0'], + ':python_version == "2.7"': ['ipython >= 5.1.0, < 6.0.0', 'toml >= 0.10.2', 'decorator < 5.0.0'], # No support for python 3.0, 3.1, 3.2. - ':python_version >= "3.4"': ['ipython >= 5.1.0'], + # FTR, `decorator` is also a dependency of Ipython. + ':python_version == "3.4"': ['ipython >= 6.0.0, < 7.0.0', 'toml >= 0.10.2', 'decorator < 5.0.0'], + ':python_version == "3.5"': ['ipython >= 7.0.0, < 7.10.0', 'toml >= 0.10.2', 'decorator'], + ':python_version == "3.6"': ['ipython >= 7.10.0, < 7.17.0', 'toml >= 0.10.2', 'decorator'], + ':python_version > "3.6"': ['ipython >= 7.17.0', 'toml >= 0.10.2', 'decorator'], }, tests_require=[ - 'mock' + 'mock; python_version<"3"' ], entry_points={ 'console_scripts': ['%s = ipdb.__main__:main' % console_script] diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ipdb-0.13.4/tests/test_config.py new/ipdb-0.13.9/tests/test_config.py --- old/ipdb-0.13.4/tests/test_config.py 2020-10-01 16:13:45.000000000 +0200 +++ new/ipdb-0.13.9/tests/test_config.py 2021-06-02 13:43:42.000000000 +0200 @@ -93,14 +93,91 @@ "context = {}".format(str(self.setup_context)), ], ) + self.pyproject_filename = os.path.join(cwd_dir, "pyproject.toml") + self.pyproject_context = 30 + self._write_file( + self.pyproject_filename, + [ + "[tool.ipdb]", + "context = {}".format(str(self.pyproject_context)), + ], + ) + + def test_noenv_nodef_nosetup_pyproject(self): + """ + Setup: $IPDB_CONFIG unset, $HOME/.ipdb does not exist, + setup.cfg does not exist, pyproject.toml exists + Result: load pyproject.toml + """ + os.unlink(self.env_filename) + os.unlink(self.default_filename) + os.remove(self.setup_filename) + with ModifiedEnvironment(IPDB_CONFIG=None, HOME=self.tmpd): + cfg = get_config() + self.assertEqual(["ipdb"], cfg.sections()) + self.assertEqual(self.pyproject_context, cfg.getint("ipdb", "context")) + self.assertRaises(configparser.NoOptionError, cfg.get, "ipdb", "version") + + def test_env_nodef_setup_pyproject(self): + """ + Setup: $IPDB_CONFIG is set, $HOME/.ipdb does not exist, + setup.cfg exists, pyproject.toml exists + Result: load $IPDB_CONFIG + """ + os.unlink(self.default_filename) + with ModifiedEnvironment(IPDB_CONFIG=self.env_filename, HOME=self.tmpd): + cfg = get_config() + self.assertEqual(["ipdb"], cfg.sections()) + self.assertEqual(self.env_context, cfg.getint("ipdb", "context")) + self.assertRaises(configparser.NoOptionError, cfg.get, "ipdb", "version") + + def test_env_def_setup_pyproject(self): + """ + Setup: $IPDB_CONFIG is set, $HOME/.ipdb exists, + setup.cfg exists, pyproject.toml exists + Result: load $IPDB_CONFIG + """ + with ModifiedEnvironment(IPDB_CONFIG=self.env_filename, HOME=self.tmpd): + cfg = get_config() + self.assertEqual(["ipdb"], cfg.sections()) + self.assertEqual(self.env_context, cfg.getint("ipdb", "context")) + self.assertRaises(configparser.NoOptionError, cfg.get, "ipdb", "version") + + def test_noenv_nodef_setup_pyproject(self): + """ + Setup: $IPDB_CONFIG unset, $HOME/.ipdb does not exist, + setup.cfg exists, pyproject.toml exists + Result: load pyproject.toml + """ + os.unlink(self.env_filename) + os.unlink(self.default_filename) + with ModifiedEnvironment(IPDB_CONFIG=None, HOME=self.tmpd): + cfg = get_config() + self.assertEqual(["ipdb"], cfg.sections()) + self.assertEqual(self.pyproject_context, cfg.getint("ipdb", "context")) + self.assertRaises(configparser.NoOptionError, cfg.get, "ipdb", "version") + + def test_noenv_def_setup_pyproject(self): + """ + Setup: $IPDB_CONFIG unset, $HOME/.ipdb exists, + setup.cfg exists, pyproject.toml exists + Result: load .ipdb + """ + os.unlink(self.env_filename) + with ModifiedEnvironment(IPDB_CONFIG=None, HOME=self.tmpd): + cfg = get_config() + self.assertEqual(["ipdb"], cfg.sections()) + self.assertEqual(self.default_context, cfg.getint("ipdb", "context")) + self.assertRaises(configparser.NoOptionError, cfg.get, "ipdb", "version") def test_env_nodef_nosetup(self): """ Setup: $IPDB_CONFIG is set, $HOME/.ipdb does not exist, - setup.cfg does not exist + setup.cfg does not exist, pyproject.toml does not exist Result: load $IPDB_CONFIG """ os.unlink(self.default_filename) + os.unlink(self.pyproject_filename) os.remove(self.setup_filename) with ModifiedEnvironment(IPDB_CONFIG=self.env_filename, HOME=self.tmpd): @@ -112,10 +189,11 @@ def test_noenv_def_nosetup(self): """ Setup: $IPDB_CONFIG unset, $HOME/.ipdb exists, - setup.cfg does not exist + setup.cfg does not exist, pyproject.toml does not exist Result: load $HOME/.ipdb """ os.unlink(self.env_filename) + os.unlink(self.pyproject_filename) os.remove(self.setup_filename) with ModifiedEnvironment(IPDB_CONFIG=None, HOME=self.tmpd): cfg = get_config() @@ -126,11 +204,12 @@ def test_noenv_nodef_nosetup(self): """ Setup: $IPDB_CONFIG unset, $HOME/.ipdb does not - exist, setup.cfg does not exist + exist, setup.cfg does not exist, pyproject.toml does not exist Result: load nothing """ os.unlink(self.env_filename) os.unlink(self.default_filename) + os.unlink(self.pyproject_filename) os.remove(self.setup_filename) with ModifiedEnvironment(IPDB_CONFIG=None, HOME=self.tmpd): cfg = get_config() @@ -139,10 +218,11 @@ def test_env_cwd(self): """ Setup: $IPDB_CONFIG is set, .ipdb in local dir, - setup.cfg does not exist + setup.cfg does not exist, pyproject.toml does not exist Result: load .ipdb """ os.chdir(self.tmpd) # setUp is already set to restore us to our pre-testing cwd + os.unlink(self.pyproject_filename) os.remove(self.setup_filename) with ModifiedEnvironment(IPDB_CONFIG=self.env_filename, HOME=self.tmpd): @@ -154,9 +234,10 @@ def test_env_def_nosetup(self): """ Setup: $IPDB_CONFIG is set, $HOME/.ipdb exists, - setup.cfg does not exist + setup.cfg does not exist, pyproject.toml does not exist Result: load $IPDB_CONFIG """ + os.unlink(self.pyproject_filename) os.remove(self.setup_filename) with ModifiedEnvironment(IPDB_CONFIG=self.env_filename, HOME=self.tmpd): @@ -168,10 +249,11 @@ def test_noenv_def_setup(self): """ Setup: $IPDB_CONFIG unset, $HOME/.ipdb exists, - setup.cfg exists + setup.cfg exists, pyproject.toml does not exist Result: load $HOME/.ipdb """ os.unlink(self.env_filename) + os.unlink(self.pyproject_filename) with ModifiedEnvironment(IPDB_CONFIG=None, HOME=self.tmpd): cfg = get_config() self.assertEqual(["ipdb"], cfg.sections()) @@ -181,11 +263,12 @@ def test_noenv_nodef_setup(self): """ Setup: $IPDB_CONFIG unset, $HOME/.ipdb does not exist, - setup.cfg exists + setup.cfg exists, pyproject.toml does not exist Result: load setup """ os.unlink(self.env_filename) os.unlink(self.default_filename) + os.unlink(self.pyproject_filename) with ModifiedEnvironment(IPDB_CONFIG=None, HOME=self.tmpd): cfg = get_config() self.assertEqual(["ipdb"], cfg.sections()) @@ -195,9 +278,10 @@ def test_env_def_setup(self): """ Setup: $IPDB_CONFIG is set, $HOME/.ipdb exists, - setup.cfg exists + setup.cfg exists, pyproject.toml does not exist Result: load $IPDB_CONFIG """ + os.unlink(self.pyproject_filename) with ModifiedEnvironment(IPDB_CONFIG=self.env_filename, HOME=self.tmpd): cfg = get_config() @@ -208,10 +292,11 @@ def test_env_nodef_setup(self): """ Setup: $IPDB_CONFIG is set, $HOME/.ipdb does not - exist, setup.cfg exists + exist, setup.cfg exists, pyproject.toml does not exist Result: load $IPDB_CONFIG """ os.unlink(self.default_filename) + os.unlink(self.pyproject_filename) with ModifiedEnvironment(IPDB_CONFIG=self.env_filename, HOME=self.tmpd): cfg = get_config() @@ -222,10 +307,11 @@ def test_noenv_def_setup(self): """ Setup: $IPDB_CONFIG unset, $HOME/.ipdb exists, - setup.cfg exists + setup.cfg exists, pyproject.toml does not exist Result: load $HOME/.ipdb """ os.unlink(self.env_filename) + os.unlink(self.pyproject_filename) with ModifiedEnvironment(IPDB_CONFIG=None, HOME=self.tmpd): cfg = get_config() self.assertEqual(["ipdb"], cfg.sections()) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ipdb-0.13.4/tests/test_import.py new/ipdb-0.13.9/tests/test_import.py --- old/ipdb-0.13.4/tests/test_import.py 2020-10-01 16:13:45.000000000 +0200 +++ new/ipdb-0.13.9/tests/test_import.py 2021-06-02 13:43:42.000000000 +0200 @@ -10,10 +10,11 @@ class ImportTest(unittest.TestCase): def test_import(self): - from ipdb import set_trace, post_mortem, pm, run, runcall, runeval + from ipdb import set_trace, post_mortem, pm, iex, run, runcall, runeval set_trace # please pyflakes post_mortem # please pyflakes pm # please pyflakes + iex # please pyflakes run # please pyflakes runcall # please pyflakes runeval # please pyflakes diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ipdb-0.13.4/tests/test_opts.py new/ipdb-0.13.9/tests/test_opts.py --- old/ipdb-0.13.4/tests/test_opts.py 2020-10-01 16:13:45.000000000 +0200 +++ new/ipdb-0.13.9/tests/test_opts.py 2021-06-02 13:43:42.000000000 +0200 @@ -14,7 +14,7 @@ from ipdb.__main__ import main -@patch('ipdb.__main__.debugger_cls') +@patch('ipdb.__main__._get_debugger_cls') class OptsTest(unittest.TestCase): def set_argv(self, *argv): argv_patch = patch('ipdb.__main__.sys.argv', argv) @@ -22,26 +22,26 @@ self.addCleanup(argv_patch.stop) @patch('ipdb.__main__.sys.version_info', (3, 7)) - def test_debug_module_script(self, debugger_cls): + def test_debug_module_script(self, get_debugger_cls): module_name = 'my_buggy_module' self.set_argv('ipdb', '-m', module_name) main() - debugger = debugger_cls.return_value + debugger = get_debugger_cls.return_value.return_value debugger._runmodule.assert_called_once_with(module_name) @patch('ipdb.__main__.os.path.exists') - def test_debug_script(self, exists, debugger_cls): + def test_debug_script(self, exists, get_debugger_cls): script_name = 'my_buggy_script' self.set_argv('ipdb', script_name) main() - debugger = debugger_cls.return_value + debugger = get_debugger_cls.return_value.return_value debugger._runscript.assert_called_once_with(script_name) - def test_option_m_fallback_on_py36(self, debugger_cls): + def test_option_m_fallback_on_py36(self, get_debugger_cls): self.set_argv('ipdb', '-m', 'my.module') with patch('ipdb.__main__.sys.version_info', (3, 6)): with self.assertRaises(GetoptError):
