manim icon indicating copy to clipboard operation
manim copied to clipboard

Start testing python 3.13

Open JasonGrace2282 opened this issue 1 year ago • 1 comments

Python 3.13 has been out for a week or two now, it's highly probable that new users to Manim may start off with python 3.13. As such, we should start testing it.

All tests pass locally on my machine, and looking through the porting guide there isn't much to be concerned about (except a small change w.r.t. functools.partial which I don't think applies to us).

This COMPLETELY REMOVES the upper python version bound. See https://iscinumpy.dev/post/bound-version-constraints/ for why upper bounds on python versions is a terrible idea.

(marking as a draft until tests pass on all operating systems)

Changes

  • Remove python upper bound
  • Use scipy >=1.14.0 for python 3.13
  • Add dependency audioop-lts after removal of stdlib audioop library.

JasonGrace2282 avatar Oct 20 '24 17:10 JasonGrace2282

Tried to replicate the 3.13 issue on Windows locally, effectively killed my stream doing so. :-)

Full Log
C:\Users\benja\src\manim\.venv\Lib\site-packages\_pytest\config\__init__.py:331: PluggyTeardownRaisedWarning: A plugin raised an exception during an old-style hookwrapper teardown.
Plugin: helpconfig, Hook: pytest_cmdline_parse
ConftestImportFailure: ImportError: DLL load failed while importing _core: The paging file is too small for this operation to complete. (from C:\Users\benja\src\manim\conftest.py)
For more information see https://pluggy.readthedocs.io/en/stable/api_reference.html#pluggy.PluggyTeardownRaisedWarning
  config = pluginmanager.hook.pytest_cmdline_parse(
INTERNALERROR> Traceback (most recent call last):
INTERNALERROR>   File "C:\Users\benja\src\manim\.venv\Lib\site-packages\_pytest\main.py", line 269, in wrap_session
INTERNALERROR>     config.hook.pytest_sessionstart(session=session)
INTERNALERROR>     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^
INTERNALERROR>   File "C:\Users\benja\src\manim\.venv\Lib\site-packages\pluggy\_hooks.py", line 513, in __call__
INTERNALERROR>     return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult)
INTERNALERROR>            ~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
INTERNALERROR>   File "C:\Users\benja\src\manim\.venv\Lib\site-packages\pluggy\_manager.py", line 120, in _hookexec
INTERNALERROR>     return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
INTERNALERROR>            ~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
INTERNALERROR>   File "C:\Users\benja\src\manim\.venv\Lib\site-packages\pluggy\_callers.py", line 182, in _multicall
INTERNALERROR>     return outcome.get_result()
INTERNALERROR>            ~~~~~~~~~~~~~~~~~~^^
INTERNALERROR>   File "C:\Users\benja\src\manim\.venv\Lib\site-packages\pluggy\_result.py", line 100, in get_result
INTERNALERROR>     raise exc.with_traceback(exc.__traceback__)
INTERNALERROR>   File "C:\Users\benja\src\manim\.venv\Lib\site-packages\pluggy\_callers.py", line 103, in _multicall
INTERNALERROR>     res = hook_impl.function(*args)
INTERNALERROR>   File "C:\Users\benja\src\manim\.venv\Lib\site-packages\xdist\dsession.py", line 79, in pytest_sessionstart
INTERNALERROR>     nodes = self.nodemanager.setup_nodes(putevent=self.queue.put)
INTERNALERROR>   File "C:\Users\benja\src\manim\.venv\Lib\site-packages\xdist\workermanage.py", line 66, in setup_nodes
INTERNALERROR>     return [self.setup_node(spec, putevent) for spec in self.specs]
INTERNALERROR>             ~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^
INTERNALERROR>   File "C:\Users\benja\src\manim\.venv\Lib\site-packages\xdist\workermanage.py", line 69, in setup_node
INTERNALERROR>     gw = self.group.makegateway(spec)
INTERNALERROR>   File "C:\Users\benja\src\manim\.venv\Lib\site-packages\execnet\multi.py", line 154, in makegateway
INTERNALERROR>     gw = gateway_bootstrap.bootstrap(io, spec)
INTERNALERROR>   File "C:\Users\benja\src\manim\.venv\Lib\site-packages\execnet\gateway_bootstrap.py", line 88, in bootstrap
INTERNALERROR>     bootstrap_import(io, spec)
INTERNALERROR>     ~~~~~~~~~~~~~~~~^^^^^^^^^^
INTERNALERROR>   File "C:\Users\benja\src\manim\.venv\Lib\site-packages\execnet\gateway_bootstrap.py", line 36, in bootstrap_import
INTERNALERROR>     s = io.read(1)
INTERNALERROR>   File "C:\Users\benja\src\manim\.venv\Lib\site-packages\execnet\gateway_base.py", line 536, in read
INTERNALERROR>     raise EOFError("expected %d bytes, got %d" % (numbytes, len(buf)))
INTERNALERROR> EOFError: expected 1 bytes, got 0
Exception ignored in atexit callback <bound method Group._cleanup_atexit of <Group []>>:
Traceback (most recent call last):
C:\Users\benja\src\manim\.venv\Lib\site-packages\_pytest\config\__init__.py:331: PluggyTeardownRaisedWarning: A plugin raised an exception during an old-style hookwrapper teardown.
Plugin: helpconfig, Hook: pytest_cmdline_parse
MemoryError:
For more information see https://pluggy.readthedocs.io/en/stable/api_reference.html#pluggy.PluggyTeardownRaisedWarning
  config = pluginmanager.hook.pytest_cmdline_parse(
C:\Users\benja\src\manim\.venv\Lib\site-packages\_pytest\config\__init__.py:331: PluggyTeardownRaisedWarning: A plugin raised an exception during an old-style hookwrapper teardown.
Plugin: helpconfig, Hook: pytest_cmdline_parse
ConftestImportFailure: MemoryError:  (from C:\Users\benja\src\manim\conftest.py)
For more information see https://pluggy.readthedocs.io/en/stable/api_reference.html#pluggy.PluggyTeardownRaisedWarning
  config = pluginmanager.hook.pytest_cmdline_parse(
C:\Users\benja\src\manim\.venv\Lib\site-packages\_pytest\config\__init__.py:331: PluggyTeardownRaisedWarning: A plugin raised an exception during an old-style hookwrapper teardown.
Plugin: helpconfig, Hook: pytest_cmdline_parse
ConftestImportFailure: ImportError: DLL load failed while importing _bounded_integers: The paging file is too small for this operation to complete. (from C:\Users\benja\src\manim\conftest.py)
For more information see https://pluggy.readthedocs.io/en/stable/api_reference.html#pluggy.PluggyTeardownRaisedWarning
  config = pluginmanager.hook.pytest_cmdline_parse(
C:\Users\benja\src\manim\.venv\Lib\site-packages\_pytest\config\__init__.py:331: PluggyTeardownRaisedWarning: A plugin raised an exception during an old-style hookwrapper teardown.
Plugin: helpconfig, Hook: pytest_cmdline_parse
ConftestImportFailure: ImportError: DLL load failed while importing _pathops: The paging file is too small for this operation to complete. (from C:\Users\benja\src\manim\conftest.py)
For more information see https://pluggy.readthedocs.io/en/stable/api_reference.html#pluggy.PluggyTeardownRaisedWarning
  config = pluginmanager.hook.pytest_cmdline_parse(
C:\Users\benja\src\manim\.venv\Lib\site-packages\_pytest\config\__init__.py:331: PluggyTeardownRaisedWarning: A plugin raised an exception during an old-style hookwrapper teardown.
Plugin: helpconfig, Hook: pytest_cmdline_parse
ConftestImportFailure: MemoryError:  (from C:\Users\benja\src\manim\conftest.py)
For more information see https://pluggy.readthedocs.io/en/stable/api_reference.html#pluggy.PluggyTeardownRaisedWarning
  config = pluginmanager.hook.pytest_cmdline_parse(
C:\Users\benja\src\manim\.venv\Lib\site-packages\_pytest\config\__init__.py:331: PluggyTeardownRaisedWarning: A plugin raised an exception during an old-style hookwrapper teardown.
Plugin: helpconfig, Hook: pytest_cmdline_parse
ConftestImportFailure: ImportError: DLL load failed while importing _cairo: The paging file is too small for this operation to complete. (from C:\Users\benja\src\manim\conftest.py)
For more information see https://pluggy.readthedocs.io/en/stable/api_reference.html#pluggy.PluggyTeardownRaisedWarning
  config = pluginmanager.hook.pytest_cmdline_parse(
C:\Users\benja\src\manim\.venv\Lib\site-packages\_pytest\config\__init__.py:331: PluggyTeardownRaisedWarning: A plugin raised an exception during an old-style hookwrapper teardown.
Plugin: helpconfig, Hook: pytest_cmdline_parse
ConftestImportFailure: ImportError: DLL load failed while importing mtrand: The paging file is too small for this operation to complete. (from C:\Users\benja\src\manim\conftest.py)
For more information see https://pluggy.readthedocs.io/en/stable/api_reference.html#pluggy.PluggyTeardownRaisedWarning
  config = pluginmanager.hook.pytest_cmdline_parse(
C:\Users\benja\src\manim\.venv\Lib\site-packages\_pytest\config\__init__.py:331: PluggyTeardownRaisedWarning: A plugin raised an exception during an old-style hookwrapper teardown.
Plugin: helpconfig, Hook: pytest_cmdline_parse
ConftestImportFailure: ImportError: DLL load failed while importing _core: The paging file is too small for this operation to complete. (from C:\Users\benja\src\manim\conftest.py)
For more information see https://pluggy.readthedocs.io/en/stable/api_reference.html#pluggy.PluggyTeardownRaisedWarning
  config = pluginmanager.hook.pytest_cmdline_parse(
PS C:\Users\benja\src\manim> C:\Users\benja\src\manim\.venv\Lib\site-packages\_pytest\main.py:306: PluggyTeardownRaisedWarning: A plugin raised an exception during an old-style hookwrapper teardown.
Plugin: 2050814534256, Hook: pytest_sessionfinish
OSError: cannot send (already closed?)
For more information see https://pluggy.readthedocs.io/en/stable/api_reference.html#pluggy.PluggyTeardownRaisedWarning
  config.hook.pytest_sessionfinish(
C:\Users\benja\src\manim\.venv\Lib\site-packages\_pytest\main.py:306: PluggyTeardownRaisedWarning: A plugin raised an exception during an old-style hookwrapper teardown.
Plugin: 2679295664752, Hook: pytest_sessionfinish
OSError: cannot send (already closed?)
For more information see https://pluggy.readthedocs.io/en/stable/api_reference.html#pluggy.PluggyTeardownRaisedWarning
  config.hook.pytest_sessionfinish(

behackl avatar Oct 27 '24 14:10 behackl

Alright, this was rather annoying -- but here we are; our tests are passing for all OS/Python version combinations.

There were a bunch of breaking changes mandated due to the need to upgrade numpy to >=2.0 (mainly in the doctests). Actually requiring numpy>=2.0 makes our dependencies unsatisfiable due to moderngl-window requiring numpy<2 (reported upstream, likely to be resolved with their next release).

I am not sure what to do with this PR in the meantime; probably we will just have to wait until moderngl-window has a new release.

behackl avatar Nov 16 '24 11:11 behackl