-
Notifications
You must be signed in to change notification settings - Fork 67
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
Prevent warn on false positive for author/maintainer's email #116
Conversation
While I was working to support pyproject.toml metadata in setuptools, I received as a feedback from the community[^1] that setuptools warns the following message when `author_email` and `maintainer_email` are given in the form of `Person Name <email@address>`: > warning: check: missing meta-data: either (author and author_email) > or (maintainer and maintainer_email) should be supplied This can be seen as a false positive, because indeed both author's name and email are provided. This warning seems to happen because distutils define the `check` command as a subcommand for `sdist`. This change aims to remove this false positive result from the checks. [^1]: https://discuss.python.org/t/help-testing-experimental-features-in-setuptools/13821/18
The error in the CI seems to be unrelated to the change: Maybe this error is also related to GitHub's update to Refs: |
I'm slightly reluctant to support two different inputs to mean the same thing. My preference would be to either:
(i.e. "preferably one obvious way to do it"). Actually, if I had my druthers, it would be modeled as a "contact", so So maybe this issue can be ignored for setup.cfg/setup.py declarations and when pep 621 support is added, it solves this issue by making name/email explicit and obviating the composite form. Perhaps the current "false positive" behavior can be treated instead like a warning that composite values shouldn't be used, and instead, the behavior should be changed to discourage use of composite values. Also happy to accept as-is. WDYT? |
Hi @jaraco, thank you very much for the feedback. I agree with you that it would be better to have one obvious way of doing it. (Here the core metadata spec seems to be the culprit). Since PEP 621 explicitly require the I am more than happy to change the PR to reflect this idea. Please just give me the "go ahead" and I will proceed 😄 (However I have the impression that most of the people today use 2 separated fields) Footnotes
|
As I think about it more, I'm disinclined to add sophistication to the I looked into the reported issue, but there I see the user is supplying name and email separately. I don't see how this leads to warnings with Setuptools. The user is supplying separate name/email, setuptools expects separate name/email, and the output format expects separate name/email. What's the motivation for encoding the name into the email? |
Hi @jaraco thank you very much for having a look at this. I agree with most of the things you stated in your previous comment. What's the motivation for encoding the name into the email?PEP 621, is very specific about how Core Metadata should be written:
In summary, PEP 621 standardises the following translations:
Since the Do you have any other suggestion on how to tackle this? I don't think the changes proposed in this PR are required, I just wonder if there is another way of to not confuse the users with the warning... |
That's horrible. It requires a consumer of the PKG-INFO to have sophisticated logic to parse out the name and email of an author or authors. I guess it's a problem too of the core metadata spec. What you've done here seems like the best thing to be done give the convoluted specs. |
Thank you very much Jason. |
Motivation
While I was working to support pyproject.toml metadata in setuptools, I received as a feedback from the community1 that indicates that setuptools warns the message bellow when
author_email
ormaintainer_email
are given in the form ofPerson Name <email@address>
(andauthor
oremail
are omitted):This can be seen as a false positive, because indeed both author's name and email are being provided.
This change aims to remove this false positive result from the checks.
Notes
Please let me know if you don't think this change is suitable to this repository, and I can try to address the problem directly on the setuptools layer.
My idea on submitting it here is that it avoids the complexity of adding patches or overwriting commands in setuptools. If the users decide to use the stdlib's version of
distutils
, the only impact will be seeing the warning, but no feature will be compromised.Footnotes
https://discuss.python.org/t/help-testing-experimental-features-in-setuptools/13821/18 ↩