Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 2 commits into from
Oct 11, 2024

Conversation

dgw
Copy link
Member

@dgw dgw commented Oct 10, 2024

Description

  • ci: Added Python 3.13 to CI workflow
  • contrib: Added Python 3.13 envs to tox config
  • dice: removed unnecessary count parameter to re.sub() and pass flags as a kwarg
    (py3.13 deprecates these as positional args)
  • url: fix type-check error with dnspython 2.7
    Use Rdata.to_text() to get each result as a string, which is one of the types that ipaddress.ip_address() accepts.
  • meta: add Python 3.13 classifier for PyPI releases of 8.1+

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

  • I have read CONTRIBUTING.md
  • I can and do license this contribution under the EFLv2
  • No issues are reported by make qa (runs make lint and make test)
  • I have tested the functionality of the things this change touches
    • Shockingly, I even ran the whole tox job on every version listed, after updating them all to the latest patch release available in pyenv. Maybe not necessary, but I was making sure the tox config still worked after I edited it.

- ci: Added Python 3.13 to CI workflow
- contrib: Added Python 3.13 envs to tox config
- dice: removed unnecessary `count` parameter to `re.sub()` and pass
  `flags` as a kwarg (py3.13 deprecates these as positional args)
- url: fix type-check error with `dnspython` 2.7
  Get string representation of each result with `Rdata.to_text()`, which
  is one of the types that `ipaddress.ip_address()` accepts.
@dgw dgw added Build Housekeeping Code cleanup, removal of deprecated stuff, etc. labels Oct 10, 2024
@dgw dgw added this to the 8.1.0 milestone Oct 10, 2024
@dgw dgw requested a review from a team October 10, 2024 21:46
Copy link
Contributor

@SnoopJ SnoopJ left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's do it!

@SnoopJ
Copy link
Contributor

SnoopJ commented Oct 10, 2024

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

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

@dgw
Copy link
Member Author

dgw commented Oct 10, 2024

(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
Copy link
Contributor

SnoopJ commented Oct 10, 2024

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

@dgw
Copy link
Member Author

dgw commented Oct 10, 2024

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
Copy link
Contributor

SnoopJ commented Oct 11, 2024

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
Copy link
Member Author

dgw commented Oct 11, 2024

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 dgw merged commit dcb9eec into master Oct 11, 2024
17 checks passed
@dgw dgw deleted the python-3.13 branch October 11, 2024 22:12
@dgw
Copy link
Member Author

dgw commented Oct 13, 2024

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.

dgw added a commit that referenced this pull request Oct 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Build Housekeeping Code cleanup, removal of deprecated stuff, etc.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Python 3.13 support
3 participants