docker-stacks icon indicating copy to clipboard operation
docker-stacks copied to clipboard

Switch to Python 3.13

Open mathbunnyru opened this issue 1 year ago • 7 comments

Describe your changes

Issue ticket if applicable

Checklist (especially for first-time contributors)

  • [ ] I have performed a self-review of my code
  • [ ] If it is a core feature, I have added thorough tests
  • [ ] I will try not to use force-push to make the review process easier for reviewers
  • [ ] I have updated the documentation for significant changes

mathbunnyru avatar Oct 23 '24 13:10 mathbunnyru

I don't plan to merge this now, but let's see how many things are broken

mathbunnyru avatar Oct 23 '24 13:10 mathbunnyru

We depend on updating mamba to v2: https://github.com/jupyter/docker-stacks/pull/2147

#15 9.104 error    libmamba Could not solve for environment specs
#15 9.104     The following packages are incompatible
#15 9.104     ├─ mamba <2.0.0 is installable with the potential options

mathbunnyru avatar Oct 23 '24 14:10 mathbunnyru

If you are interested in making Python 3.13 work for these images, please help conda-forge to build missing packages, here is the current progress: https://conda-forge.org/status/migration/?name=python313

mathbunnyru avatar Dec 05 '24 23:12 mathbunnyru

Python 3.13.1 has been released, so we're waiting for the packages to be compatible with 3.13. When tests pass, I will merge this, but I have no idea if it will be soon.

mathbunnyru avatar Dec 08 '24 14:12 mathbunnyru

The upstream PR to build conda for python3.13 in conda-forge has been merged 🎉 https://github.com/conda-forge/conda-feedstock/pull/258

Let's see if everything else builds now (or if something fails)

mathbunnyru avatar Feb 20 '25 17:02 mathbunnyru

Ok, there are 3 upstream issues:

  1. TensorFlow doesn't support Python 3.13: https://github.com/tensorflow/tensorflow/issues/78774 It seems that no one answers when the support will be added, unfortunately.
  2. rpy2: Waiting for https://github.com/conda-forge/rpy2-feedstock/pull/127, but more for https://github.com/conda-forge/rpy2-feedstock/pull/128
  3. ~We install pinned version of pandas for spark-related images. v4.0.0-rc1 tag and GitHub release has been created, but no binaries are available on https://dlcdn.apache.org/spark/. This version already uses last pandas 2.2.3, which already works with python 3.13 in conda-forge. So, we're waiting for new binaries to become available.~

mathbunnyru avatar Feb 20 '25 17:02 mathbunnyru

~spark is almost released, shouldn't be long: https://github.com/jupyter/docker-stacks/pull/2300~

mathbunnyru avatar May 24 '25 22:05 mathbunnyru

  1. rpy2: Waiting for Rebuild for python 3.13 conda-forge/rpy2-feedstock#127, but more for rpy2 v3.5.17 conda-forge/rpy2-feedstock#128

Rebuild for python 3.13 merged. See: https://github.com/conda-forge/rpy2-feedstock/pull/132

flaviomartins avatar Jul 30 '25 17:07 flaviomartins

  1. rpy2: Waiting for Rebuild for python 3.13 conda-forge/rpy2-feedstock#127, but more for rpy2 v3.5.17 conda-forge/rpy2-feedstock#128

Rebuild for python 3.13 merged. See: https://github.com/conda-forge/rpy2-feedstock/pull/132

Thanks @flaviomartins! Awesome work 🔥 I actually wanted to try it out on the weekend, but let me restart it now.

mathbunnyru avatar Jul 30 '25 17:07 mathbunnyru

Thanks @flaviomartins! Awesome work 🔥 I actually wanted to try it out on the weekend, but let me restart it now.

The datascience image failed due to rpy2 requirements resolution. I uploaded a new build which seems to fix this https://github.com/conda-forge/rpy2-feedstock/pull/137.

flaviomartins avatar Jul 30 '25 19:07 flaviomartins

