Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support Python 3.13 #1199

Merged
merged 5 commits into from
Feb 20, 2025
Merged

Support Python 3.13 #1199

merged 5 commits into from
Feb 20, 2025

Conversation

maresb
Copy link
Contributor

@maresb maresb commented Feb 9, 2025

Description

Related Issue

Checklist

Type of change

  • New feature / enhancement
  • Bug fix
  • Documentation
  • Maintenance
  • Other (please specify):

📚 Documentation preview 📚: https://pytensor--1199.org.readthedocs.build/en/1199/

@ricardoV94
Copy link
Member

cpython missing in conda?

@maresb
Copy link
Contributor Author

maresb commented Feb 9, 2025

It's been on conda-forge since early October.

@maresb
Copy link
Contributor Author

maresb commented Feb 9, 2025

numba isn't yet available on conda-forge: conda-forge/numba-feedstock#152

@maresb
Copy link
Contributor Author

maresb commented Feb 9, 2025

The oldest version of numpy available for Python 3.13 is v2.1.0. Thus #1194 is a prerequisite.

@maresb maresb mentioned this pull request Feb 9, 2025
@ricardoV94 ricardoV94 changed the title Try Python 3.13 Enable python 3.13 Feb 9, 2025
@ricardoV94 ricardoV94 changed the title Enable python 3.13 Enable Python 3.13 Feb 9, 2025
@maresb
Copy link
Contributor Author

maresb commented Feb 11, 2025

Numba is now available. Still blocked by #1194 though.

@ricardoV94
Copy link
Member

@maresb wanna retry?

@maresb
Copy link
Contributor Author

maresb commented Feb 18, 2025

AssertionError: Blas flags are empty

@ricardoV94
Copy link
Member

Did anything change on the conda side with python 3.13 / BLAS @maresb ?

@ricardoV94
Copy link
Member

ricardoV94 commented Feb 18, 2025

Also seeing this:

error    libmamba Could not solve for environment specs
    The following package could not be installed
    └─ python ~=3.13 *_cpython does not exist (perhaps a typo or a missing channel).

@maresb
Copy link
Contributor Author

maresb commented Feb 18, 2025

Did anything change on the conda side with python 3.13

Yes, good catch!!! https://conda-forge.org/news/2024/08/14/sunsetting-pypy/

@maresb
Copy link
Contributor Author

maresb commented Feb 18, 2025

Looks like we're close!

FAILED pytensor/gradient.py::pytensor.gradient.hessian_vector_product - TypeError: DocTestRunner.__record_outcome() missing 1 required positional argument: 'skips'
FAILED pytensor/sparse/basic.py::pytensor.sparse.basic.block_diag - TypeError: DocTestRunner.__record_outcome() missing 1 required positional argument: 'skips'
FAILED pytensor/tensor/basic.py::pytensor.tensor.basic.tile - TypeError: DocTestRunner.__record_outcome() missing 1 required positional argument: 'skips'
FAILED pytensor/tensor/einsum.py::pytensor.tensor.einsum._delta - TypeError: DocTestRunner.__record_outcome() missing 1 required positional argument: 'skips'
FAILED pytensor/tensor/einsum.py::pytensor.tensor.einsum._general_dot - TypeError: DocTestRunner.__record_outcome() missing 1 required positional argument: 'skips'
FAILED pytensor/tensor/einsum.py::pytensor.tensor.einsum._iota - TypeError: DocTestRunner.__record_outcome() missing 1 required positional argument: 'skips'
FAILED pytensor/tensor/extra_ops.py::pytensor.tensor.extra_ops.repeat - TypeError: DocTestRunner.__record_outcome() missing 1 required positional argument: 'skips'
FAILED pytensor/tensor/pad.py::pytensor.tensor.pad.pad - TypeError: DocTestRunner.__record_outcome() missing 1 required positional argument: 'skips'
FAILED pytensor/tensor/slinalg.py::pytensor.tensor.slinalg.cholesky - TypeError: DocTestRunner.__record_outcome() missing 1 required positional argument: 'skips'
FAILED pytensor/tensor/subtensor.py::pytensor.tensor.subtensor.flip - TypeError: DocTestRunner.__record_outcome() missing 1 required positional argument: 'skips'
FAILED pytensor/tensor/subtensor.py::pytensor.tensor.subtensor.slice_at_axis - TypeError: DocTestRunner.__record_outcome() missing 1 required positional argument: 'skips'

@maresb
Copy link
Contributor Author

maresb commented Feb 18, 2025

Seems to be this: twmr/pytest-sphinx#67

Unfortunately it's been open for 2 months. 😞

@ricardoV94
Copy link
Member

doctest syntax change?

@maresb
Copy link
Contributor Author

maresb commented Feb 18, 2025

Python change that breaks pytest-sphinx. See linked issue

@maresb
Copy link
Contributor Author

maresb commented Feb 18, 2025

How many of the docstrings use sphinx?

@ricardoV94
Copy link
Member

let's skip it on the 3.13 CI and open an issue to decide whether to wait or drop pytest-sphinx

@ricardoV94 ricardoV94 mentioned this pull request Feb 20, 2025
11 tasks
maresb and others added 4 commits February 20, 2025 14:48
We want to test numpy 1.26.x on `test_math.py` but test_math.py was being excluded in python 3.10, and numpy 1.26.x was being excluded in the non python3.10 job.
pytest-sphinx is not compatible with Python 3.13: twmr/pytest-sphinx#67
@ricardoV94 ricardoV94 changed the title Enable Python 3.13 Support Python 3.13 Feb 20, 2025
@ricardoV94
Copy link
Member

@maresb I changed the doctests to run only on python 3.12, hopefully this sorts it out.

Copy link

codecov bot commented Feb 20, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 81.99%. Comparing base (c4fb0cf) to head (8b8b4ca).
Report is 5 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #1199   +/-   ##
=======================================
  Coverage   81.99%   81.99%           
=======================================
  Files         188      188           
  Lines       48566    48566           
  Branches     8677     8677           
=======================================
  Hits        39823    39823           
  Misses       6580     6580           
  Partials     2163     2163           

@maresb
Copy link
Contributor Author

maresb commented Feb 20, 2025

This is exciting, let's do it!!!

@ricardoV94 ricardoV94 merged commit 5d4e9e0 into pymc-devs:main Feb 20, 2025
73 checks passed
@maresb maresb deleted the py313 branch February 20, 2025 15:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

python 3.13.1
2 participants