-
Notifications
You must be signed in to change notification settings - Fork 983
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
Switch to setup.cfg for metadata specification? #378
Comments
I can't think of a good reason why we shouldn't. |
Main reason against it would be that it's a relatively new feature and doesn't fail gracefully if someone has an older setuptools. |
Our guides generally recommend people install the latest versions, or did you mean for people installing the package from sdist? |
Yea, it affects both the author and random people installing the package from sdist. This also affects services like RTD (which just came up in |
Hrm. that makes things a bit more tricky. |
Good point. I guess it depends on the role of the PUG, to an extent. If we're intending to be a discussion of the options available, I strongly believe this should be mentioned (as it's far nicer to use than the Looks like setuptools has had this feature since Dec 2016. If we don't mention it now, when should we start to do so? (If anyone says "when it's the default setuptools in RHEL" I'll scream 😄) If there was a clear timescale (once RTD switch, or once pip 18 comes out with PEP 518 support for requiring a specific version of setuptools, or something) then I'd be OK with waiting. One of the things that prompted me to flag this up is that as far as I know, this feature was introduced with very little publicity - which I'm frustrated about because it's such an improvement in usability (IMO). Functionally it makes little difference, but by emphasising declarative metadata it's a major shift. |
Yes, I think this is very appropriate for something that goes into the guides section.
The "tutorials" are where we get opinionated. I plan to use flit for the new tutorial for packaging items, so this particular discussion is non-applicable. I do think that the guides on setuptools can and should say "do it this way if you can, but you can also do this way if you must".
This is good stuff for a discussion article, but it can also be accommodated in a guide on setuptools.
I look to the rest of the PyPA to figure this out. :) |
I don't want to divert the subject here, but given that we're talking about when it's reasonable to recommend a new feature, is it really consistent to be hesitant about recommending a setuptools feature that's been out for 9 months which can't be used when installing from source with an older setuptools, and yet be willing to recommend flit as the build tool when you can't install from source with that unless you use the as-yet unreleased pip 10 with PEP 517 support? |
I don't think we should recommend flit until pip has PEP 517 support, and even then I'm not sure what level of uptake makes sense. There are some differences of course, flit restricts itself to stuff that can ship universal wheels, so for most people |
There's also some questions we'd have to consider in terms of our overall position on project layout. Flit is taking the view that it supports a single "best practice" approach to project layout, so we'd need to be sure the guide is consistent with that - specifically flit doesn't currently support the layout of having code in a |
(summing @ncoghlan for his take as well) As part of the new tutorials we wanted to experiment with using some newer, more opinionated tools as the first ones that users interact with. The idea is that while they aren't perfect for every use case, they are simple and present less friction. For example, we've gotten good feedback on the new installing packages tutorial that uses pipenv instead of pip & virtualenv. None of this is to say that we want to not document the other tools - for example, I won't replace the current installing packages tutorial with the pipenv one until I'm certain that the pip & virtualenv instructions have a new home under That said, flit still may or may not be as ready as pipenv is to be that entrypoint. Perhaps this feature of setuptools is a viable alternative for having a simple introduction. I'm personally open to writing both and seeing what everyone thinks - but if y'all feel strongly right now that flit isn't the right choice I'll focus on a simplified and opinionated tutorial using setuptools. |
(Tangent: for RHEL, my own guidance is already:
/tangent) As far as publishing guidance goes, I think we need to split that into two distinct categories:
I see this distinction as the packaging equivalent of getting newcomers to Python to start with Python 3.6, and then only later giving them the bad news about all the features they're going to have to stop using if they want to make their libraries support older Python versions. On the topic of |
Thanks @ncoghlan - your comments on publishing advice basically match my position, just explained better ;-) I guess the remaining question for me is whether the "basic publishing" guide should recommend setuptools-with-static-metadata or flit. Longer term, I'm sure that flit will be a better choice, but right now I'm concerned that it might be a bit too bleeding edge for beginners. And setuptools-with-static-metadata gives pretty much the same basic experience (put your data into a config file) while running with our recommended toolset (pip, twine, OK, we don't have a standardised "build a sdist" tool, sorry) and other community standards (tox, for example). Regarding |
Catching up on the full thread: I do think it makes sense to coordinate with the ReadTheDocs folks, and make sure that any advice we're giving will work in their default docs build environments (I'd missed that concern when writing my initial reply). Regarding whether it makes sense to recommend
So we'd probably end up making the initial guidance more complicated, since it would need to explain what can go in The reason I think |
OK, those arguments seem convincing to me. For my personal use, I'll probably switch to declarative |
One thought - when we do switch our recommendations to flit, we should probably also switch pypa/sampleproject to use flit, too... |
Aye, agreed. We'll probably still want to keep an sample For now though, I'm going to close this issue as "No, we'll stick with the focus on |
The downside of recommending that, of course, is that if you later want those things, you have to switch your packaging tools to use them - it's harder to start simple and add complexity later. One thing I'm considering is allowing a configurable build step, something like the rust build script you can specify for cargo. But I don't know much about compilation, so input from other people is welcome, whether you think it's something flit should deal with or not. Here's the discussion: pypa/flit#119 |
See pypa/sampleproject#56 - should we be recommending that new projects put their metadata in
setup.cfg
rather than insetup.py
?The text was updated successfully, but these errors were encountered: