jrnl-org / jrnl

Collect your thoughts and notes without leaving the command line.
https://jrnl.sh
GNU General Public License v3.0
6.36k stars 519 forks source link

Add Python 3.13 support #1893

Open micahellison opened 1 month ago

micahellison commented 1 month ago

Use Case/Motivation

Python 3.13 beta is out, so it's time to start looking into adding support for it.

Target date for Python 3.13 final is October 1 (PEP 719).

Example Usage

n/a

Other Information

Relates to:

musicinmybrain commented 1 month ago

If I change

python = ">=3.10.0, <3.13"

to

python = ">=3.10.0, <3.14"

then, in a Python 3.13.0b1 virtualenv (the pip install cffi is a temporary workaround),

$ poetry install
$ pip install cffi==1.17.0rc1
$ python -m pytest

then I encounter a single test failure on Python 3.13:

=========================================================================================== short test summary info ============================================================================================
FAILED tests/unit/test_export.py::TestYaml::test_export_to_nonexisting_folder - SystemError: error return without exception set
================================================================================== 1 failed, 644 passed, 40 skipped in 1.93s ===================================================================================
micahellison commented 1 month ago

Thanks for running those tests, @musicinmybrain. That's a useful note about cffi -- we'll have to stayed tuned for their eventual Python 3.13 support.

I got the same result after installing that cffi release candidate. Strangely, when I run those unit tests by themselves, they all pass:

$ poetry run pytest
...
FAILED tests/unit/test_export.py::TestYaml::test_export_to_nonexisting_folder - SystemError: error return without exception set
...

$ poetry run pytest tests/unit/test_export.py
============================================================== test session starts ===============================================================
platform linux -- Python 3.13.0b1, pytest-8.0.0, pluggy-1.3.0
rootdir: /home/micah/dev/jrnl
configfile: pyproject.toml
plugins: bdd-7.0.1, clarity-1.0.1, xdist-3.5.0
8 workers [2 items]     
..                                                                                                                                         [100%]
=============================================================== 2 passed in 1.58s ================================================================

Also, I haven't tested on Windows yet, or on Mac through GitHub actions, but we may also have to wait on Python 3.13 compatible wheels of various dependencies if there are installation failures there.