# How to run tests on Python 3.13?

**URL:** <https://travis-ci.community/t/how-to-run-tests-on-python-3-13/14090>\
**Category:** Python\
**Created:** [November 20, 2023, 11:05pm UTC](https://travis-ci.community/t/how-to-run-tests-on-python-3-13/14090 "2023-11-20T23:05:27Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Densaugeo](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/densaugeo/32/8999_2.png) [@Densaugeo](https://travis-ci.community/u/Densaugeo)\
**Post date:** [November 20, 2023, 11:05pm UTC](https://travis-ci.community/t/how-to-run-tests-on-python-3-13/14090/1 "2023-11-20T23:05:27Z")

</div>

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:

```auto
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.

---

<div class="post-metadata">

**Author:** ![Montana](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/montana/32/9566_2.png) [@Montana](https://travis-ci.community/u/Montana)\
**Post date:** [November 21, 2023, 6:36pm UTC](https://travis-ci.community/t/how-to-run-tests-on-python-3-13/14090/2 "2023-11-21T18:36:14Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Densaugeo](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/densaugeo/32/8999_2.png) [@Densaugeo](https://travis-ci.community/u/Densaugeo)\
**Post date:** [November 21, 2023, 8:26pm UTC](https://travis-ci.community/t/how-to-run-tests-on-python-3-13/14090/3 "2023-11-21T20:26:27Z")

</div>

Thanks, please do.

---

<div class="post-metadata">

**Author:** ![sigma67](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/sigma67/32/9257_2.png) [@sigma67](https://travis-ci.community/u/sigma67)\
**Post date:** [June 13, 2024, 7:32pm UTC](https://travis-ci.community/t/how-to-run-tests-on-python-3-13/14090/4 "2024-06-13T19:32:48Z")

</div>

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

> **[Travis CI](https://app.travis-ci.com/github/datafolklabs/cement/jobs/622919062)**
>
> Travis CI enables your team to test and ship your apps with confidence. Easily sync your projects with Travis CI and you'll be testing your code in minutes.

---

<div class="post-metadata">

**Author:** ![Densaugeo](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/densaugeo/32/8999_2.png) [@Densaugeo](https://travis-ci.community/u/Densaugeo)\
**Post date:** [June 13, 2024, 11:40pm UTC](https://travis-ci.community/t/how-to-run-tests-on-python-3-13/14090/5 "2024-06-13T23:40:58Z")

</div>

It’s been working for me for a while (see [Travis CI](https://app.travis-ci.com/github/Densaugeo/uploadserver/builds) 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.

---

<div class="post-metadata">

**Author:** ![Montana](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/montana/32/9566_2.png) [@Montana](https://travis-ci.community/u/Montana)\
**Post date:** [June 14, 2024, 3:32pm UTC](https://travis-ci.community/t/how-to-run-tests-on-python-3-13/14090/6 "2024-06-14T15:32:13Z")

</div>

Hi @sigma67,

You can already do this. Please see my test build: [Travis CI](https://app.travis-ci.com/github/Montana/python313-travis-test/jobs/622957713/config)

Also I’d suggest take a look at this: [Building a Python Project - Travis CI](https://docs.travis-ci.com/user/languages/python/#python-versions)

---

<div class="post-metadata">

**Author:** ![sigma67](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/sigma67/32/9257_2.png) [@sigma67](https://travis-ci.community/u/sigma67)\
**Post date:** [June 19, 2024, 7:56am UTC](https://travis-ci.community/t/how-to-run-tests-on-python-3-13/14090/7 "2024-06-19T07:56:07Z")

</div>

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.
