openSUSE Commits
Threads by month
- ----- 2025 -----
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2009 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2008 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2007 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2006 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
May 2020
- 1 participants
- 4645 discussions
Hello community,
here is the log from the commit of package python-pyperclip for openSUSE:Factory checked in at 2020-05-01 11:06:31
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-pyperclip (Old)
and /work/SRC/openSUSE:Factory/.python-pyperclip.new.2738 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-pyperclip"
Fri May 1 11:06:31 2020 rev:8 rq:798861 version:1.8.0
Changes:
--------
--- /work/SRC/openSUSE:Factory/python-pyperclip/python-pyperclip.changes 2020-03-27 00:20:20.268106068 +0100
+++ /work/SRC/openSUSE:Factory/.python-pyperclip.new.2738/python-pyperclip.changes 2020-05-01 11:06:39.170973156 +0200
@@ -1,0 +2,6 @@
+Wed Apr 29 10:32:41 UTC 2020 - Dirk Mueller <dmueller(a)suse.com>
+
+- update to 1.8.0
+ + no changes available
+
+-------------------------------------------------------------------
Old:
----
pyperclip-1.7.0.tar.gz
New:
----
pyperclip-1.8.0.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ python-pyperclip.spec ++++++
--- /var/tmp/diff_new_pack.U5v2SN/_old 2020-05-01 11:06:40.998977132 +0200
+++ /var/tmp/diff_new_pack.U5v2SN/_new 2020-05-01 11:06:41.002977140 +0200
@@ -18,7 +18,7 @@
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
Name: python-pyperclip
-Version: 1.7.0
+Version: 1.8.0
Release: 0
Summary: A clipboard module for Python
License: BSD-3-Clause
++++++ pyperclip-1.7.0.tar.gz -> pyperclip-1.8.0.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pyperclip-1.7.0/PKG-INFO new/pyperclip-1.8.0/PKG-INFO
--- old/pyperclip-1.7.0/PKG-INFO 2018-09-25 01:12:07.000000000 +0200
+++ new/pyperclip-1.8.0/PKG-INFO 2020-03-29 01:45:16.000000000 +0100
@@ -1,6 +1,6 @@
Metadata-Version: 1.1
Name: pyperclip
-Version: 1.7.0
+Version: 1.8.0
Summary: A cross-platform clipboard module for Python. (Only handles plain text for now.)
Home-page: https://github.com/asweigart/pyperclip
Author: Al Sweigart
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pyperclip-1.7.0/docs/index.rst new/pyperclip-1.8.0/docs/index.rst
--- old/pyperclip-1.7.0/docs/index.rst 2015-12-14 05:01:22.000000000 +0100
+++ new/pyperclip-1.8.0/docs/index.rst 2020-03-29 01:08:12.000000000 +0100
@@ -3,22 +3,54 @@
You can adapt this file completely to your liking, but it should at least
contain the root `toctree` directive.
+.. default-role:: code
+
Welcome to Pyperclip's documentation!
=====================================
-Contents:
+Pyperclip provides a cross-platform Python module for copying and pasting text to the clipboard.
+
+To copy text to the clipboard, pass a string to ``pyperclip.copy()``. To paste the text from the clipboard, call ``pyperclip.paste()`` and the text will be returned as a string value.
+
+.. code:: python
+
+ >>> import pyperclip
+ >>> pyperclip.copy('Hello, world!')
+ >>> pyperclip.paste()
+ 'Hello, world!'
+
+Pyperclip also has a `pyperclip.waitForPaste()` function, which blocks and doesn't return until a non-empty text string is on the clipboard. It then returns this string. The `pyperclip.waitForNewPaste()` blocks until the text on the clipboard has changed:
+
+.. code:: python
+
+ >>> import pyperclip
+ >>> pyperclip.waitForPaste() # Doesn't return until non-empty text is on the clipboard.
+ 'Hello, world!'
+
+ >>> pyperclip.copy('original text')
+ >>> pyperclip.waitForNewPaste() # Doesn't return until the clipboard has something other than "original text".
+ 'Hello, world!'
+
+These functions also have a `timeout` argument to specify a number of seconds to check. If the timeout elapses without returning, the functions raise a `PyperclipTimeoutException` exception:
-.. toctree::
- :maxdepth: 2
+ >>> import pyperclip
+ >>> pyperclip.waitForNewPaste(5)
+ Traceback (most recent call last):
+ File "<stdin>", line 1, in <module>
+ File "c:\github\pyperclip\src\pyperclip\__init__.py", line 689, in waitForNewPaste
+ raise PyperclipTimeoutException('waitForNewPaste() timed out after ' + str(timeout) + ' seconds.')
+ pyperclip.PyperclipTimeoutException: waitForNewPaste() timed out after 5 seconds.
- introduction.rst
+Not Implemented Error
+=====================
+You may get an error message that says: "Pyperclip could not find a copy/paste mechanism for your system. Please see https://pyperclip.readthedocs.io/en/latest/introduction.html#not-implemente… for how to fix this."
-Indices and tables
-==================
+In order to work equally well on Windows, Mac, and Linux, Pyperclip uses various mechanisms to do this. Currently, this error should only appear on Linux (not Windows or Mac). You can fix this by installing one of the copy/paste mechanisms:
-* :ref:`genindex`
-* :ref:`modindex`
-* :ref:`search`
+- ``sudo apt-get install xsel`` to install the xsel utility.
+- ``sudo apt-get install xclip`` to install the xclip utility.
+- ``pip install gtk`` to install the gtk Python module.
+- ``pip install PyQt4`` to install the PyQt4 Python module.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pyperclip-1.7.0/docs/introduction.rst new/pyperclip-1.8.0/docs/introduction.rst
--- old/pyperclip-1.7.0/docs/introduction.rst 2017-10-29 04:25:47.000000000 +0100
+++ new/pyperclip-1.8.0/docs/introduction.rst 1970-01-01 01:00:00.000000000 +0100
@@ -1,32 +0,0 @@
-.. default-role:: code
-
-============
-Introduction
-============
-
-Purpose
-=======
-
-The purpose of Pyperclip is to provide a cross-platform Python module for copying and pasting text to the clipboard.
-
-To copy text to the clipboard, pass a string to ``pyperclip.copy()``. To paste the text from the clipboard, call ``pyperclip.paste()`` and the text will be returned as a string value.
-
-.. code:: python
-
- >>> import pyperclip
- >>> pyperclip.copy('Hello world!')
- >>> pyperclip.paste()
- 'Hello world!'
-
-Not Implemented Error
-=====================
-
-You may get an error message that says: "Pyperclip could not find a copy/paste mechanism for your system. Please see https://pyperclip.readthedocs.io/en/latest/introduction.html#not-implemente… for how to fix this."
-
-In order to work equally well on Windows, Mac, and Linux, Pyperclip uses various mechanisms to do this. Currently, this error should only appear on Linux (not Windows or Mac). You can fix this by installing one of the copy/paste mechanisms:
-
-- ``sudo apt-get install xsel`` to install the xsel utility.
-- ``sudo apt-get install xclip`` to install the xclip utility.
-- ``pip install gtk`` to install the gtk Python module.
-- ``pip install PyQt4`` to install the PyQt4 Python module.
-
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pyperclip-1.7.0/src/pyperclip/__init__.py new/pyperclip-1.8.0/src/pyperclip/__init__.py
--- old/pyperclip-1.7.0/src/pyperclip/__init__.py 2018-09-25 01:10:22.000000000 +0200
+++ new/pyperclip-1.8.0/src/pyperclip/__init__.py 2020-03-29 01:13:14.000000000 +0100
@@ -43,7 +43,7 @@
Pyperclip into running them with whatever permissions the Python process has.
"""
-__version__ = '1.7.0'
+__version__ = '1.8.0'
import contextlib
import ctypes
@@ -64,7 +64,7 @@
EXCEPT_MSG = """
Pyperclip could not find a copy/paste mechanism for your system.
- For more information, please visit https://pyperclip.readthedocs.io/en/latest/introduction.html#not-implemente… """
+ For more information, please visit https://pyperclip.readthedocs.io/en/latest/index.html#not-implemented-error """
PY2 = sys.version_info[0] == 2
@@ -93,6 +93,8 @@
message += " (%s)" % ctypes.WinError()
super(PyperclipWindowsException, self).__init__(message)
+class PyperclipTimeoutException(PyperclipException):
+ pass
def _stringifyText(text):
if PY2:
@@ -648,6 +650,45 @@
copy, paste = lazy_load_stub_copy, lazy_load_stub_paste
-__all__ = ['copy', 'paste', 'set_clipboard', 'determine_clipboard']
+
+def waitForPaste(timeout=None):
+ """This function call blocks until a non-empty text string exists on the
+ clipboard. It returns this text.
+
+ This function raises PyperclipTimeoutException if timeout was set to
+ a number of seconds that has elapsed without non-empty text being put on
+ the clipboard."""
+ startTime = time.time()
+ while True:
+ clipboardText = paste()
+ if clipboardText != '':
+ return clipboardText
+ time.sleep(0.01)
+
+ if timeout is not None and time.time() > startTime + timeout:
+ raise PyperclipTimeoutException('waitForPaste() timed out after ' + str(timeout) + ' seconds.')
+
+
+def waitForNewPaste(timeout=None):
+ """This function call blocks until a new text string exists on the
+ clipboard that is different from the text that was there when the function
+ was first called. It returns this text.
+
+ This function raises PyperclipTimeoutException if timeout was set to
+ a number of seconds that has elapsed without non-empty text being put on
+ the clipboard."""
+ startTime = time.time()
+ originalText = paste()
+ while True:
+ currentText = paste()
+ if currentText != originalText:
+ return currentText
+ time.sleep(0.01)
+
+ if timeout is not None and time.time() > startTime + timeout:
+ raise PyperclipTimeoutException('waitForNewPaste() timed out after ' + str(timeout) + ' seconds.')
+
+
+__all__ = ['copy', 'paste', 'waitForPaste', 'waitForNewPaste' 'set_clipboard', 'determine_clipboard']
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pyperclip-1.7.0/src/pyperclip.egg-info/PKG-INFO new/pyperclip-1.8.0/src/pyperclip.egg-info/PKG-INFO
--- old/pyperclip-1.7.0/src/pyperclip.egg-info/PKG-INFO 2018-09-25 01:12:07.000000000 +0200
+++ new/pyperclip-1.8.0/src/pyperclip.egg-info/PKG-INFO 2020-03-29 01:45:16.000000000 +0100
@@ -1,6 +1,6 @@
Metadata-Version: 1.1
Name: pyperclip
-Version: 1.7.0
+Version: 1.8.0
Summary: A cross-platform clipboard module for Python. (Only handles plain text for now.)
Home-page: https://github.com/asweigart/pyperclip
Author: Al Sweigart
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pyperclip-1.7.0/src/pyperclip.egg-info/SOURCES.txt new/pyperclip-1.8.0/src/pyperclip.egg-info/SOURCES.txt
--- old/pyperclip-1.7.0/src/pyperclip.egg-info/SOURCES.txt 2018-09-25 01:12:07.000000000 +0200
+++ new/pyperclip-1.8.0/src/pyperclip.egg-info/SOURCES.txt 2020-03-29 01:45:16.000000000 +0100
@@ -4,7 +4,6 @@
docs/Makefile
docs/conf.py
docs/index.rst
-docs/introduction.rst
docs/make.bat
src/pyperclip/__init__.py
src/pyperclip/__main__.py
1
0
Hello community,
here is the log from the commit of package python-google-auth for openSUSE:Factory checked in at 2020-05-01 11:06:21
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-google-auth (Old)
and /work/SRC/openSUSE:Factory/.python-google-auth.new.2738 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-google-auth"
Fri May 1 11:06:21 2020 rev:8 rq:798566 version:1.14.1
Changes:
--------
--- /work/SRC/openSUSE:Factory/python-google-auth/python-google-auth.changes 2019-07-30 13:04:02.886406417 +0200
+++ /work/SRC/openSUSE:Factory/.python-google-auth.new.2738/python-google-auth.changes 2020-05-01 11:06:28.374949678 +0200
@@ -1,0 +2,10 @@
+Tue Apr 28 07:49:44 UTC 2020 - Tomáš Chvátal <tchvatal(a)suse.com>
+
+- Update to 1.14.1:
+ * Many bugixes all around
+- Remove no longer needed patch:
+ * pytest5.patch
+- Update the dependencies to match up setup.py and what upstream
+ really requires
+
+-------------------------------------------------------------------
Old:
----
google-auth-1.6.3.tar.gz
pytest5.patch
New:
----
google-auth-1.14.1.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ python-google-auth.spec ++++++
--- /var/tmp/diff_new_pack.DZvbWC/_old 2020-05-01 11:06:30.486954270 +0200
+++ /var/tmp/diff_new_pack.DZvbWC/_new 2020-05-01 11:06:30.486954270 +0200
@@ -1,7 +1,7 @@
#
# spec file for package python-google-auth
#
-# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany.
+# Copyright (c) 2020 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -18,42 +18,34 @@
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
Name: python-google-auth
-Version: 1.6.3
+Version: 1.14.1
Release: 0
Summary: Google Authentication Library
License: Apache-2.0
-Group: Development/Languages/Python
URL: https://github.com/GoogleCloudPlatform/google-auth-library-python
Source: https://files.pythonhosted.org/packages/source/g/google-auth/google-auth-%{…
-Patch0: pytest5.patch
BuildRequires: %{python_module Flask}
-BuildRequires: %{python_module cachetools}
+BuildRequires: %{python_module cachetools >= 2.0.0}
BuildRequires: %{python_module cryptography}
+BuildRequires: %{python_module freezegun}
BuildRequires: %{python_module mock}
BuildRequires: %{python_module oauth2client-gce}
BuildRequires: %{python_module oauth2client}
-BuildRequires: %{python_module pyasn1-modules}
-BuildRequires: %{python_module pyasn1}
+BuildRequires: %{python_module pyasn1-modules >= 0.2.1}
BuildRequires: %{python_module pytest-localserver}
BuildRequires: %{python_module pytest}
BuildRequires: %{python_module requests}
-BuildRequires: %{python_module rsa}
-BuildRequires: %{python_module setuptools}
-BuildRequires: %{python_module six}
-BuildRequires: %{python_module urllib3}
+BuildRequires: %{python_module responses}
+BuildRequires: %{python_module rsa >= 3.1.4}
+BuildRequires: %{python_module setuptools >= 40.3.0}
+BuildRequires: %{python_module six >= 1.9.0}
BuildRequires: fdupes
BuildRequires: python-rpm-macros
-Requires: python-cachetools
-Requires: python-cryptography
-Requires: python-oauth2client
-Requires: python-oauth2client-gce
-Requires: python-pyasn1
-Requires: python-pyasn1-modules
-Requires: python-requests
-Requires: python-rsa
-Requires: python-setuptools
-Requires: python-six
-Requires: python-urllib3
+Requires: python-cachetools >= 2.0.0
+Requires: python-pyasn1-modules >= 0.2.1
+Requires: python-rsa >= 3.1.4
+Requires: python-setuptools >= 40.3.0
+Requires: python-six >= 1.9.0
BuildArch: noarch
%python_subpackages
@@ -62,7 +54,6 @@
%prep
%setup -q -n google-auth-%{version}
-%patch0 -p1
%build
%python_build
++++++ google-auth-1.6.3.tar.gz -> google-auth-1.14.1.tar.gz ++++++
++++ 12607 lines of diff (skipped)
1
0
Hello community,
here is the log from the commit of package python-pytest-flake8 for openSUSE:Factory checked in at 2020-05-01 11:06:13
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-pytest-flake8 (Old)
and /work/SRC/openSUSE:Factory/.python-pytest-flake8.new.2738 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-pytest-flake8"
Fri May 1 11:06:13 2020 rev:6 rq:798139 version:1.0.5
Changes:
--------
--- /work/SRC/openSUSE:Factory/python-pytest-flake8/python-pytest-flake8.changes 2019-02-24 17:02:20.164710694 +0100
+++ /work/SRC/openSUSE:Factory/.python-pytest-flake8.new.2738/python-pytest-flake8.changes 2020-05-01 11:06:19.870931184 +0200
@@ -1,0 +2,6 @@
+Mon Apr 27 10:21:56 UTC 2020 - Tomáš Chvátal <tchvatal(a)suse.com>
+
+- Update to 1.0.5:
+ * Fix deprecation warning
+
+-------------------------------------------------------------------
Old:
----
pytest-flake8-1.0.4.tar.gz
New:
----
pytest-flake8-1.0.5.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ python-pytest-flake8.spec ++++++
--- /var/tmp/diff_new_pack.EJTCTt/_old 2020-05-01 11:06:21.002933646 +0200
+++ /var/tmp/diff_new_pack.EJTCTt/_new 2020-05-01 11:06:21.006933654 +0200
@@ -1,7 +1,7 @@
#
# spec file for package python-pytest-flake8
#
-# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany.
+# Copyright (c) 2020 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -18,7 +18,7 @@
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
Name: python-pytest-flake8
-Version: 1.0.4
+Version: 1.0.5
Release: 0
Summary: Plugin for pytest to check FLAKE8 requirements
License: BSD-2-Clause
@@ -49,7 +49,7 @@
%python_expand %fdupes %{buildroot}%{$python_sitelib}
%check
-%python_expand PYTHONPATH=%{buildroot}%{$python_sitelib} py.test-%{$python_bin_suffix} -v
+%pytest
%files %{python_files}
%license LICENSE
++++++ pytest-flake8-1.0.4.tar.gz -> pytest-flake8-1.0.5.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pytest-flake8-1.0.4/CHANGELOG new/pytest-flake8-1.0.5/CHANGELOG
--- old/pytest-flake8-1.0.4/CHANGELOG 2019-01-31 21:05:36.000000000 +0100
+++ new/pytest-flake8-1.0.5/CHANGELOG 2020-04-23 20:56:22.000000000 +0200
@@ -1,3 +1,8 @@
+1.0.5
+-----
+
+- Fix deprecation warning; from @jonasundderwolf
+
1.0.4
-----
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pytest-flake8-1.0.4/PKG-INFO new/pytest-flake8-1.0.5/PKG-INFO
--- old/pytest-flake8-1.0.4/PKG-INFO 2019-01-31 21:05:36.000000000 +0100
+++ new/pytest-flake8-1.0.5/PKG-INFO 2020-04-23 20:56:22.000000000 +0200
@@ -1,6 +1,6 @@
Metadata-Version: 1.1
Name: pytest-flake8
-Version: 1.0.4
+Version: 1.0.5
Summary: pytest plugin to check FLAKE8 requirements
Home-page: https://github.com/tholo/pytest-flake8
Author: Thorsten Lockert
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pytest-flake8-1.0.4/pytest_flake8.egg-info/PKG-INFO new/pytest-flake8-1.0.5/pytest_flake8.egg-info/PKG-INFO
--- old/pytest-flake8-1.0.4/pytest_flake8.egg-info/PKG-INFO 2019-01-31 21:05:36.000000000 +0100
+++ new/pytest-flake8-1.0.5/pytest_flake8.egg-info/PKG-INFO 2020-04-23 20:56:22.000000000 +0200
@@ -1,6 +1,6 @@
Metadata-Version: 1.1
Name: pytest-flake8
-Version: 1.0.4
+Version: 1.0.5
Summary: pytest plugin to check FLAKE8 requirements
Home-page: https://github.com/tholo/pytest-flake8
Author: Thorsten Lockert
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pytest-flake8-1.0.4/pytest_flake8.py new/pytest-flake8-1.0.5/pytest_flake8.py
--- old/pytest-flake8-1.0.4/pytest_flake8.py 2019-01-31 21:05:36.000000000 +0100
+++ new/pytest-flake8-1.0.5/pytest_flake8.py 2020-04-23 20:56:22.000000000 +0200
@@ -62,14 +62,23 @@
if config.option.flake8 and path.ext in config._flake8exts:
flake8ignore = config._flake8ignore(path)
if flake8ignore is not None:
- return Flake8Item(
- path,
- parent,
- flake8ignore=flake8ignore,
- maxlength=config._flake8maxlen,
- maxcomplexity=config._flake8maxcomplexity,
- showshource=config._flake8showshource,
- statistics=config._flake8statistics)
+ if hasattr(Flake8Item, "from_parent"):
+ item = Flake8Item.from_parent(parent, fspath=path)
+ item.flake8ignore = flake8ignore
+ item.maxlength = config._flake8maxlen
+ item.maxcomplexity = config._flake8maxcomplexity
+ item.showshource = config._flake8showshource
+ item.statistics = config._flake8statistics
+ return item
+ else:
+ return Flake8Item(
+ path,
+ parent,
+ flake8ignore=flake8ignore,
+ maxlength=config._flake8maxlen,
+ maxcomplexity=config._flake8maxcomplexity,
+ showshource=config._flake8showshource,
+ statistics=config._flake8statistics)
def pytest_unconfigure(config):
@@ -84,9 +93,9 @@
class Flake8Item(pytest.Item, pytest.File):
- def __init__(self, path, parent, flake8ignore, maxlength,
- maxcomplexity, showshource, statistics):
- super(Flake8Item, self).__init__(path, parent)
+ def __init__(self, fspath, parent, flake8ignore=None, maxlength=None,
+ maxcomplexity=None, showshource=None, statistics=None):
+ super(Flake8Item, self).__init__(fspath, parent)
self._nodeid += "::FLAKE8"
self.add_marker("flake8")
self.flake8ignore = flake8ignore
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pytest-flake8-1.0.4/setup.py new/pytest-flake8-1.0.5/setup.py
--- old/pytest-flake8-1.0.4/setup.py 2019-01-31 21:05:36.000000000 +0100
+++ new/pytest-flake8-1.0.5/setup.py 2020-04-23 20:56:22.000000000 +0200
@@ -6,7 +6,7 @@
setup(
name='pytest-flake8',
- version='1.0.4',
+ version='1.0.5',
description='pytest plugin to check FLAKE8 requirements',
long_description=open("README.rst").read(),
classifiers=[
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pytest-flake8-1.0.4/tox.ini new/pytest-flake8-1.0.5/tox.ini
--- old/pytest-flake8-1.0.4/tox.ini 2019-01-31 21:05:36.000000000 +0100
+++ new/pytest-flake8-1.0.5/tox.ini 2020-04-23 20:56:22.000000000 +0200
@@ -1,5 +1,5 @@
[tox]
-envlist=py27,py36-pytesttrunk,py36-xdist,py34,py35,py36,py37,pypy,pypy3
+envlist=py27,py36-pytesttrunk,py36-xdist,py34,py35,py36,py37,py38,pypy,pypy3
[testenv]
deps=pytest
@@ -18,6 +18,7 @@
[pytest]
addopts=--flake8
+junit_family=xunit1
[flake8]
ignore=E128
1
0
Hello community,
here is the log from the commit of package python-pytest-mock for openSUSE:Factory checked in at 2020-05-01 11:06:02
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-pytest-mock (Old)
and /work/SRC/openSUSE:Factory/.python-pytest-mock.new.2738 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-pytest-mock"
Fri May 1 11:06:02 2020 rev:18 rq:798138 version:3.1.0
Changes:
--------
--- /work/SRC/openSUSE:Factory/python-pytest-mock/python-pytest-mock.changes 2020-01-16 18:13:42.940719412 +0100
+++ /work/SRC/openSUSE:Factory/.python-pytest-mock.new.2738/python-pytest-mock.changes 2020-05-01 11:06:13.302916900 +0200
@@ -1,0 +2,8 @@
+Mon Apr 27 10:19:49 UTC 2020 - Tomáš Chvátal <tchvatal(a)suse.com>
+
+- Update to 3.1.0:
+ * Python 2.7 and 3.4 are no longer supported
+ * New mocker fixtures added that allow using mocking functionality
+ in other scopes
+
+-------------------------------------------------------------------
Old:
----
pytest-mock-2.0.0.tar.gz
New:
----
pytest-mock-3.1.0.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ python-pytest-mock.spec ++++++
--- /var/tmp/diff_new_pack.6CeADq/_old 2020-05-01 11:06:14.686919910 +0200
+++ /var/tmp/diff_new_pack.6CeADq/_new 2020-05-01 11:06:14.690919918 +0200
@@ -16,11 +16,10 @@
#
-%define oldpython python
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
-%bcond_without python2
+%define skip_python2 1
Name: python-pytest-mock
-Version: 2.0.0
+Version: 3.1.0
Release: 0
Summary: Thin-wrapper around the mock package for easier use with pytest
License: MIT
@@ -33,12 +32,6 @@
BuildRequires: python-rpm-macros
Requires: python-pytest
BuildArch: noarch
-%if %{with python2}
-BuildRequires: %{oldpython}-mock
-%endif
-%ifpython2
-Requires: %{oldpython}-mock
-%endif
%python_subpackages
%description
++++++ pytest-mock-2.0.0.tar.gz -> pytest-mock-3.1.0.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pytest-mock-2.0.0/.github/workflows/main.yml new/pytest-mock-3.1.0/.github/workflows/main.yml
--- old/pytest-mock-2.0.0/.github/workflows/main.yml 2020-01-04 19:44:53.000000000 +0100
+++ new/pytest-mock-3.1.0/.github/workflows/main.yml 2020-04-18 17:16:30.000000000 +0200
@@ -10,11 +10,9 @@
strategy:
fail-fast: false
matrix:
- python: ["2.7", "3.5", "3.6", "3.7", "3.8"]
+ python: ["3.5", "3.6", "3.7", "3.8"]
os: [ubuntu-latest, windows-latest]
include:
- - python: "2.7"
- tox_env: "py27"
- python: "3.5"
tox_env: "py35"
- python: "3.6"
@@ -58,11 +56,12 @@
deploy:
+ if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags')
+
runs-on: ubuntu-latest
needs: [build, linting]
-
steps:
- uses: actions/checkout@v1
- name: Set up Python
@@ -77,7 +76,6 @@
run: |
python setup.py sdist bdist_wheel
- name: Publish package to PyPI
- if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags')
uses: pypa/gh-action-pypi-publish@master
with:
user: __token__
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pytest-mock-2.0.0/.pre-commit-config.yaml new/pytest-mock-3.1.0/.pre-commit-config.yaml
--- old/pytest-mock-2.0.0/.pre-commit-config.yaml 2020-01-04 19:44:53.000000000 +0100
+++ new/pytest-mock-3.1.0/.pre-commit-config.yaml 2020-04-18 17:16:30.000000000 +0200
@@ -1,13 +1,12 @@
exclude: '^($|.*\.bin)'
repos:
- repo: https://github.com/ambv/black
- rev: 18.6b4
+ rev: 19.10b0
hooks:
- id: black
args: [--safe, --quiet]
- language_version: python3.6
- repo: https://github.com/pre-commit/pre-commit-hooks
- rev: v1.3.0
+ rev: v2.4.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pytest-mock-2.0.0/CHANGELOG.rst new/pytest-mock-3.1.0/CHANGELOG.rst
--- old/pytest-mock-2.0.0/CHANGELOG.rst 2020-01-04 19:44:53.000000000 +0100
+++ new/pytest-mock-3.1.0/CHANGELOG.rst 2020-04-18 17:16:30.000000000 +0200
@@ -1,3 +1,29 @@
+3.1.0 (2020-04-18)
+------------------
+
+* New mocker fixtures added that allow using mocking functionality in other scopes:
+
+ * ``class_mocker``
+ * ``module_mocker``
+ * ``package_mocker``
+ * ``session_mocker``
+
+ Added by `@scorphus`_ in `#182`_.
+
+.. _@scorphus: https://github.com/scorphus
+.. _#182: https://github.com/pytest-dev/pytest-mock/pull/182
+
+3.0.0 (2020-03-31)
+------------------
+
+* Python 2.7 and 3.4 are no longer supported. Users using ``pip 9`` or later will install
+ a compatible version automatically.
+
+* ``mocker.spy`` now also works with ``async def`` functions (`#179`_). Thanks `@frankie567`_ for the PR!
+
+.. _#179: https://github.com/pytest-dev/pytest-mock/issues/179
+.. _@frankie567: https://github.com/frankie567
+
2.0.0 (2020-01-04)
------------------
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pytest-mock-2.0.0/PKG-INFO new/pytest-mock-3.1.0/PKG-INFO
--- old/pytest-mock-2.0.0/PKG-INFO 2020-01-04 19:44:56.000000000 +0100
+++ new/pytest-mock-3.1.0/PKG-INFO 2020-04-18 17:16:34.000000000 +0200
@@ -1,7 +1,7 @@
Metadata-Version: 2.1
Name: pytest-mock
-Version: 2.0.0
-Summary: Thin-wrapper around the mock package for easier use with py.test
+Version: 3.1.0
+Summary: Thin-wrapper around the mock package for easier use with pytest
Home-page: https://github.com/pytest-dev/pytest-mock/
Author: Bruno Oliveira
Author-email: nicoddemus(a)gmail.com
@@ -90,6 +90,13 @@
* `sentinel <https://docs.python.org/3/library/unittest.mock.html#sentinel>`_ *(Version 1.2)*
* `mock_open <https://docs.python.org/3/library/unittest.mock.html#mock-open>`_
+ It is also possible to use mocking functionality from fixtures of other scopes using
+ the appropriate mock fixture:
+
+ * ``class_mocker``
+ * ``module_mocker``
+ * ``package_mocker``
+ * ``session_mocker``
Spy
---
@@ -122,6 +129,8 @@
``mocker.spy`` also works for class and static methods.
+ As of version 3.0.0, ``mocker.spy`` also works with ``async def`` functions.
+
.. note::
In versions earlier than ``2.0``, the attributes were called ``return_value`` and
@@ -157,7 +166,7 @@
It also adds introspection information on differing call arguments when
calling the helper methods. This features catches `AssertionError` raised in
- the method, and uses py.test's own `advanced assertions`_ to return a better
+ the method, and uses pytest's own `advanced assertions`_ to return a better
diff::
@@ -243,9 +252,8 @@
Requirements
============
- * Python 2.7, Python 3.4+
+ * Python Python 3.5+
* pytest
- * mock (for Python 2)
Install
@@ -357,7 +365,7 @@
.. code-block:: console
- $ tox -e py27,py36,linting
+ $ tox -e py38,linting
Style checks and formatting are done automatically during commit courtesy of
`pre-commit <https://pre-commit.com>`_.
@@ -381,14 +389,12 @@
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
-Classifier: Programming Language :: Python :: 2
-Classifier: Programming Language :: Python :: 2.7
Classifier: Programming Language :: Python :: 3
-Classifier: Programming Language :: Python :: 3.4
Classifier: Programming Language :: Python :: 3.5
Classifier: Programming Language :: Python :: 3.6
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
+Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Topic :: Software Development :: Testing
-Requires-Python: >=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*
+Requires-Python: >=3.5
Provides-Extra: dev
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pytest-mock-2.0.0/README.rst new/pytest-mock-3.1.0/README.rst
--- old/pytest-mock-2.0.0/README.rst 2020-01-04 19:44:53.000000000 +0100
+++ new/pytest-mock-3.1.0/README.rst 2020-04-18 17:16:30.000000000 +0200
@@ -82,6 +82,13 @@
* `sentinel <https://docs.python.org/3/library/unittest.mock.html#sentinel>`_ *(Version 1.2)*
* `mock_open <https://docs.python.org/3/library/unittest.mock.html#mock-open>`_
+It is also possible to use mocking functionality from fixtures of other scopes using
+the appropriate mock fixture:
+
+* ``class_mocker``
+* ``module_mocker``
+* ``package_mocker``
+* ``session_mocker``
Spy
---
@@ -114,6 +121,8 @@
``mocker.spy`` also works for class and static methods.
+As of version 3.0.0, ``mocker.spy`` also works with ``async def`` functions.
+
.. note::
In versions earlier than ``2.0``, the attributes were called ``return_value`` and
@@ -149,7 +158,7 @@
It also adds introspection information on differing call arguments when
calling the helper methods. This features catches `AssertionError` raised in
-the method, and uses py.test's own `advanced assertions`_ to return a better
+the method, and uses pytest's own `advanced assertions`_ to return a better
diff::
@@ -235,9 +244,8 @@
Requirements
============
-* Python 2.7, Python 3.4+
+* Python Python 3.5+
* pytest
-* mock (for Python 2)
Install
@@ -349,7 +357,7 @@
.. code-block:: console
- $ tox -e py27,py36,linting
+ $ tox -e py38,linting
Style checks and formatting are done automatically during commit courtesy of
`pre-commit <https://pre-commit.com>`_.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pytest-mock-2.0.0/setup.py new/pytest-mock-3.1.0/setup.py
--- old/pytest-mock-2.0.0/setup.py 2020-01-04 19:44:53.000000000 +0100
+++ new/pytest-mock-3.1.0/setup.py 2020-04-18 17:16:30.000000000 +0200
@@ -8,32 +8,30 @@
packages=find_packages(where="src"),
package_dir={"": "src"},
platforms="any",
- python_requires=">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*",
- install_requires=["pytest>=2.7", 'mock;python_version<"3.0"'],
+ python_requires=">=3.5",
+ install_requires=["pytest>=2.7"],
use_scm_version={"write_to": "src/pytest_mock/_version.py"},
setup_requires=["setuptools_scm"],
url="https://github.com/pytest-dev/pytest-mock/",
license="MIT",
author="Bruno Oliveira",
author_email="nicoddemus(a)gmail.com",
- description="Thin-wrapper around the mock package for easier use with py.test",
+ description="Thin-wrapper around the mock package for easier use with pytest",
long_description=open("README.rst", encoding="utf-8").read(),
keywords="pytest mock",
- extras_require={"dev": ["pre-commit", "tox"]},
+ extras_require={"dev": ["pre-commit", "tox", "pytest-asyncio"]},
classifiers=[
"Development Status :: 5 - Production/Stable",
"Framework :: Pytest",
"Intended Audience :: Developers",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
- "Programming Language :: Python :: 2",
- "Programming Language :: Python :: 2.7",
"Programming Language :: Python :: 3",
- "Programming Language :: Python :: 3.4",
"Programming Language :: Python :: 3.5",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
+ "Programming Language :: Python :: 3 :: Only",
"Topic :: Software Development :: Testing",
],
)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pytest-mock-2.0.0/src/pytest_mock/_version.py new/pytest-mock-3.1.0/src/pytest_mock/_version.py
--- old/pytest-mock-2.0.0/src/pytest_mock/_version.py 2020-01-04 19:44:55.000000000 +0100
+++ new/pytest-mock-3.1.0/src/pytest_mock/_version.py 2020-04-18 17:16:33.000000000 +0200
@@ -1,4 +1,4 @@
# coding: utf-8
# file generated by setuptools_scm
# don't change, don't track in version control
-version = '2.0.0'
+version = '3.1.0'
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pytest-mock-2.0.0/src/pytest_mock/plugin.py new/pytest-mock-3.1.0/src/pytest_mock/plugin.py
--- old/pytest-mock-2.0.0/src/pytest_mock/plugin.py 2020-01-04 19:44:53.000000000 +0100
+++ new/pytest-mock-3.1.0/src/pytest_mock/plugin.py 2020-04-18 17:16:30.000000000 +0200
@@ -1,8 +1,6 @@
-from __future__ import unicode_literals
-
+import asyncio
import functools
import inspect
-import sys
import pytest
@@ -10,24 +8,18 @@
__version__ = version
-# pseudo-six; if this starts to require more than this, depend on six already
-if sys.version_info[0] == 2: # pragma: no cover
- text_type = unicode # noqa
-else:
- text_type = str
-
def _get_mock_module(config):
"""
- Import and return the actual "mock" module. By default this is "mock" for Python 2 and
- "unittest.mock" for Python 3, but the user can force to always use "mock" on Python 3 using
+ Import and return the actual "mock" module. By default this is
+ "unittest.mock", but the user can force to always use "mock" using
the mock_use_standalone_module ini option.
"""
if not hasattr(_get_mock_module, "_module"):
use_standalone_module = parse_ini_boolean(
config.getini("mock_use_standalone_module")
)
- if sys.version_info[0] == 2 or use_standalone_module:
+ if use_standalone_module:
import mock
_get_mock_module._module = mock
@@ -39,7 +31,7 @@
return _get_mock_module._module
-class MockFixture(object):
+class MockFixture:
"""
Fixture that provides the same interface to functions in the mock module,
ensuring that they are uninstalled at the end of each test.
@@ -105,13 +97,6 @@
if isinstance(value, (classmethod, staticmethod)):
autospec = False
- if sys.version_info[0] == 2:
- assigned = [x for x in functools.WRAPPER_ASSIGNMENTS if hasattr(method, x)]
- w = functools.wraps(method, assigned=assigned)
- else:
- w = functools.wraps(method)
-
- @w
def wrapper(*args, **kwargs):
spy_obj.spy_return = None
spy_obj.spy_exception = None
@@ -124,7 +109,24 @@
spy_obj.spy_return = r
return r
- spy_obj = self.patch.object(obj, name, side_effect=wrapper, autospec=autospec)
+ async def async_wrapper(*args, **kwargs):
+ spy_obj.spy_return = None
+ spy_obj.spy_exception = None
+ try:
+ r = await method(*args, **kwargs)
+ except Exception as e:
+ spy_obj.spy_exception = e
+ raise
+ else:
+ spy_obj.spy_return = r
+ return r
+
+ if asyncio.iscoroutinefunction(method):
+ wrapped = functools.update_wrapper(async_wrapper, method)
+ else:
+ wrapped = functools.update_wrapper(wrapper, method)
+
+ spy_obj = self.patch.object(obj, name, side_effect=wrapped, autospec=autospec)
spy_obj.spy_return = None
spy_obj.spy_exception = None
return spy_obj
@@ -140,7 +142,7 @@
"""
return self.mock_module.MagicMock(spec=lambda *args, **kwargs: None, name=name)
- class _Patcher(object):
+ class _Patcher:
"""
Object to provide the same interface as mock.patch, mock.patch.object,
etc. We need this indirection to keep the same API of the mock package.
@@ -197,8 +199,7 @@
return self._start_patch(self.mock_module.patch, *args, **kwargs)
-(a)pytest.yield_fixture
-def mocker(pytestconfig):
+def _mocker(pytestconfig):
"""
return an object that has the same interface to the `mock` module, but
takes care of automatically undoing all patches after each test method.
@@ -208,6 +209,13 @@
result.stopall()
+mocker = pytest.yield_fixture()(_mocker) # default scope is function
+class_mocker = pytest.yield_fixture(scope="class")(_mocker)
+module_mocker = pytest.yield_fixture(scope="module")(_mocker)
+package_mocker = pytest.yield_fixture(scope="package")(_mocker)
+session_mocker = pytest.yield_fixture(scope="session")(_mocker)
+
+
_mock_module_patches = []
_mock_module_originals = {}
@@ -219,21 +227,21 @@
return
except AssertionError as e:
if getattr(e, "_mock_introspection_applied", 0):
- msg = text_type(e)
+ msg = str(e)
else:
__mock_self = args[0]
- msg = text_type(e)
+ msg = str(e)
if __mock_self.call_args is not None:
actual_args, actual_kwargs = __mock_self.call_args
introspection = ""
try:
assert actual_args == args[1:]
except AssertionError as e:
- introspection += "\nArgs:\n" + text_type(e)
+ introspection += "\nArgs:\n" + str(e)
try:
assert actual_kwargs == kwargs
except AssertionError as e:
- introspection += "\nKwargs:\n" + text_type(e)
+ introspection += "\nKwargs:\n" + str(e)
if introspection:
msg += "\n\npytest introspection follows:\n" + introspection
@@ -324,7 +332,7 @@
# so we need to catch this error here and ignore it;
# unfortunately there's no public API to check if a patch
# has been started, so catching the error it is
- if text_type(e) == "stop called on unstarted patcher":
+ if str(e) == "stop called on unstarted patcher":
pass
else:
raise
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pytest-mock-2.0.0/src/pytest_mock.egg-info/PKG-INFO new/pytest-mock-3.1.0/src/pytest_mock.egg-info/PKG-INFO
--- old/pytest-mock-2.0.0/src/pytest_mock.egg-info/PKG-INFO 2020-01-04 19:44:55.000000000 +0100
+++ new/pytest-mock-3.1.0/src/pytest_mock.egg-info/PKG-INFO 2020-04-18 17:16:33.000000000 +0200
@@ -1,7 +1,7 @@
Metadata-Version: 2.1
Name: pytest-mock
-Version: 2.0.0
-Summary: Thin-wrapper around the mock package for easier use with py.test
+Version: 3.1.0
+Summary: Thin-wrapper around the mock package for easier use with pytest
Home-page: https://github.com/pytest-dev/pytest-mock/
Author: Bruno Oliveira
Author-email: nicoddemus(a)gmail.com
@@ -90,6 +90,13 @@
* `sentinel <https://docs.python.org/3/library/unittest.mock.html#sentinel>`_ *(Version 1.2)*
* `mock_open <https://docs.python.org/3/library/unittest.mock.html#mock-open>`_
+ It is also possible to use mocking functionality from fixtures of other scopes using
+ the appropriate mock fixture:
+
+ * ``class_mocker``
+ * ``module_mocker``
+ * ``package_mocker``
+ * ``session_mocker``
Spy
---
@@ -122,6 +129,8 @@
``mocker.spy`` also works for class and static methods.
+ As of version 3.0.0, ``mocker.spy`` also works with ``async def`` functions.
+
.. note::
In versions earlier than ``2.0``, the attributes were called ``return_value`` and
@@ -157,7 +166,7 @@
It also adds introspection information on differing call arguments when
calling the helper methods. This features catches `AssertionError` raised in
- the method, and uses py.test's own `advanced assertions`_ to return a better
+ the method, and uses pytest's own `advanced assertions`_ to return a better
diff::
@@ -243,9 +252,8 @@
Requirements
============
- * Python 2.7, Python 3.4+
+ * Python Python 3.5+
* pytest
- * mock (for Python 2)
Install
@@ -357,7 +365,7 @@
.. code-block:: console
- $ tox -e py27,py36,linting
+ $ tox -e py38,linting
Style checks and formatting are done automatically during commit courtesy of
`pre-commit <https://pre-commit.com>`_.
@@ -381,14 +389,12 @@
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
-Classifier: Programming Language :: Python :: 2
-Classifier: Programming Language :: Python :: 2.7
Classifier: Programming Language :: Python :: 3
-Classifier: Programming Language :: Python :: 3.4
Classifier: Programming Language :: Python :: 3.5
Classifier: Programming Language :: Python :: 3.6
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
+Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Topic :: Software Development :: Testing
-Requires-Python: >=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*
+Requires-Python: >=3.5
Provides-Extra: dev
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pytest-mock-2.0.0/src/pytest_mock.egg-info/requires.txt new/pytest-mock-3.1.0/src/pytest_mock.egg-info/requires.txt
--- old/pytest-mock-2.0.0/src/pytest_mock.egg-info/requires.txt 2020-01-04 19:44:55.000000000 +0100
+++ new/pytest-mock-3.1.0/src/pytest_mock.egg-info/requires.txt 2020-04-18 17:16:33.000000000 +0200
@@ -1,8 +1,6 @@
pytest>=2.7
-[:python_version < "3.0"]
-mock
-
[dev]
pre-commit
tox
+pytest-asyncio
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pytest-mock-2.0.0/tests/test_pytest_mock.py new/pytest-mock-3.1.0/tests/test_pytest_mock.py
--- old/pytest-mock-2.0.0/tests/test_pytest_mock.py 2020-01-04 19:44:53.000000000 +0100
+++ new/pytest-mock-3.1.0/tests/test_pytest_mock.py 2020-04-18 17:16:30.000000000 +0200
@@ -14,7 +14,7 @@
)
# Python 3.8 changed the output formatting (bpo-35500), which has been ported to mock 3.0
-NEW_FORMATTING = sys.version_info >= (3, 8) or sys.version_info[0] == 2
+NEW_FORMATTING = sys.version_info >= (3, 8)
@pytest.fixture
@@ -32,7 +32,7 @@
)
-class UnixFS(object):
+class UnixFS:
"""
Wrapper to os functions to simulate a Unix file system, used for testing
the mock fixture.
@@ -183,7 +183,7 @@
def test_repr_with_name(self, mocker):
test_name = "funny walk"
stub = mocker.stub(name=test_name)
- assert "name={0!r}".format(test_name) in repr(stub)
+ assert "name={!r}".format(test_name) in repr(stub)
def __test_failure_message(self, mocker, **kwargs):
expected_name = kwargs.get("name") or "mock"
@@ -206,7 +206,7 @@
def test_instance_method_spy(mocker):
- class Foo(object):
+ class Foo:
def bar(self, arg):
return arg * 2
@@ -222,7 +222,7 @@
def test_instance_method_spy_exception(mocker):
- class Foo(object):
+ class Foo:
def bar(self, arg):
raise Exception("Error with {}".format(arg))
@@ -266,7 +266,7 @@
@skip_pypy
def test_instance_method_by_class_spy(mocker):
- class Foo(object):
+ class Foo:
def bar(self, arg):
return arg * 2
@@ -281,7 +281,7 @@
@skip_pypy
def test_instance_method_by_subclass_spy(mocker):
- class Base(object):
+ class Base:
def bar(self, arg):
return arg * 2
@@ -300,7 +300,7 @@
@skip_pypy
def test_class_method_spy(mocker):
- class Foo(object):
+ class Foo:
@classmethod
def bar(cls, arg):
return arg * 2
@@ -314,9 +314,8 @@
@skip_pypy
-(a)pytest.mark.xfail(sys.version_info[0] == 2, reason="does not work on Python 2")
def test_class_method_subclass_spy(mocker):
- class Base(object):
+ class Base:
@classmethod
def bar(self, arg):
return arg * 2
@@ -337,7 +336,7 @@
class MetaFoo(type):
pass
- class Foo(object):
+ class Foo:
__metaclass__ = MetaFoo
@@ -355,7 +354,7 @@
@skip_pypy
def test_static_method_spy(mocker):
- class Foo(object):
+ class Foo:
@staticmethod
def bar(arg):
return arg * 2
@@ -369,9 +368,8 @@
@skip_pypy
-(a)pytest.mark.xfail(sys.version_info[0] == 2, reason="does not work on Python 2")
def test_static_method_subclass_spy(mocker):
- class Base(object):
+ class Base:
@staticmethod
def bar(arg):
return arg * 2
@@ -407,6 +405,21 @@
assert spy.spy_return == 20
+(a)pytest.mark.asyncio
+async def test_instance_async_method_spy(mocker):
+ class Foo:
+ async def bar(self, arg):
+ return arg * 2
+
+ foo = Foo()
+ spy = mocker.spy(foo, "bar")
+
+ result = await foo.bar(10)
+
+ spy.assert_called_once_with(10)
+ assert result == 20
+
+
@contextmanager
def assert_traceback():
"""
@@ -442,10 +455,6 @@
raise AssertionError("DID NOT RAISE")
-(a)pytest.mark.skipif(
- sys.version_info[:2] == (3, 4),
- reason="assert_not_called not available in Python 3.4",
-)
def test_assert_not_called_wrapper(mocker):
stub = mocker.stub()
stub.assert_not_called()
@@ -498,8 +507,8 @@
def test_assert_called_args_with_introspection(mocker):
stub = mocker.stub()
- complex_args = ("a", 1, set(["test"]))
- wrong_args = ("b", 2, set(["jest"]))
+ complex_args = ("a", 1, {"test"})
+ wrong_args = ("b", 2, {"jest"})
stub(*complex_args)
stub.assert_called_with(*complex_args)
@@ -631,7 +640,6 @@
assert result.stdout.lines == []
-(a)pytest.mark.skipif(sys.version_info[0] < 3, reason="Py3 only")
def test_standalone_mock(testdir):
"""Check that the "mock_use_standalone" is being used.
"""
@@ -720,7 +728,7 @@
stub(b"l\xc3\xb6k".decode("UTF-8"))
with pytest.raises(AssertionError):
- stub.assert_called_with(u"lak")
+ stub.assert_called_with("lak")
def test_plain_stopall(testdir):
@@ -745,7 +753,7 @@
def test_abort_patch_object_context_manager(mocker):
- class A(object):
+ class A:
def doIt(self):
return False
@@ -753,7 +761,7 @@
with pytest.raises(ValueError) as excinfo:
with mocker.patch.object(a, "doIt", return_value=True):
- assert a.doIt() == True
+ assert a.doIt() is True
expected_error_msg = (
"Using mocker in a with context is not supported. "
@@ -803,7 +811,7 @@
result = testdir.runpytest()
result.stdout.fnmatch_lines("* 1 passed *")
- kwargs = {"legacy": True} if sys.version_info[0] >= 3 else {}
+ kwargs = {"legacy": True}
assert compileall.compile_file(str(py_fn), **kwargs)
pyc_fn = str(py_fn) + "c"
@@ -812,3 +820,97 @@
py_fn.remove()
result = testdir.runpytest()
result.stdout.fnmatch_lines("* 1 passed *")
+
+
+def test_used_with_class_scope(testdir):
+ """..."""
+ testdir.makepyfile(
+ """
+ import pytest
+ import random
+ import unittest
+
+ def get_random_number():
+ return random.randint(0, 1)
+
+ @pytest.fixture(autouse=True, scope="class")
+ def randint_mock(class_mocker):
+ return class_mocker.patch("random.randint", lambda x, y: 5)
+
+ class TestGetRandomNumber(unittest.TestCase):
+ def test_get_random_number(self):
+ assert get_random_number() == 5
+ """
+ )
+ result = testdir.runpytest_subprocess()
+ assert "AssertionError" not in result.stderr.str()
+ result.stdout.fnmatch_lines("* 1 passed in *")
+
+
+def test_used_with_module_scope(testdir):
+ """..."""
+ testdir.makepyfile(
+ """
+ import pytest
+ import random
+
+ def get_random_number():
+ return random.randint(0, 1)
+
+ @pytest.fixture(autouse=True, scope="module")
+ def randint_mock(module_mocker):
+ return module_mocker.patch("random.randint", lambda x, y: 5)
+
+ def test_get_random_number():
+ assert get_random_number() == 5
+ """
+ )
+ result = testdir.runpytest_subprocess()
+ assert "AssertionError" not in result.stderr.str()
+ result.stdout.fnmatch_lines("* 1 passed in *")
+
+
+def test_used_with_package_scope(testdir):
+ """..."""
+ testdir.makepyfile(
+ """
+ import pytest
+ import random
+
+ def get_random_number():
+ return random.randint(0, 1)
+
+ @pytest.fixture(autouse=True, scope="package")
+ def randint_mock(package_mocker):
+ return package_mocker.patch("random.randint", lambda x, y: 5)
+
+ def test_get_random_number():
+ assert get_random_number() == 5
+ """
+ )
+ result = testdir.runpytest_subprocess()
+ assert "AssertionError" not in result.stderr.str()
+ result.stdout.fnmatch_lines("* 1 passed in *")
+
+
+def test_used_with_session_scope(testdir):
+ """..."""
+ testdir.makepyfile(
+ """
+ import pytest
+ import random
+
+ def get_random_number():
+ return random.randint(0, 1)
+
+ @pytest.fixture(autouse=True, scope="session")
+ def randint_mock(session_mocker):
+ return session_mocker.patch("random.randint", lambda x, y: 5)
+
+ def test_get_random_number():
+ assert get_random_number() == 5
+ """
+ )
+ result = testdir.runpytest_subprocess()
+ assert "AssertionError" not in result.stderr.str()
+ result.stdout.fnmatch_lines("* 1 passed in *")
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pytest-mock-2.0.0/tox.ini new/pytest-mock-3.1.0/tox.ini
--- old/pytest-mock-2.0.0/tox.ini 2020-01-04 19:44:53.000000000 +0100
+++ new/pytest-mock-3.1.0/tox.ini 2020-04-18 17:16:30.000000000 +0200
@@ -1,10 +1,11 @@
[tox]
-envlist = py{27,34,35,36,37,38}, linting, norewrite
+envlist = py{35,36,37,38}, linting, norewrite
[testenv]
passenv = USER USERNAME
deps =
coverage
+ pytest-asyncio
commands =
coverage run --append --source={envsitepackagesdir}/pytest_mock -m pytest tests
1
0
Hello community,
here is the log from the commit of package python-pytest-sugar for openSUSE:Factory checked in at 2020-05-01 11:05:51
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-pytest-sugar (Old)
and /work/SRC/openSUSE:Factory/.python-pytest-sugar.new.2738 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-pytest-sugar"
Fri May 1 11:05:51 2020 rev:6 rq:798131 version:0.9.3
Changes:
--------
--- /work/SRC/openSUSE:Factory/python-pytest-sugar/python-pytest-sugar.changes 2019-07-30 13:06:12.570375040 +0200
+++ /work/SRC/openSUSE:Factory/.python-pytest-sugar.new.2738/python-pytest-sugar.changes 2020-05-01 11:06:03.202894935 +0200
@@ -1,0 +2,7 @@
+Mon Apr 27 09:30:57 UTC 2020 - Tomáš Chvátal <tchvatal(a)suse.com>
+
+- Update to 0.9.3:
+ * Fix incompatibility with pytest 5.4.0 (thanks @GuillaumeFavelier)
+- Drop patch pytest4.patch
+
+-------------------------------------------------------------------
Old:
----
pytest-sugar-0.9.2.tar.gz
pytest4.patch
New:
----
pytest-sugar-0.9.3.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ python-pytest-sugar.spec ++++++
--- /var/tmp/diff_new_pack.SFrKeM/_old 2020-05-01 11:06:05.258899406 +0200
+++ /var/tmp/diff_new_pack.SFrKeM/_new 2020-05-01 11:06:05.262899415 +0200
@@ -1,7 +1,7 @@
#
# spec file for package python-pytest-sugar
#
-# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany.
+# Copyright (c) 2020 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -18,20 +18,18 @@
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
Name: python-pytest-sugar
-Version: 0.9.2
+Version: 0.9.3
Release: 0
Summary: Pretty printer for pytest progress
License: BSD-3-Clause
-Group: Development/Languages/Python
URL: https://github.com/Frozenball/pytest-sugar
Source: https://files.pythonhosted.org/packages/source/p/pytest-sugar/pytest-sugar-…
-Patch0: pytest4.patch
BuildRequires: %{python_module pytest}
BuildRequires: %{python_module setuptools}
BuildRequires: %{python_module termcolor}
BuildRequires: fdupes
BuildRequires: python-rpm-macros
-Requires: python-pytest < 5.0
+Requires: python-pytest
Requires: python-termcolor
BuildArch: noarch
%python_subpackages
@@ -41,7 +39,6 @@
%prep
%setup -q -n pytest-sugar-%{version}
-%patch0 -p1
%build
%python_build
++++++ pytest-sugar-0.9.2.tar.gz -> pytest-sugar-0.9.3.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pytest-sugar-0.9.2/CHANGES.rst new/pytest-sugar-0.9.3/CHANGES.rst
--- old/pytest-sugar-0.9.2/CHANGES.rst 2018-11-08 21:52:48.000000000 +0100
+++ new/pytest-sugar-0.9.3/CHANGES.rst 2020-04-26 15:31:38.000000000 +0200
@@ -3,6 +3,11 @@
A list of changes between each release.
+0.9.3 (2020-04-26)
+^^^^^^^^^^^^^^^^^^^
+
+- Fix incompatibility with pytest 5.4.0 (thanks @GuillaumeFavelier)
+
0.9.2 (2018-11-8)
^^^^^^^^^^^^^^^^^^^
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pytest-sugar-0.9.2/PKG-INFO new/pytest-sugar-0.9.3/PKG-INFO
--- old/pytest-sugar-0.9.2/PKG-INFO 2018-11-08 22:06:11.000000000 +0100
+++ new/pytest-sugar-0.9.3/PKG-INFO 2020-04-26 15:32:40.000000000 +0200
@@ -1,6 +1,6 @@
-Metadata-Version: 2.1
+Metadata-Version: 1.1
Name: pytest-sugar
-Version: 0.9.2
+Version: 0.9.3
Summary: pytest-sugar is a plugin for pytest that changes the default look and feel of pytest (e.g. progressbar, show tests that fail instantly).
Home-page: http://pivotfinland.com/pytest-sugar/
Author: Teemu, Janne Vanhala and others
@@ -8,12 +8,13 @@
License: BSD
Description: # pytest-sugar
- [![](https://travis-ci.org/Frozenball/pytest-sugar.svg?branch=master)](https://travis-ci.org/Frozenball/pytest-sugar) ![](https://img.shields.io/pypi/v/pytest-sugar.svg)
+ [![Build status](https://travis-ci.org/Teemu/pytest-sugar.svg?branch=master)](https:…
+ [![Pypi version](https://img.shields.io/pypi/v/pytest-sugar.svg)](https://pypi.org/…
pytest-sugar is a plugin for [py.test](http://pytest.org) that shows
failures and errors instantly and shows a progress bar.
- ![](http://pivotfinland.com/pytest-sugar/img/video.gif)
+ ![Demo](http://pivotfinland.com/pytest-sugar/img/video.gif)
## Requirements
@@ -28,23 +29,23 @@
To install pytest-sugar:
- $ pip install pytest-sugar
+ pip install pytest-sugar
Then run your tests with:
- $ py.test
+ py.test
If you would like more detailed output (one test per line), then you may use the verbose option:
- $ py.test --verbose
+ py.test --verbose
If you would like to run tests without pytest-sugar, use:
- $ py.test -p no:sugar
+ py.test -p no:sugar
## Running on Windows
- If you are seeing gibberish, you might want to try changing charset and fonts. See [this comment]( https://github.com/Frozenball/pytest-sugar/pull/49#issuecomment-146567670) for more details.
+ If you are seeing gibberish, you might want to try changing charset and fonts. See [this comment]( https://github.com/Teemu/pytest-sugar/pull/49#issuecomment-146567670) for more details.
Platform: any
Classifier: Development Status :: 3 - Alpha
@@ -64,4 +65,3 @@
Classifier: Programming Language :: Python :: 3.6
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: Implementation :: PyPy
-Description-Content-Type: text/markdown
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pytest-sugar-0.9.2/README.md new/pytest-sugar-0.9.3/README.md
--- old/pytest-sugar-0.9.2/README.md 2018-02-06 14:31:18.000000000 +0100
+++ new/pytest-sugar-0.9.3/README.md 2020-04-26 15:25:49.000000000 +0200
@@ -1,11 +1,12 @@
# pytest-sugar
-[![](https://travis-ci.org/Frozenball/pytest-sugar.svg?branch=master)](https://travis-ci.org/Frozenball/pytest-sugar) ![](https://img.shields.io/pypi/v/pytest-sugar.svg)
+[![Build status](https://travis-ci.org/Teemu/pytest-sugar.svg?branch=master)](https:…
+[![Pypi version](https://img.shields.io/pypi/v/pytest-sugar.svg)](https://pypi.org/…
pytest-sugar is a plugin for [py.test](http://pytest.org) that shows
failures and errors instantly and shows a progress bar.
-![](http://pivotfinland.com/pytest-sugar/img/video.gif)
+![Demo](http://pivotfinland.com/pytest-sugar/img/video.gif)
## Requirements
@@ -20,20 +21,20 @@
To install pytest-sugar:
- $ pip install pytest-sugar
+ pip install pytest-sugar
Then run your tests with:
- $ py.test
+ py.test
If you would like more detailed output (one test per line), then you may use the verbose option:
- $ py.test --verbose
+ py.test --verbose
If you would like to run tests without pytest-sugar, use:
- $ py.test -p no:sugar
+ py.test -p no:sugar
## Running on Windows
-If you are seeing gibberish, you might want to try changing charset and fonts. See [this comment]( https://github.com/Frozenball/pytest-sugar/pull/49#issuecomment-146567670) for more details.
+If you are seeing gibberish, you might want to try changing charset and fonts. See [this comment]( https://github.com/Teemu/pytest-sugar/pull/49#issuecomment-146567670) for more details.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pytest-sugar-0.9.2/pytest_sugar.egg-info/PKG-INFO new/pytest-sugar-0.9.3/pytest_sugar.egg-info/PKG-INFO
--- old/pytest-sugar-0.9.2/pytest_sugar.egg-info/PKG-INFO 2018-11-08 22:06:11.000000000 +0100
+++ new/pytest-sugar-0.9.3/pytest_sugar.egg-info/PKG-INFO 2020-04-26 15:32:40.000000000 +0200
@@ -1,6 +1,6 @@
-Metadata-Version: 2.1
+Metadata-Version: 1.1
Name: pytest-sugar
-Version: 0.9.2
+Version: 0.9.3
Summary: pytest-sugar is a plugin for pytest that changes the default look and feel of pytest (e.g. progressbar, show tests that fail instantly).
Home-page: http://pivotfinland.com/pytest-sugar/
Author: Teemu, Janne Vanhala and others
@@ -8,12 +8,13 @@
License: BSD
Description: # pytest-sugar
- [![](https://travis-ci.org/Frozenball/pytest-sugar.svg?branch=master)](https://travis-ci.org/Frozenball/pytest-sugar) ![](https://img.shields.io/pypi/v/pytest-sugar.svg)
+ [![Build status](https://travis-ci.org/Teemu/pytest-sugar.svg?branch=master)](https:…
+ [![Pypi version](https://img.shields.io/pypi/v/pytest-sugar.svg)](https://pypi.org/…
pytest-sugar is a plugin for [py.test](http://pytest.org) that shows
failures and errors instantly and shows a progress bar.
- ![](http://pivotfinland.com/pytest-sugar/img/video.gif)
+ ![Demo](http://pivotfinland.com/pytest-sugar/img/video.gif)
## Requirements
@@ -28,23 +29,23 @@
To install pytest-sugar:
- $ pip install pytest-sugar
+ pip install pytest-sugar
Then run your tests with:
- $ py.test
+ py.test
If you would like more detailed output (one test per line), then you may use the verbose option:
- $ py.test --verbose
+ py.test --verbose
If you would like to run tests without pytest-sugar, use:
- $ py.test -p no:sugar
+ py.test -p no:sugar
## Running on Windows
- If you are seeing gibberish, you might want to try changing charset and fonts. See [this comment]( https://github.com/Frozenball/pytest-sugar/pull/49#issuecomment-146567670) for more details.
+ If you are seeing gibberish, you might want to try changing charset and fonts. See [this comment]( https://github.com/Teemu/pytest-sugar/pull/49#issuecomment-146567670) for more details.
Platform: any
Classifier: Development Status :: 3 - Alpha
@@ -64,4 +65,3 @@
Classifier: Programming Language :: Python :: 3.6
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: Implementation :: PyPy
-Description-Content-Type: text/markdown
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pytest-sugar-0.9.2/pytest_sugar.py new/pytest-sugar-0.9.3/pytest_sugar.py
--- old/pytest-sugar-0.9.2/pytest_sugar.py 2018-11-08 21:56:59.000000000 +0100
+++ new/pytest-sugar-0.9.3/pytest_sugar.py 2020-04-26 15:31:18.000000000 +0200
@@ -28,7 +28,7 @@
from _pytest.terminal import TerminalReporter
-__version__ = '0.9.2'
+__version__ = '0.9.3'
LEN_RIGHT_MARGIN = 0
LEN_PROGRESS_PERCENTAGE = 5
@@ -211,7 +211,6 @@
class SugarTerminalReporter(TerminalReporter):
def __init__(self, reporter):
TerminalReporter.__init__(self, reporter.config)
- self.writer = self._tw
self.paths_left = []
self.tests_count = 0
self.tests_taken = 0
@@ -339,14 +338,14 @@
def overwrite(self, line, rel_line_num):
# Move cursor up rel_line_num lines
if rel_line_num > 0:
- self.writer.write("\033[%dA" % rel_line_num)
+ self.write("\033[%dA" % rel_line_num)
# Overwrite the line
- self.writer.write("\r%s" % line)
+ self.write("\r%s" % line)
# Return cursor to original line
if rel_line_num > 0:
- self.writer.write("\033[%dB" % rel_line_num)
+ self.write("\033[%dB" % rel_line_num)
def get_max_column_for_test_status(self):
return (
@@ -389,7 +388,7 @@
else:
self.current_lines[path] = " " * (2 + len(fspath))
self.current_line_nums[path] = self.current_line_num
- self.writer.write("\r\n")
+ self.write("\r\n")
def reached_last_column_for_test_status(self, report):
len_line = real_string_length(
@@ -616,11 +615,13 @@
self.write_line(line)
else:
msg = self._getfailureheadline(report)
- if not hasattr(report, 'when'):
+ # "when" was unset before pytest 4.2 for collection errors.
+ when = getattr(report, "when", "collect")
+ if when == "collect":
msg = "ERROR collecting " + msg
- elif report.when == "setup":
+ elif when == "setup":
msg = "ERROR at setup of " + msg
- elif report.when == "teardown":
+ elif when == "teardown":
msg = "ERROR at teardown of " + msg
self.write_line('')
self.write_sep("―", msg)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pytest-sugar-0.9.2/setup.cfg new/pytest-sugar-0.9.3/setup.cfg
--- old/pytest-sugar-0.9.2/setup.cfg 2018-11-08 22:06:11.000000000 +0100
+++ new/pytest-sugar-0.9.3/setup.cfg 2020-04-26 15:32:40.000000000 +0200
@@ -4,4 +4,5 @@
[egg_info]
tag_build =
tag_date = 0
+tag_svn_revision = 0
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pytest-sugar-0.9.2/test_sugar.py new/pytest-sugar-0.9.3/test_sugar.py
--- old/pytest-sugar-0.9.2/test_sugar.py 2018-11-08 22:04:26.000000000 +0100
+++ new/pytest-sugar-0.9.3/test_sugar.py 2020-04-26 15:25:49.000000000 +0200
@@ -269,7 +269,7 @@
assert 0
"""
)
- result = testdir.runpytest('-p no:sugar', '-s')
+ result = testdir.runpytest('-s')
result.stdout.fnmatch_lines([
'*test_one_passed*',
'*100%*',
@@ -547,7 +547,7 @@
\"\"\"
"""
)
- result = testdir.runpytest('--force-sugar', '--doctest-module')
+ result = testdir.runpytest('--force-sugar', '--doctest-modules')
assert result.ret == 1, result.stderr.str()
@@ -567,7 +567,7 @@
raise NotImplementedError
"""
)
- result = testdir.runpytest('--force-sugar', '--doctest-module')
+ result = testdir.runpytest('--force-sugar', '--doctest-modules')
assert result.ret == 1, result.stderr.str()
result.stdout.fnmatch_lines([
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pytest-sugar-0.9.2/tox.ini new/pytest-sugar-0.9.3/tox.ini
--- old/pytest-sugar-0.9.2/tox.ini 2018-11-08 21:49:48.000000000 +0100
+++ new/pytest-sugar-0.9.3/tox.ini 2020-04-26 15:25:49.000000000 +0200
@@ -1,33 +1,41 @@
-# Tox (http://tox.testrun.org/) is a tool for running tests
-# in multiple virtualenvs. This configuration file will run the
-# test suite on all supported python versions. To use it, "pip install tox"
-# and then run "tox" from this directory.
-
[tox]
-envlist = py{27,34,35,36,py}-pytest30-supported-xdist,
- py{27,35}-pytest30-unsupported-xdist,
- py{27,34,py}-pytest31-supported-xdist
- py{27,34,py}-pytest34-supported-xdist
+envlist = py{27,34,35,36,37,py}-pytest39-{supported,unsupported}-xdist
qa
[testenv]
-passenv = CI TRAVIS_BUILD_ID TRAVIS TRAVIS_BRANCH TRAVIS_JOB_NUMBER TRAVIS_PULL_REQUEST TRAVIS_JOB_ID TRAVIS_REPO_SLUG TRAVIS_COMMIT
deps =
- codecov>=1.4.0
pytest-cov
- pytest30: pytest>=3.0,<3.1
- pytest31: pytest>=3.1,<3.2
- pytest34: pytest>=3.4,<3.5
+ pytest36: pytest>=3.6,<3.7
pytest37: pytest>=3.7,<3.8
+ pytest38: pytest>=3.8,<3.9
pytest39: pytest>=3.9,<3.10
pytest310: pytest>=3.10,<3.11
+ pytest40: pytest>=4.0,<4.1
+ pytest41: pytest>=4.1,<4.2
+ pytest42: pytest>=4.2,<4.3
+ pytest43: pytest>=4.3,<4.4
+ pytest44: pytest>=4.4,<4.5
+ pytest45: pytest>=4.5,<4.6
+ pytest46: pytest>=4.6,<4.7
+ pytest54: pytest>=5.4,<5.5
termcolor>=1.1.0
- supported-xdist: pytest-xdist>=1.14
+ supported-xdist: pytest-xdist{env:_TOX_SUGAR_XDIST_VERSION:>=1.14}
unsupported-xdist: pytest-xdist<1.14
rerunfailures: pytest-rerunfailures
+ pinned-attrs: attrs<19.2
+setenv =
+ # pytest-xdist >= 1.28 requires pytest 4.4
+ pytest{36,37,38,39,310,40,41,42,43}: _TOX_SUGAR_XDIST_VERSION=>=1.14,<1.28
commands =
- py.test --cov --cov-config=.coveragerc {posargs:test_sugar.py}
- codecov -e TOXENV
+ pytest --cov --cov-config=.coveragerc {posargs:test_sugar.py}
+
+# Oldest supported (testable) version.
+[testenv:pytest30]
+deps =
+ pytest>=3.0,<3.1
+ pytest-xdist<1.25
+ pytest-forked<0.3
+ pytest-cov<2.6.1
[testenv:qa]
deps =
1
0
Hello community,
here is the log from the commit of package python-mox3 for openSUSE:Factory checked in at 2020-05-01 11:05:33
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-mox3 (Old)
and /work/SRC/openSUSE:Factory/.python-mox3.new.2738 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-mox3"
Fri May 1 11:05:33 2020 rev:12 rq:797837 version:1.0.0
Changes:
--------
--- /work/SRC/openSUSE:Factory/python-mox3/python-mox3.changes 2020-01-04 19:20:24.129112271 +0100
+++ /work/SRC/openSUSE:Factory/.python-mox3.new.2738/python-mox3.changes 2020-05-01 11:05:56.250879816 +0200
@@ -1,0 +2,11 @@
+Fri Feb 28 23:00:31 UTC 2020 - Dirk Mueller <dmueller(a)suse.com>
+
+- update to 1.0.0:
+ * tox.ini & Setup.cfg cleanups
+ * Drop python 2.7 support and testing
+ * Switch to Ussuri jobs
+ * Blacklist sphinx 2.1.0 (autodoc bug)
+ * Update the constraints url
+ * Remove flake8 from the test-requirements
+
+-------------------------------------------------------------------
Old:
----
mox3-0.28.0.tar.gz
New:
----
mox3-1.0.0.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ python-mox3.spec ++++++
--- /var/tmp/diff_new_pack.Htv57i/_old 2020-05-01 11:05:58.850885471 +0200
+++ /var/tmp/diff_new_pack.Htv57i/_new 2020-05-01 11:05:58.850885471 +0200
@@ -1,7 +1,7 @@
#
# spec file for package python-mox3
#
-# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany.
+# Copyright (c) 2020 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -17,8 +17,9 @@
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
+%global skip_python2 1
Name: python-mox3
-Version: 0.28.0
+Version: 1.0.0
Release: 0
Summary: An unofficial port of the Google mox framework to Python 3
License: Apache-2.0
@@ -88,9 +89,7 @@
%fdupes %{buildroot}%{_docdir}/%{name}/html
%check
-%{python_expand rm -rf .testrepository
-stestr-%{$python_bin_suffix} run
-}
+%python_exec -m stestr.cli run
%files %{python_files}
%license COPYING.txt
++++++ mox3-0.28.0.tar.gz -> mox3-1.0.0.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mox3-0.28.0/.zuul.yaml new/mox3-1.0.0/.zuul.yaml
--- old/mox3-0.28.0/.zuul.yaml 2019-09-04 16:20:48.000000000 +0200
+++ new/mox3-1.0.0/.zuul.yaml 2020-02-07 14:08:30.000000000 +0100
@@ -2,7 +2,6 @@
templates:
- check-requirements
- openstack-lower-constraints-jobs
- - openstack-python-jobs
- - openstack-python3-train-jobs
+ - openstack-python3-ussuri-jobs
- periodic-stable-jobs
- publish-openstack-docs-pti
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mox3-0.28.0/AUTHORS new/mox3-1.0.0/AUTHORS
--- old/mox3-0.28.0/AUTHORS 2019-09-04 16:21:49.000000000 +0200
+++ new/mox3-1.0.0/AUTHORS 2020-02-07 14:09:32.000000000 +0100
@@ -24,6 +24,7 @@
jacky06 <zhang.min(a)99cloud.net>
kavithahr <kavitha.r(a)nectechnologies.in>
melissaml <ma.lei(a)99cloud.net>
+pengyuesheng <pengyuesheng(a)gohighsec.com>
ritesh.arya <ritesh.arya(a)nectechnologies.in>
smiddlek <smiddlek@b1010a0a-674b-0410-b734-77272b80c875>
zhulingjie <easyzlj(a)gmail.com>
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mox3-0.28.0/ChangeLog new/mox3-1.0.0/ChangeLog
--- old/mox3-0.28.0/ChangeLog 2019-09-04 16:21:49.000000000 +0200
+++ new/mox3-1.0.0/ChangeLog 2020-02-07 14:09:32.000000000 +0100
@@ -1,6 +1,16 @@
CHANGES
=======
+1.0.0
+-----
+
+* tox.ini & Setup.cfg cleanups
+* Drop python 2.7 support and testing
+* Switch to Ussuri jobs
+* Blacklist sphinx 2.1.0 (autodoc bug)
+* Update the constraints url
+* Remove flake8 from the test-requirements
+
0.28.0
------
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mox3-0.28.0/PKG-INFO new/mox3-1.0.0/PKG-INFO
--- old/mox3-0.28.0/PKG-INFO 2019-09-04 16:21:49.000000000 +0200
+++ new/mox3-1.0.0/PKG-INFO 2020-02-07 14:09:32.000000000 +0100
@@ -1,6 +1,6 @@
-Metadata-Version: 1.1
+Metadata-Version: 1.2
Name: mox3
-Version: 0.28.0
+Version: 1.0.0
Summary: Mock object framework for Python
Home-page: https://docs.openstack.org/mox3/latest/
Author: OpenStack
@@ -76,7 +76,6 @@
Classifier: Environment :: OpenStack
Classifier: Programming Language :: Python
Classifier: License :: OSI Approved :: Apache Software License
-Classifier: Programming Language :: Python :: 2.7
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.6
Classifier: Programming Language :: Python :: 3.7
@@ -84,3 +83,4 @@
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Topic :: Software Development :: Testing
+Requires-Python: >=3.6
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mox3-0.28.0/mox3.egg-info/PKG-INFO new/mox3-1.0.0/mox3.egg-info/PKG-INFO
--- old/mox3-0.28.0/mox3.egg-info/PKG-INFO 2019-09-04 16:21:49.000000000 +0200
+++ new/mox3-1.0.0/mox3.egg-info/PKG-INFO 2020-02-07 14:09:32.000000000 +0100
@@ -1,6 +1,6 @@
-Metadata-Version: 1.1
+Metadata-Version: 1.2
Name: mox3
-Version: 0.28.0
+Version: 1.0.0
Summary: Mock object framework for Python
Home-page: https://docs.openstack.org/mox3/latest/
Author: OpenStack
@@ -76,7 +76,6 @@
Classifier: Environment :: OpenStack
Classifier: Programming Language :: Python
Classifier: License :: OSI Approved :: Apache Software License
-Classifier: Programming Language :: Python :: 2.7
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.6
Classifier: Programming Language :: Python :: 3.7
@@ -84,3 +83,4 @@
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Topic :: Software Development :: Testing
+Requires-Python: >=3.6
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mox3-0.28.0/mox3.egg-info/pbr.json new/mox3-1.0.0/mox3.egg-info/pbr.json
--- old/mox3-0.28.0/mox3.egg-info/pbr.json 2019-09-04 16:21:49.000000000 +0200
+++ new/mox3-1.0.0/mox3.egg-info/pbr.json 2020-02-07 14:09:32.000000000 +0100
@@ -1 +1 @@
-{"git_version": "0a1e5b9", "is_release": true}
\ No newline at end of file
+{"git_version": "fa22a33", "is_release": true}
\ No newline at end of file
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mox3-0.28.0/setup.cfg new/mox3-1.0.0/setup.cfg
--- old/mox3-0.28.0/setup.cfg 2019-09-04 16:21:49.000000000 +0200
+++ new/mox3-1.0.0/setup.cfg 2020-02-07 14:09:32.000000000 +0100
@@ -6,11 +6,11 @@
author = OpenStack
author-email = openstack-discuss(a)lists.openstack.org
home-page = https://docs.openstack.org/mox3/latest/
+python-requires = >=3.6
classifiers =
Environment :: OpenStack
Programming Language :: Python
License :: OSI Approved :: Apache Software License
- Programming Language :: Python :: 2.7
Programming Language :: Python :: 3
Programming Language :: Python :: 3.6
Programming Language :: Python :: 3.7
@@ -23,22 +23,10 @@
packages =
mox3
-[wheel]
-universal = 1
-
[global]
setup-hooks =
pbr.hooks.setup_hook
-[build_sphinx]
-source-dir = doc/source
-build-dir = doc/build
-all_files = 1
-warning-is-error = 1
-
-[upload_sphinx]
-upload-dir = doc/build/html
-
[egg_info]
tag_build =
tag_date = 0
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mox3-0.28.0/test-requirements.txt new/mox3-1.0.0/test-requirements.txt
--- old/mox3-0.28.0/test-requirements.txt 2019-09-04 16:20:48.000000000 +0200
+++ new/mox3-1.0.0/test-requirements.txt 2020-02-07 14:08:30.000000000 +0100
@@ -3,9 +3,6 @@
# process, which may cause wedges in the gate later.
# this file lists dependencies required for the testing of heat
-# Install flake8 first, it pulls in the right linter versions
-flake8<2.6.0,>=2.5.4 # MIT
-
coverage!=4.4,>=4.0 # Apache-2.0
python-subunit>=1.0.0 # Apache-2.0/BSD
stestr>=2.0.0 # Apache-2.0
@@ -14,7 +11,6 @@
six>=1.10.0 # MIT
# this is required for the docs build jobs
-sphinx!=1.6.6,!=1.6.7,>=1.6.5,<2.0.0;python_version=='2.7' # BSD
-sphinx!=1.6.6,!=1.6.7,>=1.6.5;python_version>='3.4' # BSD
+sphinx!=1.6.6,!=1.6.7,!=2.1.0,>=1.6.5 # BSD
openstackdocstheme>=1.18.1 # Apache-2.0
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mox3-0.28.0/tox.ini new/mox3-1.0.0/tox.ini
--- old/mox3-0.28.0/tox.ini 2019-09-04 16:20:48.000000000 +0200
+++ new/mox3-1.0.0/tox.ini 2020-02-07 14:08:30.000000000 +0100
@@ -1,25 +1,27 @@
[tox]
-minversion = 2.0
-envlist = py27,py37,pep8
+minversion = 3.1.1
+envlist = py37,pep8
+ignore_basepython_conflict = True
[testenv]
-install_command = pip install {opts} {packages}
+basepython = python3
deps =
- -c{env:UPPER_CONSTRAINTS_FILE:https://opendev.org/openstack/requirements/raw/branch/master/upper-constraints.txt}
+ -c{env:UPPER_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master}
-r{toxinidir}/requirements.txt
-r{toxinidir}/test-requirements.txt
commands = stestr run --slowest {posargs}
[testenv:docs]
-basepython = python3
-commands = python setup.py build_sphinx
+commands =
+ rm -rf doc/build/html doc/build/doctrees
+ sphinx-build -W --keep-going -b html -d doc/build/doctrees doc/source doc/build/html
[testenv:pep8]
-basepython = python3
+deps =
+ flake8<2.7.0,>=2.6.0
commands = flake8
[testenv:venv]
-basepython = python3
commands = {posargs}
[flake8]
@@ -28,7 +30,6 @@
exclude=.git,.tox,dist,doc,*openstack/common*,*lib/python*,*egg
[testenv:lower-constraints]
-basepython = python3
deps =
-c{toxinidir}/lower-constraints.txt
-r{toxinidir}/test-requirements.txt
1
0
Hello community,
here is the log from the commit of package python-rpm-macros for openSUSE:Factory checked in at 2020-05-01 11:05:19
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-rpm-macros (Old)
and /work/SRC/openSUSE:Factory/.python-rpm-macros.new.2738 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-rpm-macros"
Fri May 1 11:05:19 2020 rev:25 rq:797835 version:20200207.5feb6c1
Changes:
--------
--- /work/SRC/openSUSE:Factory/python-rpm-macros/python-rpm-macros.changes 2020-02-03 11:10:32.549760753 +0100
+++ /work/SRC/openSUSE:Factory/.python-rpm-macros.new.2738/python-rpm-macros.changes 2020-05-01 11:05:37.786839662 +0200
@@ -1,0 +2,6 @@
+Tue Apr 21 11:43:04 UTC 2020 - mcepl(a)cepl.eu
+
+- Update to version 20200207.5feb6c1:
+ * Do not write .pyc files for tests
+
+-------------------------------------------------------------------
Old:
----
python-rpm-macros-20200117.8e39013.tar.bz2
New:
----
python-rpm-macros-20200207.5feb6c1.tar.xz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ python-rpm-macros.spec ++++++
--- /var/tmp/diff_new_pack.4EEfw6/_old 2020-05-01 11:05:41.654848074 +0200
+++ /var/tmp/diff_new_pack.4EEfw6/_new 2020-05-01 11:05:41.654848074 +0200
@@ -17,12 +17,12 @@
Name: python-rpm-macros
-Version: 20200117.8e39013
+Version: 20200207.5feb6c1
Release: 0
Summary: RPM macros for building of Python modules
License: WTFPL
URL: https://github.com/opensuse/python-rpm-macros
-Source: python-rpm-macros-%{version}.tar.bz2
+Source: python-rpm-macros-%{version}.tar.xz
# Fedora compatibility
Provides: python2-rpm-macros
Provides: python3-rpm-macros
++++++ _service ++++++
--- /var/tmp/diff_new_pack.4EEfw6/_old 2020-05-01 11:05:41.686848143 +0200
+++ /var/tmp/diff_new_pack.4EEfw6/_new 2020-05-01 11:05:41.686848143 +0200
@@ -11,7 +11,7 @@
</service>
<service mode="disabled" name="recompress">
<param name="file">python-rpm-macros-*.tar</param>
- <param name="compression">bz2</param>
+ <param name="compression">xz</param>
</service>
<service mode="disabled" name="set_version">
<param name="basename">python-rpm-macros</param>
++++++ _servicedata ++++++
--- /var/tmp/diff_new_pack.4EEfw6/_old 2020-05-01 11:05:41.710848195 +0200
+++ /var/tmp/diff_new_pack.4EEfw6/_new 2020-05-01 11:05:41.714848204 +0200
@@ -1,4 +1,4 @@
<servicedata>
<service name="tar_scm">
<param name="url">git://github.com/openSUSE/python-rpm-macros.git</param>
- <param name="changesrevision">8e390130273e5c31158c8c829970d378d62e74ae</param></service></servicedata>
\ No newline at end of file
+ <param name="changesrevision">91c83c37edda405ac0e1f78ef1c179cc65230ce9</param></service></servicedata>
\ No newline at end of file
1
0
Hello community,
here is the log from the commit of package python-jupyter-client for openSUSE:Factory checked in at 2020-05-01 11:05:11
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-jupyter-client (Old)
and /work/SRC/openSUSE:Factory/.python-jupyter-client.new.2738 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-jupyter-client"
Fri May 1 11:05:11 2020 rev:3 rq:797791 version:6.1.3
Changes:
--------
--- /work/SRC/openSUSE:Factory/python-jupyter-client/python-jupyter-client.changes 2020-04-25 20:11:15.435910575 +0200
+++ /work/SRC/openSUSE:Factory/.python-jupyter-client.new.2738/python-jupyter-client.changes 2020-05-01 11:05:17.386795297 +0200
@@ -1,0 +2,30 @@
+Sat Apr 25 17:16:52 UTC 2020 - Arun Persaud <arun(a)gmx.de>
+
+- Update to version 6.1.3:
+ * Add AsyncKernelClient client_class to AsyncKernelManager
+ (:ghpull:`542`)
+ * Doc fix for xeus hyperlinks (:ghpull:`540`)
+ * Doc typo fix (:ghpull:`539`)
+
+- changes from version 6.1.2:
+ * Fixed a bug causing clients to sometimes hang after a stop call
+ was made (:ghpull:`536`)
+
+- changes from version 6.1.1:
+ * Subprocess kill action fix for async execution (:ghpull:`535`)
+ * Doc fix for xeus kernel list (:ghpull:`534`)
+
+- changes from version 6.1.0:
+ * This release includes support for asyncio patterns! Downstream
+ tools should soon have releases to additionally support async
+ patterns.
+ * AsyncKernelManager and AsyncMultiKernelManager are now available
+ for async jupyter_client interactions (:ghpull:`528`,
+ :ghpull:`529`)
+ * Removed unused sphinx dependency (:ghpull:`518`, :ghpull:`518`).
+ * Added install instructions for pip to documentation
+ (:ghpull:`521`)
+ * Improved docs around version protocol and messaging
+ (:ghpull:`522`, :ghpull:`526`)
+
+-------------------------------------------------------------------
Old:
----
jupyter_client-6.0.0.tar.gz
New:
----
jupyter_client-6.1.3.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ python-jupyter-client.spec ++++++
--- /var/tmp/diff_new_pack.x7YffL/_old 2020-05-01 11:05:19.086798994 +0200
+++ /var/tmp/diff_new_pack.x7YffL/_new 2020-05-01 11:05:19.090799003 +0200
@@ -24,11 +24,9 @@
%define psuffix %{nil}
%bcond_with test
%endif
-
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
-%define skip_python2 1
Name: python-jupyter-client%{psuffix}
-Version: 6.0.0
+Version: 6.1.3
Release: 0
Summary: Jupyter protocol implementation and client libraries
License: BSD-3-Clause
++++++ jupyter_client-6.0.0.tar.gz -> jupyter_client-6.1.3.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/jupyter_client-6.0.0/PKG-INFO new/jupyter_client-6.1.3/PKG-INFO
--- old/jupyter_client-6.0.0/PKG-INFO 2020-02-24 05:58:18.000000000 +0100
+++ new/jupyter_client-6.1.3/PKG-INFO 2020-04-13 21:48:14.870637400 +0200
@@ -1,6 +1,6 @@
Metadata-Version: 2.1
Name: jupyter_client
-Version: 6.0.0
+Version: 6.1.3
Summary: Jupyter protocol implementation and client libraries
Home-page: https://jupyter.org
Author: Jupyter Development Team
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/jupyter_client-6.0.0/docs/changelog.rst new/jupyter_client-6.1.3/docs/changelog.rst
--- old/jupyter_client-6.0.0/docs/changelog.rst 2020-02-24 05:56:35.000000000 +0100
+++ new/jupyter_client-6.1.3/docs/changelog.rst 2020-04-13 21:45:22.000000000 +0200
@@ -4,6 +4,33 @@
Changes in Jupyter Client
=========================
+6.1.3
+=====
+
+- Add AsyncKernelClient client_class to AsyncKernelManager (:ghpull:`542`)
+- Doc fix for xeus hyperlinks (:ghpull:`540`)
+- Doc typo fix (:ghpull:`539`)
+
+6.1.2
+=====
+- Fixed a bug causing clients to sometimes hang after a stop call was made (:ghpull:`536`)
+
+6.1.1
+=====
+
+- Subprocess kill action fix for async execution (:ghpull:`535`)
+- Doc fix for xeus kernel list (:ghpull:`534`)
+
+6.1.0
+=====
+
+This release includes support for asyncio patterns! Downstream tools should soon have releases to additionally support async patterns.
+
+- AsyncKernelManager and AsyncMultiKernelManager are now available for async jupyter_client interactions (:ghpull:`528`, :ghpull:`529`)
+- Removed unused sphinx dependency (:ghpull:`518`, :ghpull:`518`).
+- Added install instructions for pip to documentation (:ghpull:`521`)
+- Improved docs around version protocol and messaging (:ghpull:`522`, :ghpull:`526`)
+
6.0.0
=====
@@ -34,7 +61,6 @@
- Dropped support for Python 2.7!
-
5.3.4
=====
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/jupyter_client-6.0.0/docs/kernels.rst new/jupyter_client-6.1.3/docs/kernels.rst
--- old/jupyter_client-6.0.0/docs/kernels.rst 2020-02-24 05:08:37.000000000 +0100
+++ new/jupyter_client-6.1.3/docs/kernels.rst 2020-04-04 13:43:28.000000000 +0200
@@ -19,7 +19,7 @@
2. You can implement the kernel machinery in your target language. This is more
work initially, but the people using your kernel might be more likely to
contribute to it if it's in the language they know.
-3. You can use the `xeus <https://github.com/QuantStack/xeus>`_ library that is
+3. You can use the `xeus <https://github.com/jupyter-xeus/xeus>`_ library that is
a C++ implementation of the Jupyter kernel protocol. Kernel authors only need to
implement the language-specific logic in their implementation
(execute code, auto-completion...). This is the simplest
@@ -27,9 +27,10 @@
a C-API like most scripting languages. Check out the
`xeus documentation <https://xeus.readthedocs.io/>`_ for more details.
Examples of kernels based on xeus include:
- - `xeus-cling <https://github.com/QuantStack/xeus-cling>`_
- - `xeus-python <https://github.com/QuantStack/xeus-python>`_
- - `JuniperKernel <https://github.com/JuniperKernel/JuniperKernel>`_
+
+ - `xeus-cling <https://github.com/jupyter-xeus/xeus-cling>`_
+ - `xeus-python <https://github.com/jupyter-xeus/xeus-python>`_
+ - `JuniperKernel <https://github.com/JuniperKernel/JuniperKernel>`_
Connection files
================
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/jupyter_client-6.0.0/docs/messaging.rst new/jupyter_client-6.1.3/docs/messaging.rst
--- old/jupyter_client-6.0.0/docs/messaging.rst 2020-02-24 05:08:37.000000000 +0100
+++ new/jupyter_client-6.1.3/docs/messaging.rst 2020-04-04 13:43:28.000000000 +0200
@@ -86,41 +86,31 @@
General Message Format
======================
-A message is defined by the following four-dictionary structure::
+A message is composed of five dictionaries.
- {
- # The message header contains a pair of unique identifiers for the
- # originating session and the actual message id, in addition to the
- # username for the process that generated the message. This is useful in
- # collaborative settings where multiple users may be interacting with the
- # same kernel simultaneously, so that frontends can label the various
- # messages in a meaningful way.
- 'header' : {
- 'msg_id' : str, # typically UUID, must be unique per message
- 'username' : str,
- 'session' : str, # typically UUID, should be unique per session
- # ISO 8601 timestamp for when the message is created
- 'date': str,
- # All recognized message type strings are listed below.
- 'msg_type' : str,
- # the message protocol version
- 'version' : '5.0',
- },
-
- # In a chain of messages, the header from the parent is copied so that
- # clients can track where messages come from.
- 'parent_header' : dict,
+Message Header
+--------------
- # Any metadata associated with the message.
- 'metadata' : dict,
+The message `header` contains information about the message,
+such as unique identifiers for the originating session and the actual message id,
+the type of message, the version of the Jupyter protocol,
+and the date the message was created.
+In addition, there is a username field, e.g. for the process that generated the message, if applicable.
+This can be useful in collaborative settings where multiple users may be interacting with the same kernel simultaneously,
+so that frontends can label the various messages in a meaningful way.
- # The actual content of the message must be a dict, whose structure
- # depends on the message type.
- 'content' : dict,
+.. sourcecode:: python
- # optional: buffers is a list of binary data buffers for implementations
- # that support binary extensions to the protocol.
- 'buffers': list,
+ {
+ 'msg_id' : str, # typically UUID, must be unique per message
+ 'session' : str, # typically UUID, should be unique per session
+ 'username' : str,
+ # ISO 8601 timestamp for when the message is created
+ 'date': str,
+ # All recognized message type strings are listed below.
+ 'msg_type' : str,
+ # the message protocol version
+ 'version' : '5.0',
}
.. note::
@@ -153,6 +143,78 @@
so implementers are strongly encouraged to include it.
It will be mandatory in 5.1.
+Parent header
+-------------
+
+When a message is the "result" of another message,
+such as a side-effect (output or status) or direct reply,
+the ``parent_header`` is a copy of the ``header`` of the message
+that "caused" the current message.
+``_reply`` messages MUST have a ``parent_header``,
+and side-effects *typically* have a parent.
+If there is no parent, an empty dict should be used.
+This parent is used by clients to route message handling to the right place,
+such as outputs to a cell.
+
+.. sourcecode::
+
+ {
+ # parent_header is a copy of the request's header
+ 'msg_id': '...',
+ ...
+ }
+
+Metadata
+--------
+
+The `metadata` dict contains information about the message that is not part of the content.
+This is not often used, but can be an extra location to store information about requests and replies,
+such as extensions adding information about request or execution context.
+
+Content
+-------
+
+The ``content`` dict is the body of the message.
+Its structure is dictated by the ``msg_type`` field in the header,
+described in detail for each message below.
+
+Buffers
+-------
+
+Finally, a list of additional binary buffers can be associated with a message.
+While this is part of the protocol,
+no official messages make use of these buffers.
+They are used by extension messages, such as IPython Parallel's ``apply``
+and some of ipywidgets' ``comm`` messages.
+
+A full message
+--------------
+
+Combining all of these together,
+a complete message can be represented as the following dictionary of dictionaries (and one list)::
+
+ {
+ "header" : {
+ "msg_id": "...",
+ "msg_type": "...",
+ ...
+ },
+ "parent_header": {},
+ "metadata": {},
+ "content": {},
+ "buffers": [],
+ }
+
+
+.. note::
+
+ This dictionary structure is *not* part of the Jupyter protocol
+ that must be implemented by kernels and frontends;
+ that would be :ref:`wire_protocol`,
+ which dictates how this information is serialized over the wire.
+ Deserialization is up to the Kernel or frontend implementation,
+ but a dict like this would be a logical choice in most contexts.
+
.. _msging_compatibility:
Compatibility
@@ -182,14 +244,17 @@
=================
-This message format exists at a high level,
+The above message format is only a logical representation of the contents of Jupyter messages,
but does not describe the actual *implementation* at the wire level in zeromq.
-The canonical implementation of the message spec is our :class:`~jupyter_client.session.Session` class.
+This section describes the protocol that must be implemented by Jupyter kernels and clients
+talking to each other over zeromq.
+
+The reference implementation of the message spec is our :class:`~jupyter_client.session.Session` class.
.. note::
This section should only be relevant to non-Python consumers of the protocol.
- Python consumers should simply import and the use implementation of the wire
+ Python consumers should import and the use implementation of the wire
protocol in :class:`jupyter_client.session.Session`.
Every message is serialized to a sequence of at least six blobs of bytes:
@@ -268,7 +333,7 @@
Python API
==========
-As messages are dicts, they map naturally to a ``func(**kw)`` call form. We
+As messages can be represented as dicts, they map naturally to a ``func(**kw)`` call form. We
should develop, at a few key points, functional forms of all the requests that
take arguments in this manner and automatically construct the necessary dict
for sending.
@@ -285,9 +350,10 @@
'parent_header' : dict,
'content' : dict,
'metadata' : dict,
+ 'buffers': list,
}
-All messages sent to or received by any IPython process should have this
+All messages sent to or received by any IPython message handler should have this
extended structure.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/jupyter_client-6.0.0/docs/requirements.txt new/jupyter_client-6.1.3/docs/requirements.txt
--- old/jupyter_client-6.0.0/docs/requirements.txt 1970-01-01 01:00:00.000000000 +0100
+++ new/jupyter_client-6.1.3/docs/requirements.txt 2020-03-08 22:40:02.000000000 +0100
@@ -0,0 +1,3 @@
+sphinx>=1.3.6
+sphinx_rtd_theme
+sphinxcontrib_github_alt
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/jupyter_client-6.0.0/jupyter_client/__init__.py new/jupyter_client-6.1.3/jupyter_client/__init__.py
--- old/jupyter_client-6.0.0/jupyter_client/__init__.py 2020-02-24 05:08:37.000000000 +0100
+++ new/jupyter_client-6.1.3/jupyter_client/__init__.py 2020-03-08 22:40:12.000000000 +0100
@@ -4,7 +4,7 @@
from .connect import *
from .launcher import *
from .client import KernelClient
-from .manager import KernelManager, run_kernel
+from .manager import KernelManager, AsyncKernelManager, run_kernel
from .blocking import BlockingKernelClient
from .asynchronous import AsyncKernelClient
-from .multikernelmanager import MultiKernelManager
+from .multikernelmanager import MultiKernelManager, AsyncMultiKernelManager
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/jupyter_client-6.0.0/jupyter_client/_version.py new/jupyter_client-6.1.3/jupyter_client/_version.py
--- old/jupyter_client-6.0.0/jupyter_client/_version.py 2020-02-24 05:57:04.000000000 +0100
+++ new/jupyter_client-6.1.3/jupyter_client/_version.py 2020-04-13 21:34:21.000000000 +0200
@@ -1,4 +1,4 @@
-version_info = (6, 0, 0)
+version_info = (6, 1, 3)
__version__ = '.'.join(map(str, version_info))
protocol_version_info = (5, 3)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/jupyter_client-6.0.0/jupyter_client/asynchronous/client.py new/jupyter_client-6.1.3/jupyter_client/asynchronous/client.py
--- old/jupyter_client-6.0.0/jupyter_client/asynchronous/client.py 2020-02-24 05:08:37.000000000 +0100
+++ new/jupyter_client-6.1.3/jupyter_client/asynchronous/client.py 2020-03-08 22:40:12.000000000 +0100
@@ -135,7 +135,7 @@
self._handle_kernel_info_reply(msg)
break
- if not self.is_alive():
+ if not await self.is_alive():
raise RuntimeError('Kernel died before replying to kernel_info')
# Check if current time is ready check time plus timeout
@@ -234,6 +234,24 @@
else:
self._output_hook_default(msg)
+ async def is_alive(self):
+ """Is the kernel process still running?"""
+ from ..manager import KernelManager, AsyncKernelManager
+ if isinstance(self.parent, KernelManager):
+ # This KernelClient was created by a KernelManager,
+ # we can ask the parent KernelManager:
+ if isinstance(self.parent, AsyncKernelManager):
+ return await self.parent.is_alive()
+ return self.parent.is_alive()
+ if self._hb_channel is not None:
+ # We don't have access to the KernelManager,
+ # so we use the heartbeat.
+ return self._hb_channel.is_beating()
+ else:
+ # no heartbeat and not local, we can't tell if it's running,
+ # so naively return True
+ return True
+
async def execute_interactive(self, code, silent=False, store_history=True,
user_expressions=None, allow_stdin=None, stop_on_error=True,
timeout=None, output_hook=None, stdin_hook=None,
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/jupyter_client-6.0.0/jupyter_client/ioloop/__init__.py new/jupyter_client-6.1.3/jupyter_client/ioloop/__init__.py
--- old/jupyter_client-6.0.0/jupyter_client/ioloop/__init__.py 2019-05-06 18:08:46.000000000 +0200
+++ new/jupyter_client-6.1.3/jupyter_client/ioloop/__init__.py 2020-03-08 22:40:12.000000000 +0100
@@ -1,2 +1,2 @@
-from .manager import IOLoopKernelManager
-from .restarter import IOLoopKernelRestarter
+from .manager import IOLoopKernelManager, AsyncIOLoopKernelManager
+from .restarter import IOLoopKernelRestarter, AsyncIOLoopKernelRestarter
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/jupyter_client-6.0.0/jupyter_client/ioloop/manager.py new/jupyter_client-6.1.3/jupyter_client/ioloop/manager.py
--- old/jupyter_client-6.0.0/jupyter_client/ioloop/manager.py 2020-02-24 05:19:49.000000000 +0100
+++ new/jupyter_client-6.1.3/jupyter_client/ioloop/manager.py 2020-03-28 20:39:42.000000000 +0100
@@ -11,8 +11,8 @@
Type,
)
-from jupyter_client.manager import KernelManager
-from .restarter import IOLoopKernelRestarter
+from jupyter_client.manager import KernelManager, AsyncKernelManager
+from .restarter import IOLoopKernelRestarter, AsyncIOLoopKernelRestarter
def as_zmqstream(f):
@@ -21,9 +21,11 @@
return ZMQStream(socket, self.loop)
return wrapped
+
class IOLoopKernelManager(KernelManager):
loop = Instance('tornado.ioloop.IOLoop')
+
def _loop_default(self):
return ioloop.IOLoop.current()
@@ -52,10 +54,49 @@
if self.autorestart:
if self._restarter is not None:
self._restarter.stop()
- self._restarter = None
connect_shell = as_zmqstream(KernelManager.connect_shell)
connect_control = as_zmqstream(KernelManager.connect_control)
connect_iopub = as_zmqstream(KernelManager.connect_iopub)
connect_stdin = as_zmqstream(KernelManager.connect_stdin)
connect_hb = as_zmqstream(KernelManager.connect_hb)
+
+
+class AsyncIOLoopKernelManager(AsyncKernelManager):
+
+ loop = Instance('tornado.ioloop.IOLoop')
+
+ def _loop_default(self):
+ return ioloop.IOLoop.current()
+
+ restarter_class = Type(
+ default_value=AsyncIOLoopKernelRestarter,
+ klass=AsyncIOLoopKernelRestarter,
+ help=(
+ 'Type of KernelRestarter to use. '
+ 'Must be a subclass of AsyncIOLoopKernelManager.\n'
+ 'Override this to customize how kernel restarts are managed.'
+ ),
+ config=True,
+ )
+ _restarter = Instance('jupyter_client.ioloop.AsyncIOLoopKernelRestarter', allow_none=True)
+
+ def start_restarter(self):
+ if self.autorestart and self.has_kernel:
+ if self._restarter is None:
+ self._restarter = self.restarter_class(
+ kernel_manager=self, loop=self.loop,
+ parent=self, log=self.log
+ )
+ self._restarter.start()
+
+ def stop_restarter(self):
+ if self.autorestart:
+ if self._restarter is not None:
+ self._restarter.stop()
+
+ connect_shell = as_zmqstream(AsyncKernelManager.connect_shell)
+ connect_control = as_zmqstream(AsyncKernelManager.connect_control)
+ connect_iopub = as_zmqstream(AsyncKernelManager.connect_iopub)
+ connect_stdin = as_zmqstream(AsyncKernelManager.connect_stdin)
+ connect_hb = as_zmqstream(AsyncKernelManager.connect_hb)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/jupyter_client-6.0.0/jupyter_client/ioloop/restarter.py new/jupyter_client-6.1.3/jupyter_client/ioloop/restarter.py
--- old/jupyter_client-6.0.0/jupyter_client/ioloop/restarter.py 2020-02-24 05:19:55.000000000 +0100
+++ new/jupyter_client-6.1.3/jupyter_client/ioloop/restarter.py 2020-03-08 22:40:12.000000000 +0100
@@ -16,10 +16,12 @@
Instance,
)
+
class IOLoopKernelRestarter(KernelRestarter):
"""Monitor and autorestart a kernel."""
loop = Instance('tornado.ioloop.IOLoop')
+
def _loop_default(self):
warnings.warn("IOLoopKernelRestarter.loop is deprecated in jupyter-client 5.2",
DeprecationWarning, stacklevel=4,
@@ -41,3 +43,39 @@
if self._pcallback is not None:
self._pcallback.stop()
self._pcallback = None
+
+
+class AsyncIOLoopKernelRestarter(IOLoopKernelRestarter):
+
+ async def poll(self):
+ if self.debug:
+ self.log.debug('Polling kernel...')
+ is_alive = await self.kernel_manager.is_alive()
+ if not is_alive:
+ if self._restarting:
+ self._restart_count += 1
+ else:
+ self._restart_count = 1
+
+ if self._restart_count >= self.restart_limit:
+ self.log.warning("AsyncIOLoopKernelRestarter: restart failed")
+ self._fire_callbacks('dead')
+ self._restarting = False
+ self._restart_count = 0
+ self.stop()
+ else:
+ newports = self.random_ports_until_alive and self._initial_startup
+ self.log.info('AsyncIOLoopKernelRestarter: restarting kernel (%i/%i), %s random ports',
+ self._restart_count,
+ self.restart_limit,
+ 'new' if newports else 'keep'
+ )
+ self._fire_callbacks('restart')
+ await self.kernel_manager.restart_kernel(now=True, newports=newports)
+ self._restarting = True
+ else:
+ if self._initial_startup:
+ self._initial_startup = False
+ if self._restarting:
+ self.log.debug("AsyncIOLoopKernelRestarter: restart apparently succeeded")
+ self._restarting = False
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/jupyter_client-6.0.0/jupyter_client/manager.py new/jupyter_client-6.1.3/jupyter_client/manager.py
--- old/jupyter_client-6.0.0/jupyter_client/manager.py 2020-02-24 05:18:49.000000000 +0100
+++ new/jupyter_client-6.1.3/jupyter_client/manager.py 2020-04-13 21:27:04.000000000 +0200
@@ -4,6 +4,7 @@
# Distributed under the terms of the Modified BSD License.
from contextlib import contextmanager
+import asyncio
import os
import re
import signal
@@ -79,7 +80,7 @@
@property
def kernel_spec(self):
- if self._kernel_spec is None and self.kernel_name is not '':
+ if self._kernel_spec is None and self.kernel_name != '':
self._kernel_spec = self.kernel_spec_manager.get_kernel_spec(self.kernel_name)
return self._kernel_spec
@@ -223,8 +224,8 @@
self._control_socket.close()
self._control_socket = None
- def start_kernel(self, **kw):
- """Starts a kernel on this host in a separate process.
+ def pre_start_kernel(self, **kw):
+ """Prepares a kernel for startup in a separate process.
If random ports (port=0) are being used, this method must be called
before the channels are created.
@@ -261,12 +262,9 @@
env.update(self._get_env_substitutions(self.kernel_spec.env, env))
elif self.extra_env:
env.update(self._get_env_substitutions(self.extra_env, env))
+ kw['env'] = env
- # launch the kernel subprocess
- self.log.debug("Starting kernel: %s", kernel_cmd)
- self.kernel = self._launch_kernel(kernel_cmd, env=env, **kw)
- self.start_restarter()
- self._connect_control_socket()
+ return kernel_cmd, kw
def _get_env_substitutions(self, templated_env, substitution_values):
""" Walks env entries in templated_env and applies possible substitutions from current env
@@ -284,6 +282,29 @@
substituted_env.update({k: Template(v).safe_substitute(substitution_values)})
return substituted_env
+ def post_start_kernel(self, **kw):
+ self.start_restarter()
+ self._connect_control_socket()
+
+ def start_kernel(self, **kw):
+ """Starts a kernel on this host in a separate process.
+
+ If random ports (port=0) are being used, this method must be called
+ before the channels are created.
+
+ Parameters
+ ----------
+ `**kw` : optional
+ keyword arguments that are passed down to build the kernel_cmd
+ and launching the kernel (e.g. Popen kwargs).
+ """
+ kernel_cmd, kw = self.pre_start_kernel(**kw)
+
+ # launch the kernel subprocess
+ self.log.debug("Starting kernel: %s", kernel_cmd)
+ self.kernel = self._launch_kernel(kernel_cmd, **kw)
+ self.post_start_kernel(**kw)
+
def request_shutdown(self, restart=False):
"""Send a shutdown request via control channel
"""
@@ -488,6 +509,233 @@
return False
+class AsyncKernelManager(KernelManager):
+ """Manages kernels in an asynchronous manner """
+
+ client_class = DottedObjectName('jupyter_client.asynchronous.AsyncKernelClient')
+ client_factory = Type(klass='jupyter_client.asynchronous.AsyncKernelClient')
+
+ async def _launch_kernel(self, kernel_cmd, **kw):
+ """actually launch the kernel
+
+ override in a subclass to launch kernel subprocesses differently
+ """
+ res = launch_kernel(kernel_cmd, **kw)
+ return res
+
+ async def start_kernel(self, **kw):
+ """Starts a kernel in a separate process in an asynchronous manner.
+
+ If random ports (port=0) are being used, this method must be called
+ before the channels are created.
+
+ Parameters
+ ----------
+ `**kw` : optional
+ keyword arguments that are passed down to build the kernel_cmd
+ and launching the kernel (e.g. Popen kwargs).
+ """
+ kernel_cmd, kw = self.pre_start_kernel(**kw)
+
+ # launch the kernel subprocess
+ self.log.debug("Starting kernel (async): %s", kernel_cmd)
+ self.kernel = await self._launch_kernel(kernel_cmd, **kw)
+ self.post_start_kernel(**kw)
+
+ async def finish_shutdown(self, waittime=None, pollinterval=0.1):
+ """Wait for kernel shutdown, then kill process if it doesn't shutdown.
+
+ This does not send shutdown requests - use :meth:`request_shutdown`
+ first.
+ """
+ if waittime is None:
+ waittime = max(self.shutdown_wait_time, 0)
+ try:
+ await asyncio.wait_for(self._async_wait(pollinterval=pollinterval), timeout=waittime)
+ except asyncio.TimeoutError:
+ self.log.debug("Kernel is taking too long to finish, killing")
+ await self._kill_kernel()
+ else:
+ # Process is no longer alive, wait and clear
+ if self.kernel is not None:
+ self.kernel.wait()
+ self.kernel = None
+
+ async def shutdown_kernel(self, now=False, restart=False):
+ """Attempts to stop the kernel process cleanly.
+
+ This attempts to shutdown the kernels cleanly by:
+
+ 1. Sending it a shutdown message over the shell channel.
+ 2. If that fails, the kernel is shutdown forcibly by sending it
+ a signal.
+
+ Parameters
+ ----------
+ now : bool
+ Should the kernel be forcible killed *now*. This skips the
+ first, nice shutdown attempt.
+ restart: bool
+ Will this kernel be restarted after it is shutdown. When this
+ is True, connection files will not be cleaned up.
+ """
+ # Stop monitoring for restarting while we shutdown.
+ self.stop_restarter()
+
+ if now:
+ await self._kill_kernel()
+ else:
+ self.request_shutdown(restart=restart)
+ # Don't send any additional kernel kill messages immediately, to give
+ # the kernel a chance to properly execute shutdown actions. Wait for at
+ # most 1s, checking every 0.1s.
+ await self.finish_shutdown()
+
+ self.cleanup(connection_file=not restart)
+
+ async def restart_kernel(self, now=False, newports=False, **kw):
+ """Restarts a kernel with the arguments that were used to launch it.
+
+ Parameters
+ ----------
+ now : bool, optional
+ If True, the kernel is forcefully restarted *immediately*, without
+ having a chance to do any cleanup action. Otherwise the kernel is
+ given 1s to clean up before a forceful restart is issued.
+
+ In all cases the kernel is restarted, the only difference is whether
+ it is given a chance to perform a clean shutdown or not.
+
+ newports : bool, optional
+ If the old kernel was launched with random ports, this flag decides
+ whether the same ports and connection file will be used again.
+ If False, the same ports and connection file are used. This is
+ the default. If True, new random port numbers are chosen and a
+ new connection file is written. It is still possible that the newly
+ chosen random port numbers happen to be the same as the old ones.
+
+ `**kw` : optional
+ Any options specified here will overwrite those used to launch the
+ kernel.
+ """
+ if self._launch_args is None:
+ raise RuntimeError("Cannot restart the kernel. "
+ "No previous call to 'start_kernel'.")
+ else:
+ # Stop currently running kernel.
+ await self.shutdown_kernel(now=now, restart=True)
+
+ if newports:
+ self.cleanup_random_ports()
+
+ # Start new kernel.
+ self._launch_args.update(kw)
+ await self.start_kernel(**self._launch_args)
+ return None
+
+ async def _kill_kernel(self):
+ """Kill the running kernel.
+
+ This is a private method, callers should use shutdown_kernel(now=True).
+ """
+ if self.has_kernel:
+ # Signal the kernel to terminate (sends SIGKILL on Unix and calls
+ # TerminateProcess() on Win32).
+ try:
+ if hasattr(signal, 'SIGKILL'):
+ await self.signal_kernel(signal.SIGKILL)
+ else:
+ self.kernel.kill()
+ except OSError as e:
+ # In Windows, we will get an Access Denied error if the process
+ # has already terminated. Ignore it.
+ if sys.platform == 'win32':
+ if e.winerror != 5:
+ raise
+ # On Unix, we may get an ESRCH error if the process has already
+ # terminated. Ignore it.
+ else:
+ from errno import ESRCH
+ if e.errno != ESRCH:
+ raise
+
+ # Wait until the kernel terminates.
+ try:
+ await asyncio.wait_for(self._async_wait(), timeout=5.0)
+ except asyncio.TimeoutError:
+ # Wait timed out, just log warning but continue - not much more we can do.
+ self.log.warning("Wait for final termination of kernel timed out - continuing...")
+ pass
+ else:
+ # Process is no longer alive, wait and clear
+ if self.kernel is not None:
+ self.kernel.wait()
+ self.kernel = None
+ else:
+ raise RuntimeError("Cannot kill kernel. No kernel is running!")
+
+ async def interrupt_kernel(self):
+ """Interrupts the kernel by sending it a signal.
+
+ Unlike ``signal_kernel``, this operation is well supported on all
+ platforms.
+ """
+ if self.has_kernel:
+ interrupt_mode = self.kernel_spec.interrupt_mode
+ if interrupt_mode == 'signal':
+ if sys.platform == 'win32':
+ from .win_interrupt import send_interrupt
+ send_interrupt(self.kernel.win32_interrupt_event)
+ else:
+ await self.signal_kernel(signal.SIGINT)
+
+ elif interrupt_mode == 'message':
+ msg = self.session.msg("interrupt_request", content={})
+ self._connect_control_socket()
+ self.session.send(self._control_socket, msg)
+ else:
+ raise RuntimeError("Cannot interrupt kernel. No kernel is running!")
+
+ async def signal_kernel(self, signum):
+ """Sends a signal to the process group of the kernel (this
+ usually includes the kernel and any subprocesses spawned by
+ the kernel).
+
+ Note that since only SIGTERM is supported on Windows, this function is
+ only useful on Unix systems.
+ """
+ if self.has_kernel:
+ if hasattr(os, "getpgid") and hasattr(os, "killpg"):
+ try:
+ pgid = os.getpgid(self.kernel.pid)
+ os.killpg(pgid, signum)
+ return
+ except OSError:
+ pass
+ self.kernel.send_signal(signum)
+ else:
+ raise RuntimeError("Cannot signal kernel. No kernel is running!")
+
+ async def is_alive(self):
+ """Is the kernel process still running?"""
+ if self.has_kernel:
+ if self.kernel.poll() is None:
+ return True
+ else:
+ return False
+ else:
+ # we don't have a kernel
+ return False
+
+ async def _async_wait(self, pollinterval=0.1):
+ # Use busy loop at 100ms intervals, polling until the process is
+ # not alive. If we find the process is no longer alive, complete
+ # its cleanup via the blocking wait(). Callers are responsible for
+ # issuing calls to wait() using a timeout (see _kill_kernel()).
+ while await self.is_alive():
+ await asyncio.sleep(pollinterval)
+
+
KernelManagerABC.register(KernelManager)
@@ -506,6 +754,23 @@
return km, kc
+
+async def start_new_async_kernel(startup_timeout=60, kernel_name='python', **kwargs):
+ """Start a new kernel, and return its Manager and Client"""
+ km = AsyncKernelManager(kernel_name=kernel_name)
+ await km.start_kernel(**kwargs)
+ kc = km.client()
+ kc.start_channels()
+ try:
+ await kc.wait_for_ready(timeout=startup_timeout)
+ except RuntimeError:
+ kc.stop_channels()
+ await km.shutdown_kernel()
+ raise
+
+ return (km, kc)
+
+
@contextmanager
def run_kernel(**kwargs):
"""Context manager to create a kernel in a subprocess.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/jupyter_client-6.0.0/jupyter_client/multikernelmanager.py new/jupyter_client-6.1.3/jupyter_client/multikernelmanager.py
--- old/jupyter_client-6.0.0/jupyter_client/multikernelmanager.py 2020-02-24 05:19:28.000000000 +0100
+++ new/jupyter_client-6.1.3/jupyter_client/multikernelmanager.py 2020-04-09 11:52:52.000000000 +0200
@@ -17,6 +17,8 @@
from ipython_genutils.py3compat import unicode_type
from .kernelspec import NATIVE_KERNEL_NAME, KernelSpecManager
+from .manager import AsyncKernelManager
+
class DuplicateKernelError(Exception):
pass
@@ -123,14 +125,8 @@
def __contains__(self, kernel_id):
return kernel_id in self._kernels
- def start_kernel(self, kernel_name=None, **kwargs):
- """Start a new kernel.
+ def pre_start_kernel(self, kernel_name, **kwargs):
- The caller can pick a kernel_id by passing one in as a keyword arg,
- otherwise one will be generated using new_kernel_id().
-
- The kernel ID for the newly started kernel is returned.
- """
kernel_id = kwargs.pop('kernel_id', self.new_kernel_id(**kwargs))
if kernel_id in self:
raise DuplicateKernelError('Kernel already exists: %s' % kernel_id)
@@ -148,6 +144,17 @@
parent=self, log=self.log, kernel_name=kernel_name,
**constructor_kwargs
)
+ return km, kernel_name, kernel_id
+
+ def start_kernel(self, kernel_name=None, **kwargs):
+ """Start a new kernel.
+
+ The caller can pick a kernel_id by passing one in as a keyword arg,
+ otherwise one will be generated using new_kernel_id().
+
+ The kernel ID for the newly started kernel is returned.
+ """
+ km, kernel_name, kernel_id = self.pre_start_kernel(kernel_name, **kwargs)
km.start_kernel(**kwargs)
self._kernels[kernel_id] = km
return kernel_id
@@ -393,3 +400,113 @@
:return: string-ized version 4 uuid
"""
return unicode_type(uuid.uuid4())
+
+
+class AsyncMultiKernelManager(MultiKernelManager):
+
+ kernel_manager_class = DottedObjectName(
+ "jupyter_client.ioloop.AsyncIOLoopKernelManager", config=True,
+ help="""The kernel manager class. This is configurable to allow
+ subclassing of the AsyncKernelManager for customized behavior.
+ """
+ )
+
+ async def start_kernel(self, kernel_name=None, **kwargs):
+ """Start a new kernel.
+
+ The caller can pick a kernel_id by passing one in as a keyword arg,
+ otherwise one will be generated using new_kernel_id().
+
+ The kernel ID for the newly started kernel is returned.
+ """
+ km, kernel_name, kernel_id = self.pre_start_kernel(kernel_name, **kwargs)
+ if not isinstance(km, AsyncKernelManager):
+ self.log.warning("Kernel manager class ({km_class}) is not an instance of 'AsyncKernelManager'!".
+ format(km_class=self.kernel_manager_class.__class__))
+ await km.start_kernel(**kwargs)
+ self._kernels[kernel_id] = km
+ return kernel_id
+
+ async def shutdown_kernel(self, kernel_id, now=False, restart=False):
+ """Shutdown a kernel by its kernel uuid.
+
+ Parameters
+ ==========
+ kernel_id : uuid
+ The id of the kernel to shutdown.
+ now : bool
+ Should the kernel be shutdown forcibly using a signal.
+ restart : bool
+ Will the kernel be restarted?
+ """
+ self.log.info("Kernel shutdown: %s" % kernel_id)
+
+ km = self.get_kernel(kernel_id)
+
+ ports = (
+ km.shell_port, km.iopub_port, km.stdin_port,
+ km.hb_port, km.control_port
+ )
+
+ await km.shutdown_kernel(now, restart)
+ self.remove_kernel(kernel_id)
+
+ if km.cache_ports and not restart:
+ for port in ports:
+ self.currently_used_ports.remove(port)
+
+ async def finish_shutdown(self, kernel_id, waittime=None, pollinterval=0.1):
+ """Wait for a kernel to finish shutting down, and kill it if it doesn't
+ """
+ km = self.get_kernel(kernel_id)
+ await km.finish_shutdown(waittime, pollinterval)
+ self.log.info("Kernel shutdown: %s" % kernel_id)
+
+ async def interrupt_kernel(self, kernel_id):
+ """Interrupt (SIGINT) the kernel by its uuid.
+
+ Parameters
+ ==========
+ kernel_id : uuid
+ The id of the kernel to interrupt.
+ """
+ km = self.get_kernel(kernel_id)
+ await km.interrupt_kernel()
+ self.log.info("Kernel interrupted: %s" % kernel_id)
+
+ async def signal_kernel(self, kernel_id, signum):
+ """Sends a signal to the kernel by its uuid.
+
+ Note that since only SIGTERM is supported on Windows, this function
+ is only useful on Unix systems.
+
+ Parameters
+ ==========
+ kernel_id : uuid
+ The id of the kernel to signal.
+ """
+ km = self.get_kernel(kernel_id)
+ await km.signal_kernel(signum)
+ self.log.info("Signaled Kernel %s with %s" % (kernel_id, signum))
+
+ async def restart_kernel(self, kernel_id, now=False):
+ """Restart a kernel by its uuid, keeping the same ports.
+
+ Parameters
+ ==========
+ kernel_id : uuid
+ The id of the kernel to interrupt.
+ """
+ km = self.get_kernel(kernel_id)
+ await km.restart_kernel(now)
+ self.log.info("Kernel restarted: %s" % kernel_id)
+
+ async def shutdown_all(self, now=False):
+ """Shutdown all kernels."""
+ kids = self.list_kernel_ids()
+ for kid in kids:
+ self.request_shutdown(kid)
+ for kid in kids:
+ await self.finish_shutdown(kid)
+ self.cleanup(kid)
+ self.remove_kernel(kid)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/jupyter_client-6.0.0/jupyter_client/tests/test_kernelapp.py new/jupyter_client-6.1.3/jupyter_client/tests/test_kernelapp.py
--- old/jupyter_client-6.0.0/jupyter_client/tests/test_kernelapp.py 2020-02-24 05:29:36.000000000 +0100
+++ new/jupyter_client-6.1.3/jupyter_client/tests/test_kernelapp.py 2020-03-01 15:06:16.000000000 +0100
@@ -1,5 +1,4 @@
import os
-import sphinx.util
import sys
import shutil
import time
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/jupyter_client-6.0.0/jupyter_client/tests/test_kernelmanager.py new/jupyter_client-6.1.3/jupyter_client/tests/test_kernelmanager.py
--- old/jupyter_client-6.0.0/jupyter_client/tests/test_kernelmanager.py 2020-02-24 05:08:37.000000000 +0100
+++ new/jupyter_client-6.1.3/jupyter_client/tests/test_kernelmanager.py 2020-03-08 22:40:12.000000000 +0100
@@ -4,6 +4,7 @@
# Distributed under the terms of the Modified BSD License.
+import asyncio
import json
import os
pjoin = os.path.join
@@ -15,15 +16,17 @@
import multiprocessing as mp
import pytest
from unittest import TestCase
+from tornado.testing import AsyncTestCase, gen_test, gen
from traitlets.config.loader import Config
from jupyter_core import paths
-from jupyter_client import KernelManager
-from ..manager import start_new_kernel
+from jupyter_client import KernelManager, AsyncKernelManager
+from ..manager import start_new_kernel, start_new_async_kernel
from .utils import test_env, skip_win32
TIMEOUT = 30
+
class TestKernelManager(TestCase):
def setUp(self):
self.env_patch = test_env()
@@ -89,6 +92,7 @@
def test_signal_kernel_subprocesses(self):
self._install_test_kernel()
km, kc = start_new_kernel(kernel_name='signaltest')
+
def execute(cmd):
kc.execute(cmd)
reply = kc.get_shell_msg(TIMEOUT)
@@ -143,7 +147,7 @@
reply = execute('env')
self.assertIsNotNone(reply)
- self.assertEquals(reply['user_expressions']['env'], 'test_var_1:test_var_2')
+ self.assertEqual(reply['user_expressions']['env'], 'test_var_1:test_var_2')
def test_templated_kspec_env(self):
self._install_test_kernel()
@@ -268,7 +272,7 @@
proc.join()
assert proc.exitcode == 0
-
+
def _prepare_kernel(self, km, startup_timeout=TIMEOUT, **kwargs):
km.start_kernel(**kwargs)
kc = km.client()
@@ -303,3 +307,127 @@
execute('check')
km.shutdown_kernel()
+
+
+class TestAsyncKernelManager(AsyncTestCase):
+ def setUp(self):
+ super(TestAsyncKernelManager, self).setUp()
+ self.env_patch = test_env()
+ self.env_patch.start()
+
+ def tearDown(self):
+ super(TestAsyncKernelManager, self).tearDown()
+ self.env_patch.stop()
+
+ def _install_test_kernel(self):
+ kernel_dir = pjoin(paths.jupyter_data_dir(), 'kernels', 'signaltest')
+ os.makedirs(kernel_dir)
+ with open(pjoin(kernel_dir, 'kernel.json'), 'w') as f:
+ f.write(json.dumps({
+ 'argv': [sys.executable,
+ '-m', 'jupyter_client.tests.signalkernel',
+ '-f', '{connection_file}'],
+ 'display_name': "Signal Test Kernel",
+ }))
+
+ def _get_tcp_km(self):
+ c = Config()
+ km = AsyncKernelManager(config=c)
+ return km
+
+ def _get_ipc_km(self):
+ c = Config()
+ c.KernelManager.transport = 'ipc'
+ c.KernelManager.ip = 'test'
+ km = AsyncKernelManager(config=c)
+ return km
+
+ async def _run_lifecycle(self, km):
+ await km.start_kernel(stdout=PIPE, stderr=PIPE)
+ self.assertTrue(await km.is_alive())
+ await km.restart_kernel(now=True)
+ self.assertTrue(await km.is_alive())
+ await km.interrupt_kernel()
+ self.assertTrue(isinstance(km, AsyncKernelManager))
+ await km.shutdown_kernel(now=True)
+ self.assertFalse(await km.is_alive())
+
+ @gen_test
+ async def test_tcp_lifecycle(self):
+ km = self._get_tcp_km()
+ await self._run_lifecycle(km)
+
+ @skip_win32
+ @gen_test
+ async def test_ipc_lifecycle(self):
+ km = self._get_ipc_km()
+ await self._run_lifecycle(km)
+
+ def test_get_connect_info(self):
+ km = self._get_tcp_km()
+ cinfo = km.get_connection_info()
+ keys = sorted(cinfo.keys())
+ expected = sorted([
+ 'ip', 'transport',
+ 'hb_port', 'shell_port', 'stdin_port', 'iopub_port', 'control_port',
+ 'key', 'signature_scheme',
+ ])
+ self.assertEqual(keys, expected)
+
+ @skip_win32
+ @gen_test(timeout=10.0)
+ async def test_signal_kernel_subprocesses(self):
+ self._install_test_kernel()
+ km, kc = await start_new_async_kernel(kernel_name='signaltest')
+
+ async def execute(cmd):
+ kc.execute(cmd)
+ reply = await kc.get_shell_msg(TIMEOUT)
+ content = reply['content']
+ self.assertEqual(content['status'], 'ok')
+ return content
+ # Ensure that shutdown_kernel and stop_channels are called at the end of the test.
+ # Note: we cannot use addCleanup(<func>) for these since it doesn't prpperly handle
+ # coroutines - which km.shutdown_kernel now is.
+ try:
+ N = 5
+ for i in range(N):
+ await execute("start")
+ await asyncio.sleep(1) # make sure subprocs stay up
+ reply = await execute('check')
+ self.assertEqual(reply['user_expressions']['poll'], [None] * N)
+
+ # start a job on the kernel to be interrupted
+ kc.execute('sleep')
+ await asyncio.sleep(1) # ensure sleep message has been handled before we interrupt
+ await km.interrupt_kernel()
+ reply = await kc.get_shell_msg(TIMEOUT)
+ content = reply['content']
+ self.assertEqual(content['status'], 'ok')
+ self.assertEqual(content['user_expressions']['interrupted'], True)
+ # wait up to 5s for subprocesses to handle signal
+ for i in range(50):
+ reply = await execute('check')
+ if reply['user_expressions']['poll'] != [-signal.SIGINT] * N:
+ await asyncio.sleep(0.1)
+ else:
+ break
+ # verify that subprocesses were interrupted
+ self.assertEqual(reply['user_expressions']['poll'], [-signal.SIGINT] * N)
+ finally:
+ await km.shutdown_kernel(now=True)
+ kc.stop_channels()
+
+ @gen_test(timeout=10.0)
+ async def test_start_new_async_kernel(self):
+ self._install_test_kernel()
+ km, kc = await start_new_async_kernel(kernel_name='signaltest')
+ # Ensure that shutdown_kernel and stop_channels are called at the end of the test.
+ # Note: we cannot use addCleanup(<func>) for these since it doesn't properly handle
+ # coroutines - which km.shutdown_kernel now is.
+ try:
+ self.assertTrue(await km.is_alive())
+ self.assertTrue(await kc.is_alive())
+ finally:
+ await km.shutdown_kernel(now=True)
+ kc.stop_channels()
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/jupyter_client-6.0.0/jupyter_client/tests/test_multikernelmanager.py new/jupyter_client-6.1.3/jupyter_client/tests/test_multikernelmanager.py
--- old/jupyter_client-6.0.0/jupyter_client/tests/test_multikernelmanager.py 2019-07-07 23:36:06.000000000 +0200
+++ new/jupyter_client-6.1.3/jupyter_client/tests/test_multikernelmanager.py 2020-03-08 22:40:12.000000000 +0100
@@ -1,16 +1,16 @@
"""Tests for the notebook kernel and session manager."""
-import os
-import time
+import asyncio
import threading
import multiprocessing as mp
from subprocess import PIPE
from unittest import TestCase
-from traitlets.config.loader import Config
-from jupyter_client import KernelManager
-from jupyter_client.multikernelmanager import MultiKernelManager
+from tornado.testing import AsyncTestCase, gen_test
+from traitlets.config.loader import Config
+from jupyter_client import KernelManager, AsyncKernelManager
+from jupyter_client.multikernelmanager import MultiKernelManager, AsyncMultiKernelManager
from .utils import skip_win32
from ..localinterfaces import localhost
@@ -36,7 +36,7 @@
self.assertTrue(km.is_alive(kid))
self.assertTrue(kid in km)
self.assertTrue(kid in km.list_kernel_ids())
- self.assertEqual(len(km),1)
+ self.assertEqual(len(km), 1)
km.restart_kernel(kid, now=True)
self.assertTrue(km.is_alive(kid))
self.assertTrue(kid in km.list_kernel_ids())
@@ -44,7 +44,7 @@
k = km.get_kernel(kid)
self.assertTrue(isinstance(k, KernelManager))
km.shutdown_kernel(kid, now=True)
- self.assertTrue(not kid in km)
+ self.assertNotIn(kid, km)
def _run_cinfo(self, km, transport, ip):
kid = km.start_kernel(stdout=PIPE, stderr=PIPE)
@@ -97,18 +97,22 @@
self._run_lifecycle(self._get_tcp_km())
self._run_lifecycle(self._get_tcp_km())
-
- def test_start_sequence_tcp_kernels(self):
+ def test_start_sequence_ipc_kernels(self):
"""Ensure that a sequence of kernel startups doesn't break anything."""
self._run_lifecycle(self._get_ipc_km())
self._run_lifecycle(self._get_ipc_km())
self._run_lifecycle(self._get_ipc_km())
+ def tcp_lifecycle_with_loop(self):
+ # Ensure each thread has an event loop
+ asyncio.set_event_loop(asyncio.new_event_loop())
+ self.test_tcp_lifecycle()
+
def test_start_parallel_thread_kernels(self):
self.test_tcp_lifecycle()
- thread = threading.Thread(target=self.test_tcp_lifecycle)
- thread2 = threading.Thread(target=self.test_tcp_lifecycle)
+ thread = threading.Thread(target=self.tcp_lifecycle_with_loop)
+ thread2 = threading.Thread(target=self.tcp_lifecycle_with_loop)
try:
thread.start()
thread2.start()
@@ -119,7 +123,7 @@
def test_start_parallel_process_kernels(self):
self.test_tcp_lifecycle()
- thread = threading.Thread(target=self.test_tcp_lifecycle)
+ thread = threading.Thread(target=self.tcp_lifecycle_with_loop)
proc = mp.Process(target=self.test_tcp_lifecycle)
try:
@@ -130,3 +134,137 @@
proc.join()
assert proc.exitcode == 0
+
+
+class TestAsyncKernelManager(AsyncTestCase):
+
+ def _get_tcp_km(self):
+ c = Config()
+ km = AsyncMultiKernelManager(config=c)
+ return km
+
+ def _get_ipc_km(self):
+ c = Config()
+ c.KernelManager.transport = 'ipc'
+ c.KernelManager.ip = 'test'
+ km = AsyncMultiKernelManager(config=c)
+ return km
+
+ async def _run_lifecycle(self, km):
+ kid = await km.start_kernel(stdout=PIPE, stderr=PIPE)
+ self.assertTrue(await km.is_alive(kid))
+ self.assertTrue(kid in km)
+ self.assertTrue(kid in km.list_kernel_ids())
+ self.assertEqual(len(km), 1)
+ await km.restart_kernel(kid, now=True)
+ self.assertTrue(await km.is_alive(kid))
+ self.assertTrue(kid in km.list_kernel_ids())
+ await km.interrupt_kernel(kid)
+ k = km.get_kernel(kid)
+ self.assertTrue(isinstance(k, AsyncKernelManager))
+ await km.shutdown_kernel(kid, now=True)
+ self.assertNotIn(kid, km)
+
+ async def _run_cinfo(self, km, transport, ip):
+ kid = await km.start_kernel(stdout=PIPE, stderr=PIPE)
+ k = km.get_kernel(kid)
+ cinfo = km.get_connection_info(kid)
+ self.assertEqual(transport, cinfo['transport'])
+ self.assertEqual(ip, cinfo['ip'])
+ self.assertTrue('stdin_port' in cinfo)
+ self.assertTrue('iopub_port' in cinfo)
+ stream = km.connect_iopub(kid)
+ stream.close()
+ self.assertTrue('shell_port' in cinfo)
+ stream = km.connect_shell(kid)
+ stream.close()
+ self.assertTrue('hb_port' in cinfo)
+ stream = km.connect_hb(kid)
+ stream.close()
+ await km.shutdown_kernel(kid, now=True)
+ self.assertNotIn(kid, km)
+
+ @gen_test
+ async def test_tcp_lifecycle(self):
+ await self.raw_tcp_lifecycle()
+
+ @gen_test
+ async def test_shutdown_all(self):
+ km = self._get_tcp_km()
+ kid = await km.start_kernel(stdout=PIPE, stderr=PIPE)
+ self.assertIn(kid, km)
+ await km.shutdown_all()
+ self.assertNotIn(kid, km)
+ # shutdown again is okay, because we have no kernels
+ await km.shutdown_all()
+
+ @gen_test
+ async def test_tcp_cinfo(self):
+ km = self._get_tcp_km()
+ await self._run_cinfo(km, 'tcp', localhost())
+
+ @skip_win32
+ @gen_test
+ async def test_ipc_lifecycle(self):
+ km = self._get_ipc_km()
+ await self._run_lifecycle(km)
+
+ @skip_win32
+ @gen_test
+ async def test_ipc_cinfo(self):
+ km = self._get_ipc_km()
+ await self._run_cinfo(km, 'ipc', 'test')
+
+ @gen_test
+ async def test_start_sequence_tcp_kernels(self):
+ """Ensure that a sequence of kernel startups doesn't break anything."""
+ await self._run_lifecycle(self._get_tcp_km())
+ await self._run_lifecycle(self._get_tcp_km())
+ await self._run_lifecycle(self._get_tcp_km())
+
+ @gen_test
+ async def test_start_sequence_ipc_kernels(self):
+ """Ensure that a sequence of kernel startups doesn't break anything."""
+ await self._run_lifecycle(self._get_ipc_km())
+ await self._run_lifecycle(self._get_ipc_km())
+ await self._run_lifecycle(self._get_ipc_km())
+
+ def tcp_lifecycle_with_loop(self):
+ # Ensure each thread has an event loop
+ asyncio.set_event_loop(asyncio.new_event_loop())
+ asyncio.get_event_loop().run_until_complete(self.raw_tcp_lifecycle())
+
+ async def raw_tcp_lifecycle(self):
+ # Since @gen_test creates an event loop, we need a raw form of
+ # test_tcp_lifecycle that assumes the loop already exists.
+ km = self._get_tcp_km()
+ await self._run_lifecycle(km)
+
+ @gen_test
+ async def test_start_parallel_thread_kernels(self):
+ await self.raw_tcp_lifecycle()
+
+ thread = threading.Thread(target=self.tcp_lifecycle_with_loop)
+ thread2 = threading.Thread(target=self.tcp_lifecycle_with_loop)
+ try:
+ thread.start()
+ thread2.start()
+ finally:
+ thread.join()
+ thread2.join()
+
+ @gen_test
+ async def test_start_parallel_process_kernels(self):
+ await self.raw_tcp_lifecycle()
+
+ thread = threading.Thread(target=self.tcp_lifecycle_with_loop)
+ proc = mp.Process(target=self.raw_tcp_lifecycle)
+
+ try:
+ thread.start()
+ proc.start()
+ finally:
+ proc.join()
+ thread.join()
+
+ assert proc.exitcode == 0
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/jupyter_client-6.0.0/jupyter_client.egg-info/PKG-INFO new/jupyter_client-6.1.3/jupyter_client.egg-info/PKG-INFO
--- old/jupyter_client-6.0.0/jupyter_client.egg-info/PKG-INFO 2020-02-24 05:58:18.000000000 +0100
+++ new/jupyter_client-6.1.3/jupyter_client.egg-info/PKG-INFO 2020-04-13 21:48:14.000000000 +0200
@@ -1,6 +1,6 @@
Metadata-Version: 2.1
Name: jupyter-client
-Version: 6.0.0
+Version: 6.1.3
Summary: Jupyter protocol implementation and client libraries
Home-page: https://jupyter.org
Author: Jupyter Development Team
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/jupyter_client-6.0.0/jupyter_client.egg-info/SOURCES.txt new/jupyter_client-6.1.3/jupyter_client.egg-info/SOURCES.txt
--- old/jupyter_client-6.0.0/jupyter_client.egg-info/SOURCES.txt 2020-02-24 05:58:18.000000000 +0100
+++ new/jupyter_client-6.1.3/jupyter_client.egg-info/SOURCES.txt 2020-04-13 21:48:14.000000000 +0200
@@ -12,6 +12,7 @@
docs/kernels.rst
docs/make.bat
docs/messaging.rst
+docs/requirements.txt
docs/wrapperkernels.rst
docs/api/client.rst
docs/api/index.rst
1
0
Hello community,
here is the log from the commit of package python-tabulate for openSUSE:Factory checked in at 2020-05-01 11:05:00
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-tabulate (Old)
and /work/SRC/openSUSE:Factory/.python-tabulate.new.2738 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-tabulate"
Fri May 1 11:05:00 2020 rev:8 rq:797707 version:0.8.7
Changes:
--------
--- /work/SRC/openSUSE:Factory/python-tabulate/python-tabulate.changes 2020-03-12 22:58:56.615005975 +0100
+++ /work/SRC/openSUSE:Factory/.python-tabulate.new.2738/python-tabulate.changes 2020-05-01 11:05:09.150777386 +0200
@@ -1,0 +2,8 @@
+Sat Apr 25 16:25:20 UTC 2020 - Arun Persaud <arun(a)gmx.de>
+
+- update to version 0.8.7:
+ * Bug fixes.
+ * New format: `pretty`.
+ * HTML escaping.
+
+-------------------------------------------------------------------
Old:
----
tabulate-0.8.6.tar.gz
New:
----
tabulate-0.8.7.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ python-tabulate.spec ++++++
--- /var/tmp/diff_new_pack.IUQPW8/_old 2020-05-01 11:05:12.178783971 +0200
+++ /var/tmp/diff_new_pack.IUQPW8/_new 2020-05-01 11:05:12.182783980 +0200
@@ -18,7 +18,7 @@
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
Name: python-tabulate
-Version: 0.8.6
+Version: 0.8.7
Release: 0
Summary: Pretty-printer for tabular data in Python
License: MIT
++++++ tabulate-0.8.6.tar.gz -> tabulate-0.8.7.tar.gz ++++++
++++ 14507 lines of diff (skipped)
1
0
Hello community,
here is the log from the commit of package python-hypothesis for openSUSE:Factory checked in at 2020-05-01 11:04:50
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-hypothesis (Old)
and /work/SRC/openSUSE:Factory/.python-hypothesis.new.2738 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-hypothesis"
Fri May 1 11:04:50 2020 rev:45 rq:797702 version:5.10.4
Changes:
--------
--- /work/SRC/openSUSE:Factory/python-hypothesis/python-hypothesis.changes 2020-04-19 21:49:49.076122679 +0200
+++ /work/SRC/openSUSE:Factory/.python-hypothesis.new.2738/python-hypothesis.changes 2020-05-01 11:05:00.134757779 +0200
@@ -1,0 +2,90 @@
+Fri Apr 24 15:18:51 UTC 2020 - Arun Persaud <arun(a)gmx.de>
+
+- specfile:
+ * updated Django version number in requirements
+
+- update to version 5.10.4:
+ * This patch improves the internals of builds() type inference, to
+ handle recursive forward references in certain dataclasses. This
+ is useful for e.g. hypothesmith’s forthcoming LibCST mode.
+
+- changes from version 5.10.3:
+ * This release reverses the order in which some operations are tried
+ during shrinking. This should generally be a slight performance
+ improvement, but most tests are unlikely to notice much
+ difference.
+
+- changes from version 5.10.2:
+ * This patch fixes issue #2406, where use of pandas.Timestamp
+ objects as bounds for the datetimes() strategy caused an internal
+ error. This bug was introduced in version 5.8.1.
+
+- changes from version 5.10.1:
+ * This release is a small internal refactoring to how shrinking
+ interacts with targeted property-based testing that should have no
+ user user visible impact.
+
+- changes from version 5.10.0:
+ * This release improves our support for datetimes and times around
+ DST transitions.
+ * times() and datetimes() are now sometimes generated with fold=1,
+ indicating that they represent the second occurrence of a given
+ wall-time when clocks are set backwards. This may be set even when
+ there is no transition, in which case the fold value should be
+ ignored.
+ For consistency, timezones provided by the pytz package can now
+ generate imaginary times (such as the hour skipped over when
+ clocks ‘spring forward’ to daylight saving time, or during some
+ historical timezone transitions). All other timezones have always
+ supported generation of imaginary times.
+ If you prefer the previous behaviour, datetimes() now takes an
+ argument allow_imaginary which defaults to True but can be set to
+ False for any timezones strategy.
+
+- changes from version 5.9.1 :
+ * This patch fixes the rendering of binary() docstring by using the
+ proper backticks syntax.
+
+- changes from version 5.9.0 :
+ * Failing tests which use target() now report the highest score
+ observed for each target alongside the failing example(s), even
+ without explicitly showing test statistics.
+ * This improves the debugging workflow for tests of accuracy, which
+ assert that the total imprecision is within some error budget -
+ for example, abs(a - b) < 0.5. Previously, shrinking to a minimal
+ failing example could often make errors seem smaller or more
+ subtle than they really are (see the threshold problem, and issue
+ #2180).
+
+- changes from version 5.8.6 :
+ * This patch improves the docstring of binary(), the repr() of
+ sampled_from() on an enum.Enum subclass, and a warning in our
+ pytest plugin. There is no change in runtime behaviour.
+
+- changes from version 5.8.5 :
+ * This release (potentially very significantly) improves the
+ performance of failing tests in some rare cases, mostly only
+ relevant when using targeted property-based testing, by stopping
+ further optimisation of unrelated test cases once a failing
+ example is found.
+
+- changes from version 5.8.4 :
+ * This release fixes issue #2395, where under some circumstances
+ targeted property-based testing could cause Hypothesis to get
+ caught in an infinite loop.
+
+- changes from version 5.8.3 :
+ * This patch teaches builds() and from_type() to use the
+ __signature__ attribute of classes where it has been set,
+ improving our support for Pydantic models (in pydantic >= 1.5).
+
+- changes from version 5.8.2 :
+ * This release improves the performance of the part of the core
+ engine that deliberately generates duplicate values.
+
+- changes from version 5.8.1 :
+ * This patch improves dates() shrinking, to simplify year, month,
+ and day like datetimes() rather than minimizing the number of days
+ since 2000-01-01.
+
+-------------------------------------------------------------------
Old:
----
hypothesis-python-5.8.0.tar.gz
New:
----
hypothesis-python-5.10.4.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ python-hypothesis.spec ++++++
--- /var/tmp/diff_new_pack.LkSH7b/_old 2020-05-01 11:05:01.626761023 +0200
+++ /var/tmp/diff_new_pack.LkSH7b/_new 2020-05-01 11:05:01.626761023 +0200
@@ -28,7 +28,7 @@
%endif
%define skip_python2 1
Name: python-hypothesis%{psuffix}
-Version: 5.8.0
+Version: 5.10.4
Release: 0
Summary: A library for property based testing
License: MPL-2.0
@@ -39,7 +39,7 @@
BuildRequires: python-rpm-macros
Requires: python-attrs >= 19.2.0
Requires: python-sortedcontainers >= 2.1.0
-Recommends: python-Django >= 1.11
+Recommends: python-Django >= 2.2
Recommends: python-dpcontracts >= 0.4
Recommends: python-lark-parser >= 0.6.5
Recommends: python-numpy >= 1.9.0
@@ -50,7 +50,7 @@
BuildArch: noarch
%if %{with test}
# SECTION test requirements
-BuildRequires: %{python_module Django >= 1.11}
+BuildRequires: %{python_module Django >= 2.2}
BuildRequires: %{python_module attrs >= 19.2.0}
BuildRequires: %{python_module flaky}
BuildRequires: %{python_module hypothesis >= %{version}}
++++++ hypothesis-python-5.8.0.tar.gz -> hypothesis-python-5.10.4.tar.gz ++++++
/work/SRC/openSUSE:Factory/python-hypothesis/hypothesis-python-5.8.0.tar.gz /work/SRC/openSUSE:Factory/.python-hypothesis.new.2738/hypothesis-python-5.10.4.tar.gz differ: char 13, line 1
1
0