Apply PEP-621
This was brought on https://github.com/encode/starlette/pull/1359.
setuptools released 0.61.0 yesterday, and brought to light the PEP-621 which makes this PR possible. Most of the PR was inspired on this page: https://setuptools.pypa.io/en/latest/userguide/pyproject_config.html
Notes:
- ~I'll continue later on. I need to check if everything is included on the metadata files.~
How to test?
-
./scripts/buildto see that wheel andtar.gzare generated -
python -m pip install -e .for editable installs
Oh... setuptools doesn't support Python 3.6 anymore.
Discussion on dropping 3.6 support https://github.com/encode/httpx/discussions/2136
What do we think about this bit at the top of the setuptools docs page…?
Note New in 61.0.0 (experimental)
Warning Support for declaring project metadata or configuring setuptools via pyproject.toml files is still experimental and might change (or be removed) in future releases.
Presumably the idea if we go with this, we'd switch all Encode projects over as well eventually. Is now a good time? Also, what does this get us compared to the current setup.py configuration?
Is now a good time?
Maybe not. Let's wait for others to test this first 😅 👍
Also, what does this get us compared to the current setup.py configuration?
One less file (setup.py), and compliance with the mentioned PEP.
For another point of comparison, I played with pyproject.toml-based packaging as well and here's what I came up with: https://github.com/florimondmanca/asgi-htmx/blob/master/pyproject.toml
Thanks for the review @florimondmanca 🙇
I've updated the PR, sync with the changes that happened on setup.py, and I've added the setup.py back.
It adds correctly the py.typed.
I've added the content-type on the readme and bumped twine, as I was having a warning.
Let's wait for @tomchristie 's opinion here?
- Close this in favor of #2334