-
Notifications
You must be signed in to change notification settings - Fork 21
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
Modernize pyroma #72
Modernize pyroma #72
Conversation
Also make the generated code in classifiers.py friendly to black
2c39919
to
be2fa95
Compare
Unless there's a strong reason otherwise, I'd suggest instead of spending more time maintaining the classifier fetch code, fetching fresh classifiers each release, and leaving users stuck with the vendored classifiers until Pyroma updates to a new version, just using the drop-in compatible Line 21 in 9089b88
I'm happy to help with that, if you'd like. Also, as to the license identifier mapping, it appears to use the rather arbitrary bespoke scheme (with internally inconsistent use of hyphens and other punctuation) used by in the legacy Trove license classifiers, rather than a well-defined, understood and used standard like SPDX (which it superficially resembles). Given most projects I'm aware of that bother to use the To note for the future, part of PEP 639 will officially deprecate the legacy license classifiers due to their many problems as discussed on the aforementioned thread, which are ambiguous, limited and out of date, in favor of proper SPDX identifiers in the new |
Also, just to note, I'm not sure if it was intended, but without the critical [build-system]
requires = ["setuptools>=42"]
build-backend = "setuptools.build_meta" Pyroma is still using legacy, non-PEP 517 builds by default, with direct |
The lack of build_meta builder is intentional, as a part of the one step at a time process. I don't want to break everything at once. That's also why I didn't even get to the bit about Same thing about the version. I do have a vague feeling I tried to use that check before and it didn't work for some reason, but if that is the case it's when the package was all new. I don't think I will be finished with all this this weekend, but I hope a beta could be out in a few weeks. |
Turns out zest.releaser doesn't like a non-setup.py package yet, so I'll skip adding the build-backend bit to Pyromas packaging, because that would be a lie. :-D |
I'm a little confused—did the build somehow break when you migrated off the deprecated legacy backend to the modern PEP 517 one? Since your setup and configuration is now purely declarative, the only plausible way I'm aware of that could this would happen is an edge-case bug in Setuptools, which given its PEP 517 support has had several years to fully stabilize, and your
I can totally understand not getting to it, but what confused me was why this PR went to the effort of updating the current bespoke code doing that, rather than either leaving it be or tweaking the ~two lines needed to use the canonical set of classifiers.
I'm a little confused what you're referring to here, sorry—would you mind clarifying?
I don't follow, sorry, I leave a stub Its possible that there could be some other issue with |
zest.releaser currently gets the version number in several different ways, one being actually executing the setup.py. It turns out that it will not read it directly from setup.cfg, at least not by default. I looked at the code, and there seems to be a configuration workaround, I might try that. |
Nah, didn't work. I looked into fixing it in zest.releaser, but there is no trivial way. I think zest.releaser should probably start using |
Gotcha. Again, though, doesn't it work right now if you don't drop the stub setup.py for legacy compat (which most modern PEP 517-supporting projects using Setuptools keep around for now)? If |
packages = find: | ||
package_dir = | ||
= . | ||
test_suite = pyroma.tests |
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.
(Sorry, thought I submitted this comment a long time ago)
Just FYI, this (and the test
command it supports) has been deprecated for a number of years (pypa/setuptools#1684) and is planned to be removed (pypa/setuptools#931), so it should be removed here too.
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, right, forgot about that. I was thinking about actually adding a Pyroma warning for that as well.
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.
Good point, though to note, unlike almost all the other things you current check that are standardized package metadata, that's part of the build backend's options rather than the package metadata, specific to one particular build backend and requires reading said backend's bespoke configuration (in one of several places, not all of which are statically introspectable), so you'll want to consider whether it is in scope for Pyroma and worth the effort to implement and maintain, considering unlike Pyroma's other, more abstract and "opinionated" feedback that form the core of its unique value, those warnings/removals are already handled by the backend in question.
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.
True that. It'll only be there for one version though, once PEP621 is fully implemented and mature I'll just go "You should move to pyproject.toml" or something.
Right, I can put in the block in pyproject.toml, but it wouldn't make a difference. I guess I could add it and as build-backend just say "zest.releaser.fullrelease:main" but I have no idea what other tools would make of that. Edit: Lol, no, that breaks |
I'm a little confused—what makes you think that, sorry? Any modern Python build frontend (whether
That could theoretically work if However, that is almost certainly not what you want. Based on reading their docs, Setuptools is your build backend, and thus is what should be specified in the Therefore, you should specify the PEP 518
|
[options.extras_require] | ||
test = | ||
pytest | ||
pytest-cov |
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.
Hey @regebro , was this added by mistake? As far as I can tell, Pyroma doesn't actually require Pytest; it doesn't use it in its tests, and the CIs run the tests just fine with vanilla unittest.
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.
That sounds like a cut and paste error on my part, yes.
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, fixed in PR #92
No description provided.