Tensorflow is not yet capable with Python 3.13, but pip ens up downloading another version: Downloading tensorflow_cpu-2.20.0rc0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (4.5 kB)

https://github.com/tensorflow/tensorflow/releases/tag/v2.20.0-rc0

I hope it will be soon released and we will easily merge this

mathbunnyru avatar Jul 31 '25 09:07 mathbunnyru

Tensorflow is not yet capable with Python 3.13, but pip ens up downloading another version: Downloading tensorflow_cpu-2.20.0rc0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (4.5 kB)

https://github.com/tensorflow/tensorflow/releases/tag/v2.20.0-rc0

I hope it will be soon released and we will easily merge this

I was also surprised by the tensorflow images build success. While we are talking about this yesterday they released an RC with wheels for Python 3.13 👍

flaviomartins avatar Jul 31 '25 09:07 flaviomartins

Ok, there are 3 upstream issues:

  1. TensorFlow doesn't support Python 3.13: It doesn't support on python3.13 tensorflow/tensorflow#78774 It seems that no one answers when the support will be added, unfortunately.
  2. rpy2: Waiting for Rebuild for python 3.13 conda-forge/rpy2-feedstock#127, but more for rpy2 v3.5.17 conda-forge/rpy2-feedstock#128
  3. ~We install pinned version of pandas for spark-related images. v4.0.0-rc1 tag and GitHub release has been created, but no binaries are available on https://dlcdn.apache.org/spark/. This version already uses last pandas 2.2.3, which already works with python 3.13 in conda-forge. So, we're waiting for new binaries to become available.~

Hello, I noticed that rpy2 ticket 127 and ticket 128 are both now closed. Are we just waiting for TensorFlow now?

anrayliu avatar Aug 05 '25 20:08 anrayliu

Ok, there are 3 upstream issues:

  1. TensorFlow doesn't support Python 3.13: It doesn't support on python3.13 tensorflow/tensorflow#78774 It seems that no one answers when the support will be added, unfortunately.
  2. rpy2: Waiting for Rebuild for python 3.13 conda-forge/rpy2-feedstock#127, but more for rpy2 v3.5.17 conda-forge/rpy2-feedstock#128
  3. ~We install pinned version of pandas for spark-related images. v4.0.0-rc1 tag and GitHub release has been created, but no binaries are available on https://dlcdn.apache.org/spark/. This version already uses last pandas 2.2.3, which already works with python 3.13 in conda-forge. So, we're waiting for new binaries to become available.~

Hello, I noticed that rpy2 ticket 127 and ticket 128 are both now closed. Are we just waiting for TensorFlow now?

Yes, please see the comments above

mathbunnyru avatar Aug 05 '25 20:08 mathbunnyru

Thanks for the quick reply. As a side note, how often do these Python upgrades happen (one month after each new version, only with major versions, every 2 months, etc)?

anrayliu avatar Aug 06 '25 18:08 anrayliu

Thanks for the quick reply. As a side note, how often do these Python upgrades happen (one month after each new version, only with major versions, every 2 months, etc)?

We update major python version (like this PR does from 3.12 to 3.13) per our policy: https://jupyter-docker-stacks.readthedocs.io/en/latest/maintaining/tasks.html#updating-python-version

Images are rebuilt weekly automatically, so when a new patch release is available on conda-forge, our images will start using it automatically

mathbunnyru avatar Aug 06 '25 19:08 mathbunnyru

TF 2.20 has been released see: https://github.com/tensorflow/tensorflow/releases/tag/v2.20.0

flaviomartins avatar Aug 15 '25 11:08 flaviomartins

TF 2.20 has been released see: tensorflow/tensorflow@v2.20.0 (release)

Awesome, thanks for letting me know, I updated the changelog date and the list of old images. When CI is green I will check release tensorflow is getting installed and will merge this.

mathbunnyru avatar Aug 15 '25 13:08 mathbunnyru