-
Notifications
You must be signed in to change notification settings - Fork 931
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
Discuss how to update the "Tool recommendations" page #1468
Comments
These are purpose-specific tools, related to specific tasks in packaging and so we recommend them. The latter are workflow tools, not necessarily packaging tools, only one of them being under PyPA, some having a track record of serious problems. PyPUG should recommend tools for tasks. Workflow tools can be in a separate category, like managing virtualenvs (next to things like tox/nox). |
Yes. |
It's a PyPA project that works. And in some cases, there's no (easily) usable replacements. So I'm -1 on this. |
I think we might need a document "What PyPA is not." explaining that there can't be consensus in some areas, by design. |
I'm hearing that the new maintainers are better. Same with Poetry — people said that the current maintainers aren't as problematic. But I'm still not a fan of either because of their history and bad experiences. |
TBH, I was expecting this to be the controversial item 😄 I completely admit that I am biased, since I personally find setuptools hard to understand and use. With that being said, I don't really understand your argument with setuptools being a PyPA project, since Flit and Hatch are also PyPA projects. Since there are three build backends in the PyPA, how do we justify the existence of the other two if PyPA "officially recommends" setuptools? I also think it's worth remembering that when this recommendation was added long ago, it was a recommendation to use setuptools as opposed to distutils, not as opposed to other build backends which only became possible later, and at that time there was consensus on using setuptools rather than distutils. Today, there is clearly no consensus — you like setuptools, I like Hatch, the Flit maintainers like Flit, ... So, by the evolution of the situation, the page has now become objectively misleading, since it presents setuptools as the official recommendation as if this were the PyPA consensus, whereas there is no PyPA consensus. Quoting @pfmoore on https://discuss.python.org/t/removing-setup-cfg-and-setup-py-from-the-packaging-tutorial/16096/19?u=jeanas: “We’ve worked hard to open up the ecosystem to allow users to have a choice of backends. Promoting and encouraging that choice is part of that work.” Finally, it's kind of contradictory if the official recommendation is setuptools but the "Packaging projects" tutorial uses Hatchling by default. To be extra clear, I'm absolutely not advocating that we change this page to recommend a build backend other than setuptools, but that we say something like “PyPA does not recommend a single build backend for all cases. Popular build backends include Hatchling, setuptools, Flit-core, PDM-backend and Poetry-core. For compiled extension modules, common build backends are meson-python, scikit-build and maturin.” |
I like this idea. |
I've opened #1474, which implements basically what I said regarding build backends, along with other updates of the same page. |
Yeah, I see your points and having read what you wrote and linked earlier got me thinking that it would be useful to have some sort of an admonition/banner at the top of all (many?) pages with this (similar?) explanation. I remember the PyPA got a lot of blame for using one tool or the other in different guides with people reading it as favoritism. And having more explicit disclaimers would hopefully improve the perception. The individual documents will still use a single tool per document in most cases due to the nature of those text types, of course. |
Also, I have a feeling that there's confusion in some places when we document using tools as build front-ends. This is because many of those are workflow tools that compare more with tox/nox, not pip — they often manage virtualenvs and something that resembles lockfile ideas. They are also arbitrary command runners. And strictly speaking, I don't think something called a packaging guide should focus on those. In this context, I'd mention |
The tutorial used Hatch because the tutorial was improved to start using pyproject.toml metadata as defined by PEP 621, and at the time the PR was opened by @henryiii, setuptools didn't support that, but 6 months later when the tutorial was merged, setuptools had supported it for quite some time. I got the impression at the time that it was unofficially chosen because "hatch good", but I could be wrong. It was the wrong move either way, since flit provides a much better tutorial for getting people started quick-'n-easy which is kind of what a tutorial is for.
Setuptools remains an adequate build backend for cases where you have no external dependencies, don't use fortran, and single-threaded compilation isn't a bottleneck for you. This is a huge percentage of packages. Maturin is a special-case backend, which is very useful if you use rust (very nearly the only game in town) and very useless if you don't. To an extent it feels a bit to me like "if you use rust, you know maturin exists and you also probably wanted to use it anyway". I'm not sure whether it would be more confusing to mention it for something as generic as "compiled extension modules" -- in comparison, meson-python and scikit-build are powered by actual omni-language build systems that can handle pretty much anything you might try throwing at it (meson can even build rust code, just FYI ;)) and thus make a lot of sense to advertise in that slot. |
Since once again, wording seems to be getting designed with the unstated goal of listing Hatch first on a list and saying it's unbiased, I'd just like to point out that actual unbias typically involves something neutral like "we used alphabetical listing and explicitly state the list is alphabetized, in order to forcibly expunge bias, whether subconscious or otherwise". |
Sorry, but I have to say that I feel hurt by this downright personal accusation. The whole point of opening this issue and discussing the matter before opening a PR with a proposal was to give notice to anyone who wanted to comment, and avoid any impression that the change had been done under the cover by some random PR. And now you're accusing me of acting on a hidden agenda, which is exactly the kind of accusation that I wanted to prevent. Yes, I like Hatch, if you want to know. The order in the PR isn't my preference order though (or PDM-backend would be second and setuptools last), it's just the same order as the tutorial because I didn't want to open the question of the order as a sub-debate and that order is just consistent with the tutorial (so any decision should affect the tutorial at the same time). |
I apologize for giving you that impression. This is partially hasty wording on my part.
The problem as I see it is that it's not actually obvious why keeping the order was chosen. Mechanically:
As you say, an explicit goal of this discussion is to solve the potential for suspected bias on an official page which looks like an official choice, given that no actual blessing exists. But then why keep the same order as the tabs in the tutorial? Is it:
(For the record, my money was on option 3, not option 1. Either way I was wrong. I'm sorry.) Transcluding someone else's (explicitly per option 2 or implicitly per option 3) is still ultimately the effect of having that goal. Either way one is still falling short of the stated objective of fixing an issue whereby tools are perceived as blessed because of the way an official page seems to portray them. I cannot agree with the decision to avoid opening the question of the order as a sub-debate. I completely 100% understand that it's very tempting to avoid that topic as it feels like the only truly controversial topic. But I think it undermines the entire foundational direction of the proposal, to fail to address the main issue. The alphabetical ordering approach is very common, and the natural instinct of people when it comes to publicizing information where the order doesn't matter but a decision must be made and ideally one that is consistent with later insertion of additional elements. It has the benefit of being mostly unbiased, with the caveat that we may theoretically get a wave of new backends all named "aardvark" in order to game the system and get to the top of the list. RFC 2777 describes an algorithm for guaranteeing unimpeachably unbiased random selection by relying on government run lotteries; this would solve that problem but is also tremendously overkill and I would simply not bother. I'm genuinely surprised it wasn't originally chosen for the tutorial as well, but such is life. It's a fixable problem. |
I’m pretty sure that the author of flit explicitly requested that flit not be used as the recommended or default backend.
Given that flit is excluded by request, hatchling comes first in alphabetical order. So that’s ok then, isn’t it? 🙂 More seriously, I don't think any backend should be unilaterally recommended, as they all have issues:
There's also a question of whether we should consider recommending non-PyPA backends. Personally, I don’t think being a PyPA project is necessary, but some people feel that the whole “PyPA own the tools” idea is important, so picking a non-PyPA tool would involve a whole extra debate (of course not picking a non-PyPA tool could just as easily trigger that 🙁) If we have to pick (and we do for deciding on the default tab for the examples, at least…) then the best options IMO are setuptools (with a bunch of “look out for out of date information” warnings) or one of the workflow tool backends (with big disclaimers that there’s no implied recommendation of the tool itself). Or see if @takluyver has changed his position on flit as a recommended backend. |
Thank you, apology accepted.
It's a combination of (2) and the fact that I thought the issue had already been discussed and resolved while making the tutorial (i.e., that someone had already gone through the process of getting consensus on this issue, and there was no need to do that again). It looks like I underestimated the controversy on the order of tabs in the tutorial, though :( Oh well. I'm going to change the PR to list backends alphabetically on the "Tool recommendations" page. The order will be different on the tutorial, but I'm not going to change the tutorial now (and any change there is going to be hard because, as @pfmoore said, having some tab as the default is unavoidable). |
Poetry (still) doesn't even use the |
The order was a point of long discussion. I even had the idea of randomizing the initial open tab, but that wasn't popular. :) The current order came from:
That's why the order is what it is. I'd say either Hatchling or PDM-backend is a great starting point for modern Python development, with Setuptools & Flit regulated to specialty cases. I don't think the order in the tutorial should affect any other lists, though. It's very much focused on providing a good user first experience, and not on trying to declare a specific tool "recommended". You just have to have a first tab, and the one that provides the best starting experience is first. Lists are also not limited to these four backends, etc. Alphabetical sounds fine for any lists. |
Hi @henryiii, just a minor comment, the implementation for I was always a big fan of the random opened tab proposal. I think it is the fairer model for an umbrella association that has multiple projects with intersections 😝. |
If there was otherwise a consensus that it's a good default and my objection was the only thing standing in the way, I would probably remove that objection. I doubt there is such a consensus, though, for the reasons @henryiii describes. I'd like to avoid what happened to pipenv: PyPA appeared to recommend it as the tool for application development, lots of people tried to use it, and got upset with the project when it didn't do what they wanted. I think packaging is quite susceptible to this kind of thing, because we often don't want to think about it, so we look for whatever seems to be the default. And Flit is never going to meet everyone's needs, by design.
This isn't the place to get into a lengthy discussion, but briefly: yeah, this didn't end up in a great state, due to some unfortunate decisions I made back before PEP 517. I'm trying to get rid of the difference between what I'm inclined to think that it's better for ease of use to have a simple rule for sdists by default - i.e. only include the files we need to build a wheel - and let people override it, than to guess what files to include based on some heuristics which will inevitably be incomplete. |
Agreed. IMO, this is very much a problem with any "PyPA recommended" tool - if we pick any one tool as the recommended one, then simply by being the recommended tool, it has to be suitable for everyone (otherwise we get complaints that "the recommended tool is no good" and we repeat the pipenv experience, to no-one's benefit). But we cannot dump such a requirement on any tool, as tool authors are independent of the PyPA and have the right to make their own choices about what workflows and user requirements they support. Unfortunately, there's a strong undercurrent of support in the community for a "one tool to cover everything" solution, and it's hard to fight against that. I feel that the support is based heavily on a mistaken assumption that the "one tool" will always support the individual's preferred workflow, though, which I'd consider optimistic at best. I'd like to see any "tool recommendations" page be very explicit that there is no one "best" tool and users need to pick the right tool for their particular workflow. While we might choose to show particular tools as they work well for common use cases, users who have their own established workflows will need to look beyond what the guide suggests, if they want to find a solution that doesn't require them to make changes to how they work. |
That's a fresh idea. I could definitely get behind having a unified shared lib implementing just producing sdists in a standardized manner, reused by the regular PEP 517 backends. And I also agree with what Paul said, that such a document must have a huge disclaimer about it not having a tool rating. |
Apparently, there's a new wave of "I want you to make an all-in-one workflow tool for everyone but catering to my workflow" on LWN: https://twitter.com/hynek/status/1750519782573834568 |
Quoting from https://gregoryszorc.com/blog/2023/10/30/my-user-experience-porting-off-setup.py/:
These are all valid concerns.
I'm willing to do the work of updating that page, but I think this is a potentially very delicate/controversial topic, so I figured I'd open an issue to agree on a plan first, so as not to mix this discussion with PR review details.
Some thoughts by tool category:
build
andtwine
. Certainly, they're better thanpython setup.py bdist_wheel
andpython setup.py upload
, but the equivalent Hatch/Poetry/PDM commands are fine too.By and large, I think we should make less recommendations on that page, be more objective, and especially avoid recommending a given tool when there is no consensus among PyPA members that this should be the blessed tool, since the officialness of the page makes users believe that a consensus exists. For better or worse, there is more good advice to be given on what not to use — e.g., this could be a good page to remind things like "don't use
python setup.py upload
", "don't use distutils", and "whichever backend you choose, declare it in the[build-system]
table".One other thing I'm not sure about is the status of Pipenv (how well-maintained is it and are many people using it after all the controversy that there was around it?).
The text was updated successfully, but these errors were encountered: