Migrate build system to hatchling
This PR follows up on the original announcement of migrating Requests to be PEP517 compliant backend in 2.33.0. This PR proposes moving to hatchling which has wide adoption, but there's an argument for staying on setuptools. I'd be curious to hear from other maintainers on if there's a strong preference in either direction based on other projects.
@pquentin or @sethmlarson may have input from migrating urllib3 as well. Presumably users with urllib3 2.x are already capable of building with this setup in their environment.
The migration to pyproject.toml in urllib3 was surprisingly easy! We no longer have a setup.py file, and had zero complaints about that.
I'm all for removing setup.py. my worry with hatchling is the bus factor. With setuptools we're at the whim of missing a deprecation warning that no one could reasonably see locally and being broken randomly
I'm all for removing setup.py. my worry with hatchling is the bus factor. With setuptools we're at the whim of missing a deprecation warning that no one could reasonably see locally and being broken randomly. I don't know that the other backends are as widely used or have support for the variety of standards we likely don't need
The beauty of pyproject.toml is that using a different backend is quite easy. setuptools supports dynamic versions too, so there's nothing in this PR that setuptools cannot do. If we were migrating urllib3 to setuptools today, we would probably have stuck to setuptools.
(setuptools and hatch builds sdists/wheels differently, so I would check that you have everything you want in those files compared to the existing.)