-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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? #56
Comments
It happened in v30.3.0. I was cautious to announce it because it's the kind of feature that everyone would want to adopt, but would not be available until most deployments had a late version of setuptools available. As we're 9 months in now, perhaps it's widespread enough to recommend it in a project such as this one. I personally haven't used it, so I'd like to hear from others who have before recommending it. |
OK, cool. Over on the PUG issue, @dstufft mentioned possible problems with RTD (I don't know the details). And it will of course cause issues for people building from source with older versions of setuptools - that's always going to be a problem with new setuptools features, but I have no feel for upgrade rates. |
See the discussion in pypa/packaging.python.org#378 - basically I've been persuaded that using |
Has the wisdom arrived at in these threads changed over the last two years? Do we have any idea what the prevelance of versions >= 30.3.0 might be? I'm very keen to drop any reference to It also looks like pip is capable of parsing Here's the pattern that I've arrived at: https://github.com/pimoroni/boilerplate-python/blob/master/library/setup.py |
@Gadgetoid You can do this in your own project without issues. The constraints on an "official recommendation" like the PyPA sample project are significantly different than those that apply to individual user projects. Having said that, I think this could probably do with being revisited for sampleproject. 2 years is plenty of time for the relevant setuptools features to become mainstream. |
@pfmoore thank you. I'm keenly aware that "just because I can, doesn't mean I should" and want to at least make somewhat informed decisions (since I'm shipping dozens of libraries and perhaps indirectly influencing how beginners might approach writing their own), so your feedback is appreciated. |
In general, sampleproject is looking to make recommendations when they are
So that a beginner can copy-paste what's here, edit specifics to their project, and be practically 100% sure it will work. Since there are many warts and alternatives in different parts of the packaging ecosystem, we tend to want to stray away from parts where we might recommend X but then Y becomes the better things N months in the future. Play it safe. One small issue I've always had with setup.cfg I've always had is that originally it was not intended to be a distributed-with-the-package file at all, but a file you could add into to a source distribution you'd downloaded to customise how it built1 (e.g on a per-system basis - look for libraries here on my particular computer). Then IIRC pbr decided it could take over that functionality to be used as a packaging description file (contradicting the above functionality) without any consultation. And then it's been dragged in that direction ever since, but without ever bothering to definitely resolve this issue. Small note from the pyproject.toml PEP discussing it as well |
Ironically, now that PEP 517 is available, using setuptools at all is no longer as uncontroversial as it once was - for simple projects IMO the strongest argument for not switching sampleproject to use |
Given PEP 621, we might want to skip |
This comment has been minimized.
This comment has been minimized.
Reviving this, since the packaging tutorial (which references this repo) now recommends
Looks like that's not supported in setuptools (yet): pypa/setuptools#2671
@jonathan-s I don't think the |
I know it's been more than a year, but I think my previous comment still stands: if we're going to standardize around PEP 621 (and we should) then let's not introduce extra churn here by changing the recommendation twice. |
Generally I'm +1 on that, but setuptools apparently has resource issues which mean it might be some time before they have PEP 621 support, and recommending an approach that's at least declarative in the interim would be an improvement. (The alternative is to switch to flit as the recommended "beginner" approach, although the way it uses VCS metadata might be astumbling block for new users). |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Fast forward to 2022, setuptools 61.0.0 actually has experimental support for project metadata in |
The packaging tutorial authors are currently debating how to incorporate PEP 621 in the docs. It's possible that rather than simply using setuptools with As the main purpose of this project is to be an example of what the packaging guide recommends, we should wait for their decision and follow that. |
See also #166, which is a draft PR implementing this repo's move to |
Looking at the setuptools documentation, it seems that it's now possible to put project's metadata in
setup.cfg
(see http://setuptools.readthedocs.io/en/latest/setuptools.html#configuring-setup-using-setup-cfg-files). I don't know when this was introduced, but would it make sense to switch to this approach as the recommended method?@jaraco Any comments? I don't know when this ability was introduced to setuptools, but it looks really easy to use, and (as far as I'm aware) didn't get as much publicity as maybe it should have...?
The text was updated successfully, but these errors were encountered: