sopel-irc / sopel

:robot::speech_balloon: An easy-to-use and highly extensible IRC Bot framework. Formerly Willie.
https://sopel.chat
Other
948 stars 402 forks source link

ci, contrib, dice, meta: enable testing on Python 3.13 + fix warnings #2628

Closed dgw closed 1 month ago

dgw commented 1 month ago

Description

With the above changes, the only warning emitted during pytest runs under Python 3.13 is from SQLAlchemy, which isn't new; it's because we haven't fully migrated to their 2.0 style yet, and not related to which Python version is used.

The type-check error from dnspython 2.7 isn't strictly Python 3.13-related, but this patch wouldn't pass linting without it. That change doesn't seem like it needs its own PR (though it might need to be backported for 8.0.1; we'll see).

Closes #2608.

Checklist

SnoopJ commented 1 month ago

If we wanted to add 3.13 free-threading support, it looks like there's a feature request for this in GHA: https://github.com/actions/setup-python/issues/771

(I didn't yet test Sopel on a free-threaded build FWIW, but I can try it)

dgw commented 1 month ago

(I didn't yet test Sopel on a free-threaded build FWIW, but I can try it)

I just finished a passing run on Python 3.13.0t (setting PYTHON_GIL=0 before running make test; an sqlalchemy submodule will trigger the GIL if you don't force-disable it, at the moment).

Passing the test suite doesn't necessarily guarantee perfect functionality at runtime, though, to be fair.

SnoopJ commented 1 month ago

I also see passing tests in both modes, although weirdly I did not see a faster suite with nogil

dgw commented 1 month ago

I don't think it's that weird. Without installing a plugin like pytest-parallel or pytest-xdist, tests are run serially.

The better thing to think about a bit here is: Should we wait for a nogil build to be available in GHA? Is it worth running a second CI job for Python 3.13t when that feature is still experimental?

Because if we aren't going to wait, this can just ship to master so it's ready to keep going.

SnoopJ commented 1 month ago

Should we wait for a nogil build to be available in GHA? Is it worth running a second CI job for Python 3.13t when that feature is still experimental?

-1 on both of those IMO, I think our manual checks are sufficient that there's nothing fundamentally wrong

dgw commented 1 month ago

And it's easy enough to run through another PR like this later if we find a compelling reason to add nogil to the CI matrix, too. Just wanted to ask in case you had a different idea :)

dgw commented 1 month ago

Note: Adding the url changes to my backports/8.0.1 branch. When the time comes to ship those updates, CI will likely fail on the 8.0.x branch unless type-check fixes are included.