requests icon indicating copy to clipboard operation
requests copied to clipboard

Migrate build system to hatchling

Open nateprewitt opened this issue 4 months ago • 4 comments

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.

nateprewitt avatar Aug 17 '25 16:08 nateprewitt

The migration to pyproject.toml in urllib3 was surprisingly easy! We no longer have a setup.py file, and had zero complaints about that.

pquentin avatar Aug 17 '25 16:08 pquentin

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

sigmavirus24 avatar Aug 17 '25 20:08 sigmavirus24

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

sigmavirus24 avatar Aug 17 '25 20:08 sigmavirus24

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.)

pquentin avatar Aug 18 '25 05:08 pquentin