Move from setup.py to uv+pyproject.toml
Description
I ran this by @nicknisi, but this is an upgrade to the plumbing behind our package building a testing to use UV instead of setup.py.
"Why?" I hear you asking; ultimately a few reasons.
- Speed of development: UV is fast as hell and can manage/install its own versions of python, which means testing against multiple versions of Python is easier / more straightforward (I will open some future PRs to make this a single command, in fact)
- Keeping up with Python conventions: There are still a lot of tutorials and old recommendations laying around that call for a
setup.pyfile and direct invocation, but all direct invocations ofsetup.pyhave been essentially deprecated for years, and since PEP 518/621 landed, it's preferred to move away from the file entirely towards non-code files (namely,pyproject.toml). - Reproducibility: Moving to a
src/layout (i.e. the python package is in thesrcdirectory instead of therootdirectory) and managing its installation withuvalso means we avoid some common and easy to hit bugs when it comes to catching import problems etc.
There are other reasons I could probably elucidate, but I genuinely think this is a fairly uncontroversial change since a lot of the Python community is running to use UV as it stands.
Importantly, this does not change user workflows at all, with the minor exception of affecting those who were executing python setup.py install directly previously (I'm unclear if there's a way to know that up front. We can bump the version and communicate this as a breaking change if so).
Documentation
Does this require changes to the WorkOS Docs? E.g. the API Reference or code snippets need updates.
[ ] Yes
If yes, link a related docs PR and add a docs maintainer as a reviewer. Their approval is required.
Skipped: This PR changes more files than the configured file change limit: (150 files found, 100 file limit)
Just realized I need to update the release workflow as well. Don't merge before I do that (should only take a moment or two)
The release workflow has been updated now, and according to the UV docs the way we should go about authentication for publishing a package is to configure this release action as a trusted publisher on PyPI.
I can only make part of that process happen, namely, I can follow the guide for creating the release workflow, including the recommended environment (which I did in ffcc2a3). The rest will, I'm sure, need to be discussed or acted on by someone else (@nicknisi maybe?).