Bug#1056531: spyder-kernels autopkg tests fail with Python 3.12
Matthias Klose
doko at debian.org
Wed Nov 22 15:54:42 GMT 2023
Package: src:spyder-kernels
Version: 2.4.4-2
Severity: important
Tags: sid trixie
User: debian-python at lists.debian.org
Usertags: python3.12
spyder-kernels autopkg tests fail with Python 3.12:
[...]
354s =================================== FAILURES
===================================
354s _____________________________ test_umr_skip_cython
_____________________________
354s
354s user_module = <function user_module.<locals>.create_module at
0x7f3c00450e00>
354s
354s def test_umr_skip_cython(user_module):
354s """
354s Test that the UMR doesn't try to reload modules when Cython
354s support is active.
354s """
354s # Create user module
354s user_module('foo')
354s
354s # Activate Cython support
354s os.environ['SPY_RUN_CYTHON'] = 'True'
354s
354s # Create UMR
354s > umr = UserModuleReloader()
354s
354s spyder_kernels/customize/tests/test_umr.py:55:
354s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
_ _ _ _ _ _
354s spyder_kernels/customize/umr.py:61: in __init__
354s self.activate_cython()
354s spyder_kernels/customize/umr.py:107: in activate_cython
354s import pyximport
354s /usr/lib/python3/dist-packages/pyximport/__init__.py:1: in <module>
354s from .pyximport import *
354s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
_ _ _ _ _ _
354s
354s """
354s Import hooks; when installed with the install() function, these
hooks
354s allow importing .pyx files as if they were Python modules.
354s
354s If you want the hook installed every time you run Python
354s you can add it to your Python version by adding these lines to
354s sitecustomize.py (which you can create from scratch in
site-packages
354s if it doesn't exist there or somewhere else on your python path)::
354s
354s import pyximport
354s pyximport.install()
354s
354s For instance on the Mac with a non-system Python 2.3, you could
create
354s sitecustomize.py with only those two lines at
354s /usr/local/lib/python2.3/site-packages/sitecustomize.py .
354s
354s A custom distutils.core.Extension instance and setup() args
354s (Distribution) for for the build can be defined by a
<modulename>.pyxbld
354s file like:
354s
354s # examplemod.pyxbld
354s def make_ext(modname, pyxfilename):
354s from distutils.extension import Extension
354s return Extension(name = modname,
354s sources=[pyxfilename, 'hello.c'],
354s include_dirs=['/myinclude'] )
354s def make_setup_args():
354s return dict(script_args=["--compiler=mingw32"])
354s
354s Extra dependencies can be defined by a <modulename>.pyxdep .
354s See README.
354s
354s Since Cython 0.11, the :mod:`pyximport` module also has
experimental
354s compilation support for normal Python modules. This allows you to
354s automatically run Cython on every .pyx and .py module that Python
354s imports, including parts of the standard library and installed
354s packages. Cython will still fail to compile a lot of Python
modules,
354s in which case the import mechanism will fall back to loading the
354s Python source modules instead. The .py import mechanism is
installed
354s like this::
354s
354s pyximport.install(pyimport = True)
354s
354s Running this module as a top-level script will run a test and
then print
354s the documentation.
354s
354s This code is based on the Py2.3+ import protocol as described
in PEP 302.
354s """
354s
354s import glob
354s > import imp
354s E ModuleNotFoundError: No module named 'imp'
354s
354s /usr/lib/python3/dist-packages/pyximport/pyximport.py:51:
ModuleNotFoundError
354s _________________________________ test_umr_run
_________________________________
354s
354s user_module = <function user_module.<locals>.create_module at
0x7f3bf33e8040>
354s
354s def test_umr_run(user_module):
354s """Test that UMR's run method is working correctly."""
354s # Create user module
354s user_module('foo1')
354s
354s # Activate verbose mode in the UMR
354s os.environ['SPY_UMR_VERBOSE'] = 'True'
354s
354s # Create UMR
354s > umr = UserModuleReloader()
354s
354s spyder_kernels/customize/tests/test_umr.py:73:
354s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
_ _ _ _ _ _
354s spyder_kernels/customize/umr.py:61: in __init__
354s self.activate_cython()
354s spyder_kernels/customize/umr.py:107: in activate_cython
354s import pyximport
354s /usr/lib/python3/dist-packages/pyximport/__init__.py:1: in <module>
354s from .pyximport import *
354s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
_ _ _ _ _ _
354s
354s """
354s Import hooks; when installed with the install() function, these
hooks
354s allow importing .pyx files as if they were Python modules.
354s
354s If you want the hook installed every time you run Python
354s you can add it to your Python version by adding these lines to
354s sitecustomize.py (which you can create from scratch in
site-packages
354s if it doesn't exist there or somewhere else on your python path)::
354s
354s import pyximport
354s pyximport.install()
354s
354s For instance on the Mac with a non-system Python 2.3, you could
create
354s sitecustomize.py with only those two lines at
354s /usr/local/lib/python2.3/site-packages/sitecustomize.py .
354s
354s A custom distutils.core.Extension instance and setup() args
354s (Distribution) for for the build can be defined by a
<modulename>.pyxbld
354s file like:
354s
354s # examplemod.pyxbld
354s def make_ext(modname, pyxfilename):
354s from distutils.extension import Extension
354s return Extension(name = modname,
354s sources=[pyxfilename, 'hello.c'],
354s include_dirs=['/myinclude'] )
354s def make_setup_args():
354s return dict(script_args=["--compiler=mingw32"])
354s
354s Extra dependencies can be defined by a <modulename>.pyxdep .
354s See README.
354s
354s Since Cython 0.11, the :mod:`pyximport` module also has
experimental
354s compilation support for normal Python modules. This allows you to
354s automatically run Cython on every .pyx and .py module that Python
354s imports, including parts of the standard library and installed
354s packages. Cython will still fail to compile a lot of Python
modules,
354s in which case the import mechanism will fall back to loading the
354s Python source modules instead. The .py import mechanism is
installed
354s like this::
354s
354s pyximport.install(pyimport = True)
354s
354s Running this module as a top-level script will run a test and
then print
354s the documentation.
354s
354s This code is based on the Py2.3+ import protocol as described
in PEP 302.
354s """
354s
354s import glob
354s > import imp
354s E ModuleNotFoundError: No module named 'imp'
354s
354s /usr/lib/python3/dist-packages/pyximport/pyximport.py:51:
ModuleNotFoundError
354s __________________________ test_umr_previous_modules
___________________________
354s
354s user_module = <function user_module.<locals>.create_module at
0x7f3bf33e8900>
354s
354s def test_umr_previous_modules(user_module):
354s """Test that UMR's previos_modules is working as expected."""
354s # Create user module
354s user_module('foo2')
354s
354s # Create UMR
354s > umr = UserModuleReloader()
354s
354s spyder_kernels/customize/tests/test_umr.py:86:
354s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
_ _ _ _ _ _
354s spyder_kernels/customize/umr.py:61: in __init__
354s self.activate_cython()
354s spyder_kernels/customize/umr.py:107: in activate_cython
354s import pyximport
354s /usr/lib/python3/dist-packages/pyximport/__init__.py:1: in <module>
354s from .pyximport import *
354s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
_ _ _ _ _ _
354s
354s """
354s Import hooks; when installed with the install() function, these
hooks
354s allow importing .pyx files as if they were Python modules.
354s
354s If you want the hook installed every time you run Python
354s you can add it to your Python version by adding these lines to
354s sitecustomize.py (which you can create from scratch in
site-packages
354s if it doesn't exist there or somewhere else on your python path)::
354s
354s import pyximport
354s pyximport.install()
354s
354s For instance on the Mac with a non-system Python 2.3, you could
create
354s sitecustomize.py with only those two lines at
354s /usr/local/lib/python2.3/site-packages/sitecustomize.py .
354s
354s A custom distutils.core.Extension instance and setup() args
354s (Distribution) for for the build can be defined by a
<modulename>.pyxbld
354s file like:
354s
354s # examplemod.pyxbld
354s def make_ext(modname, pyxfilename):
354s from distutils.extension import Extension
354s return Extension(name = modname,
354s sources=[pyxfilename, 'hello.c'],
354s include_dirs=['/myinclude'] )
354s def make_setup_args():
354s return dict(script_args=["--compiler=mingw32"])
354s
354s Extra dependencies can be defined by a <modulename>.pyxdep .
354s See README.
354s
354s Since Cython 0.11, the :mod:`pyximport` module also has
experimental
354s compilation support for normal Python modules. This allows you to
354s automatically run Cython on every .pyx and .py module that Python
354s imports, including parts of the standard library and installed
354s packages. Cython will still fail to compile a lot of Python
modules,
354s in which case the import mechanism will fall back to loading the
354s Python source modules instead. The .py import mechanism is
installed
354s like this::
354s
354s pyximport.install(pyimport = True)
354s
354s Running this module as a top-level script will run a test and
then print
354s the documentation.
354s
354s This code is based on the Py2.3+ import protocol as described
in PEP 302.
354s """
354s
354s import glob
354s > import imp
354s E ModuleNotFoundError: No module named 'imp'
354s
354s /usr/lib/python3/dist-packages/pyximport/pyximport.py:51:
ModuleNotFoundError
354s ______________________________ test_umr_namelist
_______________________________
354s
354s def test_umr_namelist():
354s """Test that the UMR skips modules according to its name."""
354s > umr = UserModuleReloader()
354s
354s spyder_kernels/customize/tests/test_umr.py:95:
354s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
_ _ _ _ _ _
354s spyder_kernels/customize/umr.py:61: in __init__
354s self.activate_cython()
354s spyder_kernels/customize/umr.py:107: in activate_cython
354s import pyximport
354s /usr/lib/python3/dist-packages/pyximport/__init__.py:1: in <module>
354s from .pyximport import *
354s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
_ _ _ _ _ _
354s
354s """
354s Import hooks; when installed with the install() function, these
hooks
354s allow importing .pyx files as if they were Python modules.
354s
354s If you want the hook installed every time you run Python
354s you can add it to your Python version by adding these lines to
354s sitecustomize.py (which you can create from scratch in
site-packages
354s if it doesn't exist there or somewhere else on your python path)::
354s
354s import pyximport
354s pyximport.install()
354s
354s For instance on the Mac with a non-system Python 2.3, you could
create
354s sitecustomize.py with only those two lines at
354s /usr/local/lib/python2.3/site-packages/sitecustomize.py .
354s
354s A custom distutils.core.Extension instance and setup() args
354s (Distribution) for for the build can be defined by a
<modulename>.pyxbld
354s file like:
354s
354s # examplemod.pyxbld
354s def make_ext(modname, pyxfilename):
354s from distutils.extension import Extension
354s return Extension(name = modname,
354s sources=[pyxfilename, 'hello.c'],
354s include_dirs=['/myinclude'] )
354s def make_setup_args():
354s return dict(script_args=["--compiler=mingw32"])
354s
354s Extra dependencies can be defined by a <modulename>.pyxdep .
354s See README.
354s
354s Since Cython 0.11, the :mod:`pyximport` module also has
experimental
354s compilation support for normal Python modules. This allows you to
354s automatically run Cython on every .pyx and .py module that Python
354s imports, including parts of the standard library and installed
354s packages. Cython will still fail to compile a lot of Python
modules,
354s in which case the import mechanism will fall back to loading the
354s Python source modules instead. The .py import mechanism is
installed
354s like this::
354s
354s pyximport.install(pyimport = True)
354s
354s Running this module as a top-level script will run a test and
then print
354s the documentation.
354s
354s This code is based on the Py2.3+ import protocol as described
in PEP 302.
354s """
354s
354s import glob
354s > import imp
354s E ModuleNotFoundError: No module named 'imp'
354s
354s /usr/lib/python3/dist-packages/pyximport/pyximport.py:51:
ModuleNotFoundError
354s ___________________________ test_umr_reload_modules
____________________________
354s
354s user_module = <function user_module.<locals>.create_module at
0x7f3bf33e9620>
354s
354s def test_umr_reload_modules(user_module):
354s """Test that the UMR only tries to reload user modules."""
354s # Create user module
354s user_module('foo3')
354s
354s # Create UMR
354s > umr = UserModuleReloader()
354s
354s spyder_kernels/customize/tests/test_umr.py:109:
354s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
_ _ _ _ _ _
354s spyder_kernels/customize/umr.py:61: in __init__
354s self.activate_cython()
354s spyder_kernels/customize/umr.py:107: in activate_cython
354s import pyximport
354s /usr/lib/python3/dist-packages/pyximport/__init__.py:1: in <module>
354s from .pyximport import *
354s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
_ _ _ _ _ _
354s
354s """
354s Import hooks; when installed with the install() function, these
hooks
354s allow importing .pyx files as if they were Python modules.
354s
354s If you want the hook installed every time you run Python
354s you can add it to your Python version by adding these lines to
354s sitecustomize.py (which you can create from scratch in
site-packages
354s if it doesn't exist there or somewhere else on your python path)::
354s
354s import pyximport
354s pyximport.install()
354s
354s For instance on the Mac with a non-system Python 2.3, you could
create
354s sitecustomize.py with only those two lines at
354s /usr/local/lib/python2.3/site-packages/sitecustomize.py .
354s
354s A custom distutils.core.Extension instance and setup() args
354s (Distribution) for for the build can be defined by a
<modulename>.pyxbld
354s file like:
354s
354s # examplemod.pyxbld
354s def make_ext(modname, pyxfilename):
354s from distutils.extension import Extension
354s return Extension(name = modname,
354s sources=[pyxfilename, 'hello.c'],
354s include_dirs=['/myinclude'] )
354s def make_setup_args():
354s return dict(script_args=["--compiler=mingw32"])
354s
354s Extra dependencies can be defined by a <modulename>.pyxdep .
354s See README.
354s
354s Since Cython 0.11, the :mod:`pyximport` module also has
experimental
354s compilation support for normal Python modules. This allows you to
354s automatically run Cython on every .pyx and .py module that Python
354s imports, including parts of the standard library and installed
354s packages. Cython will still fail to compile a lot of Python
modules,
354s in which case the import mechanism will fall back to loading the
354s Python source modules instead. The .py import mechanism is
installed
354s like this::
354s
354s pyximport.install(pyimport = True)
354s
354s Running this module as a top-level script will run a test and
then print
354s the documentation.
354s
354s This code is based on the Py2.3+ import protocol as described
in PEP 302.
354s """
354s
354s import glob
354s > import imp
354s E ModuleNotFoundError: No module named 'imp'
354s
354s /usr/lib/python3/dist-packages/pyximport/pyximport.py:51:
ModuleNotFoundError
354s =============================== warnings summary
===============================
354s ../../../usr/lib/python3/dist-packages/dateutil/tz/tz.py:37
354s /usr/lib/python3/dist-packages/dateutil/tz/tz.py:37:
DeprecationWarning: datetime.datetime.utcfromtimestamp() is deprecated
and scheduled for removal in a future version. Use timezone-aware
objects to represent datetimes in UTC:
datetime.datetime.fromtimestamp(timestamp, datetime.UTC).
354s EPOCH = datetime.datetime.utcfromtimestamp(0)
354s
354s ../../../usr/lib/python3/dist-packages/jupyter_client/connect.py:27
354s /usr/lib/python3/dist-packages/jupyter_client/connect.py:27:
DeprecationWarning: Jupyter is migrating its paths to use standard
platformdirs
354s given by the platformdirs library. To remove this warning and
354s see the appropriate new directories, set the environment variable
354s `JUPYTER_PLATFORM_DIRS=1` and then run `jupyter --paths`.
354s The use of platformdirs will be the default in `jupyter_core` v6
354s from jupyter_core.paths import jupyter_data_dir
354s
354s ../../../usr/lib/python3/dist-packages/pytz/__init__.py:30
354s /usr/lib/python3/dist-packages/pytz/__init__.py:30:
SyntaxWarning: invalid escape sequence '\s'
354s match = re.match("^#\s*version\s*([0-9a-z]*)\s*$", line)
354s
354s spyder_kernels/console/tests/test_console_kernel.py: 70 warnings
354s /usr/lib/python3/dist-packages/jupyter_client/session.py:203:
DeprecationWarning: datetime.datetime.utcnow() is deprecated and
scheduled for removal in a future version. Use timezone-aware objects to
represent datetimes in UTC: datetime.datetime.now(datetime.UTC).
354s return datetime.utcnow().replace(tzinfo=utc)
354s
354s spyder_kernels/console/tests/test_console_kernel.py::test_magics
354s /usr/lib/python3/dist-packages/IPython/core/history.py:570:
DeprecationWarning: The default datetime adapter is deprecated as of
Python 3.12; see the sqlite3 documentation for suggested replacement recipes
354s cur = conn.execute(
354s
354s spyder_kernels/console/tests/test_console_kernel.py::test_load_data
354s
spyder_kernels/console/tests/test_console_kernel.py::test_save_namespace
354s
spyder_kernels/utils/tests/test_iofuncs.py::test_spydata_import[export_data.spydata]
354s
spyder_kernels/utils/tests/test_iofuncs.py::test_spydata_import[export_data_renamed.spydata]
354s
spyder_kernels/utils/tests/test_iofuncs.py::test_spydata_import_witherror
354s
spyder_kernels/utils/tests/test_iofuncs.py::test_spydata_export[spydata_values-spydata_values-export_data_copy]
354s
spyder_kernels/utils/tests/test_iofuncs.py::test_spydata_export[namespace_objects_full-namespace_objects_filtered-export_data_2]
354s /usr/lib/python3.12/tarfile.py:2220: DeprecationWarning: Python
3.14 will, by default, filter extracted tar archives and reject files or
modify their metadata. Use the filter argument to control this behavior.
354s warnings.warn(
354s
354s spyder_kernels/utils/tests/test_nsview.py::test_get_type_string
354s
/tmp/autopkgtest.XBSlhD/autopkgtest_tmp/spyder_kernels/utils/tests/test_nsview.py:345:
PendingDeprecationWarning: the matrix subclass is not the recommended
way to represent matrices or deal with linear algebra (see
https://docs.scipy.org/doc/numpy/user/numpy-for-matlab-users.html).
Please adjust your code to use regular ndarray.
354s matrix = np.matrix([[1, 2], [3, 4]])
354s
354s spyder_kernels/utils/tests/test_nsview.py::test_is_editable_type
354s
/tmp/autopkgtest.XBSlhD/autopkgtest_tmp/spyder_kernels/utils/tests/test_nsview.py:400:
PendingDeprecationWarning: the matrix subclass is not the recommended
way to represent matrices or deal with linear algebra (see
https://docs.scipy.org/doc/numpy/user/numpy-for-matlab-users.html).
Please adjust your code to use regular ndarray.
354s matrix = np.matrix([[1, 2], [3, 4]])
354s
354s spyder_kernels/utils/tests/test_nsview.py::test_get_numpy_type
354s
/tmp/autopkgtest.XBSlhD/autopkgtest_tmp/spyder_kernels/utils/tests/test_nsview.py:438:
PendingDeprecationWarning: the matrix subclass is not the recommended
way to represent matrices or deal with linear algebra (see
https://docs.scipy.org/doc/numpy/user/numpy-for-matlab-users.html).
Please adjust your code to use regular ndarray.
354s matrix = np.matrix([[1, 2], [3, 4]])
354s
354s -- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
354s ===Flaky Test Report===
354s
354s test_cwd_in_sys_path passed 1 out of the required 1 times. Success!
354s test_multiprocessing passed 1 out of the required 1 times. Success!
354s test_multiprocessing_2 passed 1 out of the required 1 times. Success!
354s test_runfile passed 1 out of the required 1 times. Success!
354s test_np_threshold passed 1 out of the required 1 times. Success!
354s test_matplotlib_inline passed 1 out of the required 1 times. Success!
354s test_debug_namespace passed 1 out of the required 1 times. Success!
354s
354s ===End Flaky Test Report===
354s =========================== short test summary info
============================
354s FAILED
spyder_kernels/customize/tests/test_umr.py::test_umr_skip_cython - Mod...
354s FAILED spyder_kernels/customize/tests/test_umr.py::test_umr_run -
ModuleNotFo...
354s FAILED
spyder_kernels/customize/tests/test_umr.py::test_umr_previous_modules
354s FAILED
spyder_kernels/customize/tests/test_umr.py::test_umr_namelist - Module...
354s FAILED
spyder_kernels/customize/tests/test_umr.py::test_umr_reload_modules - ...
354s ===== 5 failed, 65 passed, 5 skipped, 1 deselected, 84 warnings in
22.14s ======
More information about the debian-science-maintainers
mailing list