-
-
Notifications
You must be signed in to change notification settings - Fork 31.4k
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
Migrated setuptools configuration to pyproject.toml. #17806
Conversation
From a quick review, it seems fine to me 👍🏻 |
I will check these new instructions during the incoming release (early April). /remind me to test this PR on April 2nd |
@nessita set a reminder for 4/2/2024 |
👋 @nessita, test this PR |
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.
Generally LGTM
Thanks Nick! All suggestions applied. |
Sorry, I messed up at some point. Now it should be better. |
Mmmh, looks like deleting the |
Yeah. I'll have to have a look next week at the details of how auto-discovery behaves. |
I haven't tested this yet because the previous release was the "pair with Sarah" release and I prioritized showing the current flow. /remind me to recheck this work on May 6th |
@nessita set a reminder for 5/6/2024 |
👋 @nessita, recheck this work |
Can we retitle this “Migrated setuptools configuration to pyproject.toml.”? That’s the major change here, using |
I was having a detailed look at this last night and there are some things that need tweaking. Will try to update with something soon. |
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.
Other than the things below I also saw the following warning in the output both before and after:
warning: no previously-included files matching '__pycache__' found anywhere in distribution
It seems that we should be able to remove global-exclude __pycache__
from MANIFEST.in
.
Also, as we now depend on setuptools>=61
and given that setup.py install
has been deprecated since v58.3.0 in October 2021, I think we can consider removing setup.py
in its entirety. (It contains a bunch of workarounds to avoid overlaying an existing install which is no longer really applicable.)
@claudep Did you have any thoughts on these comments? |
Oh sorry, missed it. I just pushed commits with your suggestion. |
Another reason in favour of this is that it is relying on |
@ngnpope Hey there, we have a new release in a week (5.1 beta release), would you have some time to re-review this PR before then to consider merging this work and using it in that release? Thank you. |
@nessita I'm basically happy with this, but am aware that the filename casing is still an issue: $ git clean -fdx
$ python -m build
...
Successfully built django-5.1.dev20240523062023.tar.gz and Django-5.1-py3-none-any.whl As I said before, I don't think we get a choice in the sdist filename. What's more confusing is why the wheel filename is still uppercased as I thought the whole point of PEP 625 was to align the naming to match the wheel filename convention... 🤔 We could, I guess, change the project name to be lowercased: [project]
name = "django" Which would then produce something consistent: $ git clean -fdx
$ python -m build
...
Successfully built django-5.1.dev20240523062023.tar.gz and django-5.1-py3-none-any.whl But this would change the casing of the name on PyPI itself. I don't know if that's a problem, but it sidesteps all of these normalization-related issues by being already normalized. |
It seems that there is a bug and the wheel filename should be lowercased according to this: More reading:
Urgh. What a mess. TL;DR: This is good to go as the filename problem existed before switching to |
Thank you so much @ngnpope for the complete summary. My preference is to pin |
v63.9.0 introduced the changes that affected the filename, so I think the bounds I gave were correct? (It's what worked for me.) |
I'm assuming you meant
So I think we are good to go! |
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.
Thank you everyone, this looks good. I have tested this in a clean environment and I have updated our "ad-hoc" release script. I will push a cleanup for what I think is a missed replace and then I'll merge:
docs/internals/contributing/writing-code/coding-style.txt:49: ``setup.cfg`` file contains...
This branch migrates setuptools configuration from setup.py/setup.cfg to pyproject.toml. In order to ensure that the generated binary files have consistent casing (both the tarball and the wheel), setuptools version is limited to ">=61.0.0,<69.3.0". Configuration for flake8 was moved to a dedicated .flake8 file since it cannot be configured via pyproject.toml. Also, __pycache__ exclusion was removed from MANIFEST and the extras/Makefile was replaced with a simpler build command. Co-authored-by: Nick Pope <nick@nickpope.me.uk>
No description provided.