How to run tests on Python 3.13?

I have a couple projects that I have been testing against Python 3.12 for a while, and I’m adding testing for Python 3.13 now that 3.12 is out and 3.13 is the next upcoming release. However, I haven’t been able to find anything about how to use 3.13 on Travis.

I’ve been using this .travis.yml file for a few months:

dist: jammy # Ubuntu 22.04
language: python
python:
  - "3.10"
  - "3.11"
  - "3.12-dev"
install:
  - python -m pip install pytest requests watchdog
script:
  - make test-travis

However, when I add “3.13” or “3.13-dev”, neither of those is found.

I’ve also tried e-mailing the support e-mail a few days ago, but got no reply. There’s a “live chat” option under “contact” on the Travis landing page, but it’s not a link and doesn’t seem to do anything. Travis support has been responsive in the past, so now I’m wondering what’s going on over there.

Hi @Densaugeo,

Python 3.13 support hasn’t been added yet. It will be added soon. I’ll update this post as soon as it has.

Thanks, please do.

Any update? I just tried it and getting errors with pdm:

It’s been working for me for a while (see Travis CI for a working example).

The logs in your link show Python 3.13 was installed. Maybe there was an issue with installing pdm? I’m not familiar with pdm.

Hi @sigma67,

You can already do this. Please see my test build: Travis CI

Also I’d suggest take a look at this: Building a Python Project - Travis CI

Hi @Densaugeo @Montana thanks for your replies. As you correctly noted, Python 3.13 does work and is installed. However, the version is somewhat outdated, as the most current release is beta 2.

It also seems the version identifier is corrupt. As you can see in my job log linked above, the + in the version is causing issues with our build tool PDM. PDM installs fine, but creating the virtualenv (using pdm venv create) results in this error:

[InvalidVersion]: Invalid version: ‘3.13.0a3+’

Latest 3.13 yields this identifier on my local Ubuntu 22:

Python 3.13.0b2

So I assume that should work fine also on Travis.