-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Please do not remove setup.py install
as it is needed for distribution packagers
#2088
Comments
I hope that I did not give you false hope that there was some possibility that we would continue maintaining the ContextTo give you a bit of context here, for a long time in the " PEP 517 and PEP 518 are part of a wider effort to standardize build tooling in a way that allows for new build tools to be built without requiring every build tool to actively be compatible with every other build tool. We've standardized on a way to specify build dependencies (PEP 518) and standardized the relationship between back-ends (like
|
And as for some of your original points:
Unfortunately,
I don't think it's a huge imposition to ask people to substitute It's better to do this than to allow users to have increasingly broken and unsupported installs.
It depends on how it's implemented, but this depends on how they've customized it. If they overrode it without calling the |
the ecosystem gets literally wrecked from a distro point of view while no proper replacement exists as of today. no, pip is not a sane choice that suites proper distro needs without boilerplate and hassle. As there isn't much point to repeat what @eli-schwartz already appropriately summarized, one can simply read here: #2080 |
Hmm, this at least really doesn't seem to be a dealbreaker, because at the very least on recent versions of python setuptools should be able to use importlib.metadata instead, shouldn't it? And failing that (and more generally from back in the day) it's very trivial to get the right import path and use it directly. I was under the impression that this seemed to be a deliberate design choice of setuptools, to validate dependencies, because otherwise whyever would one not write out (In keeping with the painful habit of python software writers to list a lot of
The problem here, is that "there's a replacement, it just doesn't work" means that there is not, in fact, a replacement. This is why it is so frustrating to people! Usually one implements a replacement before deprecating and removing its predecessor. Python is, instead, leaving us in a situation where there is nothing, and justifying it with the rationale "well, eventually there will be something". And yes, I know that setup.py install is not actually removed. However, I come here by way of #2080, because I'm in a situation where
Thank you, this is very helpful information which I appreciate. I'd be more than happy to experiment with using to see if it can replace setup.py install for us, though as it seems to be merely days old, and still mostly scaffolding, I cannot make promises...
Note that this isn't actually a problem, since setuptools' dependencies can build with distutils alone, and this is how we bootstrapped python 3.8.0, for example. (I also know that previous major releases of python were bootstrapped on Arch Linux by tediously editing a build container to sideload setuptools. But this is a problem for reproducible builds and given we can now cleanly bootstrap I see no good reason to go back.) It's fairly simple to do, at least for the very small handful of packages which have tried to support this (and which don't need entrypoints or other things distutils is simply incapable of at all):
|
@anthraxx No one says you have to use I'll note that Fedora uses As I mentioned above, installation workflow is moving to be standards-based, and I think you're probably being a bit over-dramatic here. No one is going to yank Still, as I've mentioned, it's been unmaintained for a few years now. You should really look to migrate now. You don't have to go to If that's not acceptable, it should be easy enough to write a wheel installer (you can collaborate on the one that's already in progress and then you probably don't even have to maintain it, going forward). Again I'd like to emphasize two things that seem to be getting lost:
|
It is semi-deliberate in that it pre-dates
I think you're missing my point here, I was not saying that the replacement doesn't work, I was saying that I understand that The PyPA also has spent ages and ages defining clear standards so that if you have unusual needs not met by the tools we've been able to prepare, you can go your own way without needing to veer into "unsupported" territory.
Yes, this is one reason why
I hate to be the bearer of even more bad news, but Though there's also the possibility that one or more of them will migrate to using |
We've discussed internally, a few times, the thought of creating a bootstrap repository for toolchains. Nothing is final. Simply depending on the previous version of setuptools doesn't work as that logic breaks down when moving from python 3.8 to python 3.9... One priority for bootstrapping would be not minimizing the number of packages it takes to bootstrap. If:
is a viable way forward, we'd have a couple paths to bootstrapping the ecosystem with only a handful of packages. Bootstrapping pip requires 24 packages, and that rises to 40 packages if you count sphinx, which we need to build documentation in manpage format, and that's leaving aside the issue of pip having generally undesirable behavior for packaging. We currently document various mechanisms for installing python software, with pip caveats here: https://wiki.archlinux.org/index.php/Python_package_guidelines#pip (but using pip for this is a hassle, so no one does it, so no one focuses on documenting the pitfalls, so it might be out of date.) Since I'm currently unsure how bootstrapping in a possible post-distutils world might look, I think we'll have to see how the 'installer' package or similar tools play out before settling on one way to do it. And in the meantime, we use setuptools, which, for our purposes at least, works essentially flawlessly. |
This is one thing I can help you with, at least for now. I've written https://github.com/mgorny/pyproject2setuppy to help with packaging this stuff for Gentoo. Its ~200 lines of code, has only toml as a dep and installs everything via setuptools without requiring you to install two new huge package managers you won't ever use or dephell which deserves the name. Of course, it will stop working when Besides, these PEPs pretty much prove where Python ecosystem is heading. We have new fancy way of installing stuff which uses integrated package managers in place of build systems, we have new fancy markup language that is required to deal with this… and at the same time, Python team refuses to include TOML in Python 3.9 because… the spec isn't finished yet. So it's not yet ready to be included in Python so that it would reduce bootstrap trouble at least by a tiny bit. At the same time, it was mature enough to reinvent the whole build mechanics and announce killing the old one. |
pypa/pyproject-hooks#81 is a hard blocker for using pep517... apparently I was wrong to be optimistic, not even that works. |
That's disappointing — I thought that it was possible to supply your own install hooks to the Presumably for packagers who are planning to satisfy the dependency from system packages, it would be split into two stages: stage 1 being an automated/semi-automated process to translate the PEP 518 metadata into system package dependencies (e.g. to populate the This may have also come up in a discussion with @encukou about the possibility of a |
Well, it looks like we could, we would just need to create a second python package just to reimplement main() around This is quite awkward, not least because it's an explosion of tools and Arch Linux dislikes an explosion of custom distro tools (we devoutly avoid build recipe macros, templates, and inferred hooks with the rationale that they're unreadable and turn the act of packaging into some secret invite-only club of people who actually understand the endless layers). It would be best if pep517 could just... not call pip when it knows all the |
Ah, so this is a simpler issue. I think that This leaves us in something of a limbo where For a long time, I've been advocating for minimal, composable Unix-philosophy tools here, but there is a strong desire from many corners to have "all-in-one" tools like Using So, in short, That said, if you need something now, before anyone gets around to creating a simple builder, it may be worth making it slightly more general than it needs to be and proposing that it be an official PyPA recommendation to replace |
We use the tox plugin for running tests of projects that use tox for testing and recording test dependencies. |
I'd be interested to know where other packagers are at on this issue, in light of fc5c308. In MacPorts we rely on |
I can't answer that because I'd end up being banned. |
Some distros continue to use |
@layday Thanks for the summary. That's pretty much what I thought the situation was. So it sounds like we'll have to keep setuptools 58 around for the foreseeable future (or at least until all the python versions we care about have a PEP 517 builder in the stdlib.)
That part is all well and good; the problem is just the step before that where you have to get build and installer installed. |
You will need to (or at least try to) run the entire stack from path, for build to build itself, its dependencies and installer, and for installer to install them. Amusingly, I expect the most challenging part with this approach to be building setuptools, which has a circular dependency on wheel. |
As soon as we have the installer CLI script ready, I will write a bootstraping script that be can be used for this purpose. |
Setuptools at least vendors its dependencies for exactly this reason. |
setuptools does not vendor wheel to be able to build a wheel of itself. installer is a wheel installer. |
You can run just everything from source. |
It's not that simple - setuptools does not import wheel directly, you need to register its entry point with distutils. |
That is fine, we can work around that. |
I've managed to bootstrap setuptools with build as an exercise in, uh... I don't know what exactly. Begin by cloning your build dependencies. Create a new folder that'll function as a temporary "site packages". Add this folder on your |
I have now a working bootstrapping script capable of building and installing the required packages to setup a Python environment in https://github.com/FFY00/python-bootstrap. |
Thanks all for the suggestions. Various more or less hacky solutions are clearly possible. Two final thoughts:
|
The root issue is not the tooling, but rather that setuptools is not designed to be bootstrapable from source. Other backends, like flit for instance, are. |
I would start with the fact that to this day there's zero progress in including a TOML parser in Python stdlib. |
And there won't be for a while, a custom bootstrapping process has been required for a long time if you devendor stuff, so I don't really get your point. I have demonstrated that it is indeed possible to bootstrap via PEP 517, and even provided a tool to make this easier. If this tool does not meet your needs, please open an issue, but pressuring maintainers to keep maintaining legacy and already deprecated interfaces is not very useful. |
Our problems, at least, only began with this deprecation. We don't do any devendoring and never needed a specific bootstrap solution before. |
Yes, and that's unfortunate, but that isn't a problem of the tooling not being mature enough, but rather due to the design of the new approach. I don't think a PEP 517 builder or a wheel installer will ever be included in the standard library, because of the exact reason that lead distutils to drift away from the standard library and becoming setuptools. |
What you neglect to mention (and what caused me to waste a lot of time trying to figure out how your bootstrap works) is that you're using a custom fork of |
There’s an open PR to add a CLI. I’ve said so above.
Sent with [ProtonMail](https://protonmail.com/) Secure Email.
‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐
…On Monday, November 8th, 2021 at 10:41, Michał Górny ***@***.***> wrote:
> I have now a working bootstrapping script capable of building and installing the required packages to setup a Python environment in https://github.com/FFY00/python-bootstrap.
What you neglect to mention (and what caused me to waste a lot of time trying to figure out how your bootstrap works) is that you're using a custom fork of installer. So I dare say that the tooling is not mature enough, and you had to fork it to make it work.
—
You are receiving this because you were mentioned.
Reply to this email directly, [view it on GitHub](#2088 (comment)), or [unsubscribe](https://github.com/notifications/unsubscribe-auth/AHNRFWAH54WV5LLEI7ZS5ITUK6EKNANCNFSM4MYPEKKQ).
Triage notifications on the go with GitHub Mobile for [iOS](https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675) or [Android](https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub).
|
Eh, things are getting even better. I've spent significant time trying to figure out how |
Python packaging is oriented toward installing libraries and command-line tools. |
I believe you are mistaken. The files that setuptools calls You can use these to install things like man pages or |
I think this issue is basically settled at this point, no? I'm going to close it. |
As requested in #510 (comment) I'm opening a new issue. What I'd like for is that
setup.py install --root=...
(or a minimal equivalent) remains working as a 'low-level' install command for distribution packagers.Installing packages straight from setuptools (much like distutils) has important advantages for us:
--root=
install mode fits just fine the packaging logic we have. We need a command that puts files in a directory we can use. We build distribution packages, and would really like to avoid building a wheel just to have to repack it into plain package.setup.py install
one way or another. At least in Gentoo the majority of them is covered by our Python framework and could be easily swapped to use another install method but I can imagine others are not so lucky. It's not fair to ask people to change all that.install
command, including some high profile ones. If the command is removed, they would all become broken, wouldn't they?All that considered, please keep
setup.py build
andsetup.py install
commands for us. I don't care if they output huge warnings, require magical environment variables to be run but they need to stay as backend commands.The text was updated successfully, but these errors were encountered: