-
-
Notifications
You must be signed in to change notification settings - Fork 474
Migrate setuptools configuration to pyproject.toml + PEP621 #1570
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
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's please separate comma and setup.py
changes
Yes, unfortunately it seems pre-commit.ci wanted to make the changes. |
9699a4e
to
840ac67
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! Looks great!
"Framework :: Django :: 4.2", | ||
] | ||
requires-python = ">=3.8" | ||
maintainers = [{ name = "Marti Raudsepp", email = "marti@juffo.org" }] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, we can now add all team as maintainers :)
Will do later.
You can create a PR with |
b461653
to
2af0529
Compare
Seems like mypy has trouble detecting the source/stubs with this new way of declaring the project. I've tried a few things with no luck, any insights are appreciated :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking into it
I have no idea what is going on :) |
I'm puzzled as well! I'll probably try to use another build-backend like hatchling, we never know. |
|
Ugh, that can be a bit problematic. Black for example only looks for the closest |
Co-authored-by: Adam Johnson <me@adamj.eu>
912f5e2
to
dbcb64a
Compare
This may be related to the changes regarding editable installs in recent setuptools. We've since added |
@@ -31,15 +31,16 @@ known-first-party = ["django_stubs_ext", "mypy_django_plugin"] | |||
split-on-trailing-comma = false | |||
|
|||
[build-system] | |||
requires = ["setuptools"] | |||
build-backend = "setuptools.build_meta" | |||
requires = ["hatchling"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No idea what hatchling
is.
If other maintainers also don't know what this is, I prefer not to rely on it :(
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll test again with setuptools then :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've used hatchling
for other projects, a totally fair build system that does its job. It also comes with a sort of ecosystem for package management called hatch
, which is completely optional and I've only used the build system named hatchling
.
One thing I did like about it was that it validates the project
section in your pyproject.toml
, which was quite nice. I found that the documentation for hatchling
was quite simple to pick up on too, here: https://hatch.pypa.io/latest/config/build/
It's maintained by https://github.com/pypa/ and e.g. https://github.com/pypa/virtualenv/ is packaged with hatchling
: https://github.com/pypa/virtualenv/blob/9eac8a6b85c047e2287c95bdb9caf6f0fbf35041/pyproject.toml#L1-L6
It's nice to extend hatchling
with hatchling-vcs
to get versioning via version control(git
). Should be similar to setuptools-vcs
. Which is 1 less thing to remember/do when crafting a release.
I'm +1 on using hatchling
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here are their own reasons why to use hatchling
as build backend instead of setuptools:
Is it possible to revive this PR? Would be nice if we could upgrade to a |
I have made things!
This PR is an experiment to migrate from setuptools
setup.py
configuration to the more declarativepyproject.toml
format, following PEP 621.It allows to remove custom discovery functions in
setup.py
, that are also apparently not needed, and moving topyproject.toml
may also enable the project (or its contributors) to use PEP621 compliant project managers like PDM or hatch.Changes to the wheels dist_info
I did not find any differences in included files or modules, but only changes to the metadata:
to
home_page
from metadataRegarding urls/homepage, it may not be issues, see this discussion on setuptools project.
I'm willing to investigate/see upstream if you consider it might be important :)
Related issues