-
Notifications
You must be signed in to change notification settings - Fork 257
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
Reliance on flit makes packaging incompatible with Void, Arch and Alpine Linux package systems #363
Comments
IMO those packaging systems need to update themselves for the fact that PEP 517 is a thing in Python now. We’re invoking |
(Periodic reminder that a wheel installer would provide a straightforward workflow for this.) |
Supporting PEP 517 is fine, and moving away from Installing from the source tarball is possible using
|
In Nixpkgs this change is also causing trouble, but from a different point of view. We install everything from source, and with the change of Note however this issue is resolved as soon as flit uses |
Adapting PEP 517 means, essentially, to adapt wheels as the common installation medium. All build tools produce wheels. Pip (in PEP 517 mode) installs wheels. Other tools intending to install Python packages, if they choose to not use pip, would therefore need to understand how to build and install wheels. The wheel format is well-specified, and any tool can implement an interface to perform the process of putting files inside a wheel into any target location. I would suggest this is a good chance for all the tools mentioned (xbps-src, apk-tools, etc.) to come together and discuss how they should migrate off the implicit dependency against setuptools, and “properly” support Python packages in its specified form. With Python packaging now being increasingly more and more based on standards (instead of specific implementations like setuptools), more and more packages are expected to move off setuptools, and delaying the progress will not make the transition easier down the road. People working on Python packaging generally do not involve too much in alternative tools (since it is enough work to keep eyes on one set of them), and having alternative players in the field would help us understand the challenges and take advice to improve the process early. |
I think that discussion is best kept at https://discuss.python.org/c/packaging. |
@FRidh I'm curious to see how Nixpkgs will handle this update (I see More broadly, there isn't an inherent problem with relying on That The Python community seems to acknowledge that packaging and distribution is a difficult problem, because Python-specific solutions to the packaging problem evolve dramatically. Developing an approach that fits together with distribution package systems, rather than attempting to stand in isolation, seems to offload some of this burden from the Python ecosystem to the distributions that want to bundle this software. Fundamentally, all Python packages should be representable as distribution-specific packages, because they need to fit in a larger dependency graph than the Python ecosystem alone can model. |
I am updating right now NixOS/nixpkgs#105368. Those updates should land in a week, maybe two, in our unstable channel.
We declare our dependencies and perform builds in a sandbox. We then indeed pass To build:
To install:
Setuptools could still try to install, e.g. when using the deprecated |
@pradyunsg you, better than nearly anyone else alive, know precisely how much of a lie this is. I get it that it takes time and effort to get https://github.com/pradyunsg/installer/ off the ground, and I don't mean to demand you volunteer "ALL YOUR TIME RIGHT NOW" to make free stuff for people. But it would be really helpful for the purpose of discussion if you don't carefully miss the point by a country mile and suggest the existence of a tool to build wheels identical to https://files.pythonhosted.org/packages/28/87/8edcf555adaf60d053ead881bc056079e29319b643ca710339ce84413136/packaging-20.7-py2.py3-none-any.whl means distros don't need tools to install the darned thing. You are intimately involved in the existing discussions as to why "those packaging systems" do not want to use pip, and generally cannot, and why PEP 517 only describes one half of a solution previously solved by "use the well-thought-out setuptools interface". I'm sure you're well aware by now that distros aren't helped one bit by PEP 517, which contrarily causes a lot of pain and heartbreak. It's downright depressing to see this hostile attitude toward distros that are literally asking for one thing and one thing only: do not drop support for the old way of doing things until after a new way is implemented. Distros are not necessarily experts at writing deep integrations into the guts of python PEPs. But we are very much experts at tying together build systems and system dependencies, then deploying your software to tens of thousands of people. Making fundamental components of the python packaging ecosystem incapable of being installed using distro-compatible tooling, then performing victim blaming ("it's your fault for not writing your own build system to hook into our buildsystem, we don't care if you can package this, distros suck because they don't PEP 517"), is not exactly what I call welcoming. Once again, it seems we're back to cavalierly saying "screw you" to distros. |
BTW: The
|
It would in fact solve this, though I do wish all core packaging packages used all the same backend to make bootstrapping easier. Otherwise, we have to manually bootstrap all the PEP517 backends required and then build the packages. It helps that Unless there are is a logical reason to choose flit, I urge the maintainers to reconsider and move back to setuptools. I could open a discussion on Discourse to propose choosing one build backend for all core packaging packages. |
I don't think it should be too bad to ensure that the sdist is built with a compatibility shim setup.py. It's not zero cost though, as it means this project ends up on the hook for dealing with support requests that end up stemming from a secondary install mechanism. That being said, downstream projects are going to have to figure out how to deal with a post 517 world sooner or later, and while I think the ideal situation is that there's some standard tool for helping with that, at the end of the day all of these projects are largely handled by volunteers, so there's a reasonable chance the different moving pieces move at different paces, and that might not be available. |
The more likely workflow would be using pypa/build, to build the wheels, and pradyunsg/installer, to install them. We still have the issue I presented above when building via PEP517, I think we should make sure all these tools and their dependencies use the same PEP517 backend. |
A quick look suggests the rationale was to remove some amount of burden that setuptools imposes (needing to have I also think that there's value in dogfooding the newer tooling/standards to try and shake out places where we can do better. It's kind of a sad state that due to our position in the ecosystem, we're often times the one least able to take advantage of the improvements we make. I haven't been very active on this project, so I'm not going to say one way or the other what's going to happen. I just wanted to point out that it's not unreasonable that projects move at different speeds here, and that regardless of what happens, folks should not consider this fully resolved until everyone is capable of handling a fully post 517 workflow. |
Huh. Okay... sigh Well, I just don't have the energy to figure out how to properly respond to this at the moment1. I do hope that the work I've been doing over the past few years -- establishing communication channels and having conversations with distro maintainers (during in person events as well as virtually), initiating broader discussions about the underlying issues at play here (like https://discuss.python.org/t/2062 and whatnot), starting and working on https://github.com/pradyunsg/installer/, and lots more things that I don't have the energy to go hunting to link here -- stand to show that I very much actively don't take a "distros suck" approach on these matters. If they don't, well, I don't see how more words in a GitHub comment can change that. FWIW, as a bit of context perhaps, I'd closed #360 the night before, and triaged this early in the morning. You can look at that user's past issue history for better understanding the kind of interactions I was in the mood for avoiding. Little did I know that I was setting myself up for a differently depressing alternative. Anyway, I'll be fine with whatever my fellow maintainers decide to do here. Feel free to @ me if there's some plan of action that someone wants my thoughts/opinion on. I'm gonna unsubscribe from this issue and focus on all the other things on my plate right now. 1 I recently relocated to a country on the other side of the planet (yes, in a COVID-19 affected world), there's pip's upcoming 20.3 release that's been taking a lotta work and it's been a really long working Sunday for me today. |
The fact that The facts that I understand the value of simplifying package definition from the maintainers' viewpoint. I also appreciate the desire to dogfood these solutions. But isn't there a reasonable argument to be made for preserving the legacy |
I missed that, sorry. I still think that is a very small improvement for the usecases it breaks. |
In a way, breaking the This creates a very difficult position for every sufficiently popular Python package (I dealt with the same complaints a while ago when I stopped including |
It definitely would make it easy, but it is not absolutely necessary. As long as we can avoid cyclic dependencies it should be fine. I don't know how that is with
Indeed the source location is embedded. Since we build in a sandbox it is still reproducible for us
It would still be preferable to remove it considering the possibility of building without a sandbox, so I think we should start doing that in Nixpkgs. Given the file holds no value whatsoever for distros I don't see why it would be an issue for distros to remove it themselves. Its really a minor fix after all.
Which tooling do you refer to here, the PyPA tooling, or the distro tooling? PEP 517 and flit have been around for a while now. |
If you are able to use a pip with vendored dependencies to install packages then you don't have an issue. Other distros have guidelines that force them to devendor pip and/or make pip unsuitable for installing packages. |
OK, a lot to unpack here. First, the tone of this issue needs to change. For instance, claiming that someone "know[s] precisely how much of a lie" something is when it's a subjective view is not in any way helpful or motivating. We are all volunteers here and coming in agitated doesn't help when we are being asked to potentially rollback something that benefits those of us maintaining this project. Second, I know from a user's perspective this change wasn't useful, but as a project maintainer we benefit as outlined by Donald. And maintaining this project is not exactly easy when it's so far down the dependency graph in the Python packaging ecosystem which is obviously vast as shown by this issue. Had we known things would break for folks we probably would have either advertised it more or gotten feedback on timelines for when we could safely make such a change. Third, #340 was open for over a month before I landed the PR. Now that isn't to say I expect all users to monitor our issue tracker or anything, but I do want to be clear this was communicated publicly as coming using normal development processes. I do apologize for forgetting it in the changelog, but to me it was infrastructure since we are PEP 517 compatible and thus didn't require an entry so I just didn't think about it. Fourth, there seems to be some people saying there is some tooling missing before some Linux distros can rely on PEP 517. OK, then can someone please outline the blockers at https://discuss.python.org/c/packaging/14 so we can figure out what is necessary as a community? If it isn't communicated what needs to be prioritized from the Linux distro perspective then there won't be any improvements to the situation to help the Linux distros make the transition to EP 517 which is where things are definitely heading. Fifth, if the discussion on discuss.python.org reaches a clear conclusion of what's needed and we are willing to accept a user-contributed PR to rollback (no promises as I can't speak for the whole team), what promises on timeline do people have on transferring their tooling over to support PEP 517? While the accusation that "we're back to cavalierly saying "screw you" to distros" has been made, the reverse that we are being asked to be beholden to distro timelines and tooling can also be made. So if we are going to try and make everything work for everyone I want to make sure we are all working together to unblock everyone, which means not only rolling things back for now, but making sure it truly is "for now" and not indefinite. |
At this point, I will probably just do the Void update with
Now that I know these things, I can adapt. |
This is perhaps slightly off-topic, but this change seems to have also removed the ability for contributors to work on this via editable installs. I get:
Is there an alternative workflow I should be using instead? AFAIK PEP 517 doesn't currently support editable installs. |
Flit’s equivalent to |
You can use |
Or do what @uranusjr just described 😛 Apparently, flit can put symlinks or a .pth file in place for you. |
Thanks to @FFY00 being willing to help get 'installer' finished, I support reverting back to setuptools and then adding a |
Closes pypa#363 Signed-off-by: Filipe Laíns <[email protected]>
Closes pypa#363 Signed-off-by: Filipe Laíns <[email protected]>
Closes pypa#363 Signed-off-by: Filipe Laíns <[email protected]>
Closes pypa#363 Signed-off-by: Filipe Laíns <[email protected]>
The switch to
flit
in #352 has left thepackaging
source tarball without asetup.py
. While one can useflit install
to installpackaging
, theflit install
command provides a means to choose between installing to the systemsite-packages
(possibly in a virtualenv, by providing a custom path to thepython
executable) or to a per-usersite-packages
.Void Linux
xbps-src
, Arch Build System and Alpineapk-tools
package builders all expect to install Python packages into a specific destination directory that is empty except for the contents of the Python package; the distribution package is derived from the contents of this directory. Forsetuptools
-based projects likepackaging<20.5
, this is accomplished by passing, e.g.,--root $DESTDIR
for Void Linux.flit install
provides no similar mechanism. The closest one could come would be to construct a virtualenv at the$DESTDIR
, then useflit install
to populate, and then carefully remove all pieces of the virtualenv from$DESTDIR
except for the installed package. It should be self evident that this is a horrible workaround.If you are use
flit build
andflit publish
to build wheels and source tarballs on PyPI, this problem should take care of itself, because bothflit
subcommands appear to create asetup.py
in the source tarball by default. (Note, however, that the generatedsetup.py
appears incorrect because it importsdistutils.core.setup
, then uses theinstall_requires
andpython_requires
keywords that seem to be only recognized bysetuptools.setup
.) However, the PyPI source tarballs forpackaging==20.5
,packaging==20.6
andpackaging==20.7
do not includesetup.py
. Thus, you are either creating a source tarball by some other means, or invokingflit build --no-setup-py
orflit publish --no-setup-py
.Without a
setup.py
in the source tarball (either generated byflit build
orflit publish
, or manually created to parallel the package definition inpyproject.toml
), new versions ofpackaging
cannot be properly packaged for Void, Arch, Alpine and, I imagine, several other Linux distributions.The text was updated successfully, but these errors were encountered: