Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Update package metadata #817
Update package metadata #817
Changes from 2 commits
fd2e450
f316fd8
983b7f1
66241ba
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
This file was deleted.
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.
One feature gap compared to setuptools and
setup.cfg
I see here is that this file is now manually maintained and formatted while usingsetuptools
one can use the excellentsetup-cfg-fmt
project for it. Does hatch have plans to add formatting support? Without it I'm tempted to keep using setuptools 🤔 Naturally if other maintainers even with that feature gap like hatch I'm not going to oppose 👍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 suppose I could add a command for that but:
tomlkit
is extremely buggy.Are you saying that until there is a
pyproject.toml
linter you're not keen on using PEP 621?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.
Indeed 😊 I am loosing some functionality otherwise that I do have with the current framework, and the benefits of switching to PEP-621 in the short term are not that much compared to
setup.cfg
.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.
Setup-cfg-fmt does a lot more than just formatting, it also keeps up the classifiers for new Python versions and cleans them up, sorts dependencies, etc. It also runs in pre-commit, can taplo?
It also strips comments, valid empty (sub) sections, and can’t be disabled for part of a file AFAIK…
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.
👍
An eventual tool should not be tied to a build backend, but be a generic tool; probably a pair of tools like taplo & (imaginary atm) pep621-fmt or something. Fmt is a little off since it would be more of a validator. Happy to have it live alongside hatch though. ;)
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.
There are some very good reasons to put comments in sometimes, like https://github.com/scikit-hep/awkward-1.0/blob/6d3c1d23d7ab492d0178b1798e179088a066e00a/pyproject.toml#L90-L157 - probably rare for the project metadata itself, but the other tool fields might need comments (flake8/pylint config being big ones for needed comments). Comments can be overdone, sure, but sometimes they are needed. setup-cfg-fmt doesn't support them for technical reasons, not primarily because they are a bad idea. I usually have managed without comments in setup.cfg, though, sometimes painfully with flake8, but really hope not to leak that issue over into pyproject.toml. :)
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.
tomlkit
has received a lot of improvements over the last 6 months. I personally have contributed several patches and @frostming has become a maintainer and has been doing an amazing job!As an example of its potential, I can safely use it in ini2toml for translating the "AST" of
.ini
files to.toml
, which includes preserving comments.So if its being a while that you last checked
tomlkit
, maybe it is a good time to have a look if it improved for your use cases?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.
For what's worth I've been using
tomlkit
for https://github.com/gaborbernat/pyproject-fmt and works well for me 👍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.
Run into this due to the ping, and I found @gaborbernat already made a pyproject.toml formatter, powered by
tomlkit
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 tried to use toolkit in cibuildwheel (at least 6 months ago, probably more), and found it too buggy to use; it was a rather weird format, but it was important to keep it, which it failed to do. I ended up just writing a manual writer, since it was a very well structured limited file. Great to hear it is seeing improvements! I know it was not 1.0.0 compliant either last I checked, but is now. :)
And @gaborbernat, @abravalheri, and @ofek have all made TOML formatter/validators. :)
pypyroject-fmt
,pyproject-validate
, andvalidate-pyproject
.This file was deleted.
This file was deleted.