-
-
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
Restore build-backend and remove switch to avoid pep517. #1927
Conversation
It appears that I'm a bit torn here. I think we should probably add In the end, though, I think the most practical approach is still probably to add both the As for why to bother with [1] I'll note that just doing |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know my explanatory post was a bit long, but the TL;DR is that I think we should also add the backend-path
key to pyproject.toml
.
If we're adding both, I think we can probably actually start including pyproject.toml
in our source distribution, but I think maybe we should wait until we're going to make a breaking release for other reasons anyway, just to give pip >= 20.0
some time to disseminate.
I've spent hours going back and forth on this issue with platform maintainers (@abadger, @warsaw) and other package systems like Spack (@tgamblin). The issue is that they wish to build artifacts of various packages all from source (distributions or repo), and so they demand a DAG of dependencies (keyword being Acyclic). And because all projects are built by setuptools, setuptools cannot itself have any build dependencies, including My instinct was the same as Paul's, that it should be possible to build even the most foundational tools (setuptools) from pre-built artifacts (wheels, specially-built bootstrapping artifacts, etc). |
Co-Authored-By: Paul Ganssle <[email protected]>
But the only way I see to do that in a system built from pre-downloaded sources would be for that system to include setuptools' build requirements as wheels or for setuptools itself to somehow supply its own build requirements. Presumably setuptools can do this once |
Does this mean this change will break source-only builds for downstream packagers, or will they be unaffected because they're not using pip to build? I suspect this issue is also mitigated/masked by the fact that |
Rather than let this issue linger, I want to proceed with this potentially risky change. It may impact downstream packagers, and if it does, I want to be sure this time to capture some strict requirements in the setuptools test suite such that it will guarantee the requirements are met. |
Hi @jaraco, I'm a Spack developer along with @tgamblin. Thanks for looping us into the conversation! I'm still trying to wrap my head around the implications of this PR, so forgive me if I'm jumping to conclusions. At first glance, it looks like this PR is a step in the wrong direction.
@pganssle See #980 for prior discussion of this issue. The problem is that there are many package managers out there aside from It seems like this PR once again makes
3 is the easiest solution for us, but obviously no one wants that. We don't want to be stuck in history any more than you want people using ancient versions of setuptools. 2 could work for us, although having a package manager (Spack) require a different package manager (pip) to be installed in order to install Python wheels seems like a step in the wrong direction. 1 could also work, and we do similar things for languages like Go, but once again it seems to introduce more complexity than should be necessary. Are there any other solutions I'm missing? Or something about this change that I'm not understanding? |
I think you are missing the point here. I'm not talking about requiring arbitrary wheels, I'm saying that for universal python wheels that contain no extension code or architecture-specific information, "building from source" is a largely bureaucratic checkbox, because the wheel file is a zip file containing the source code. Allowing It is not clear to me why you would require I think the decision to add a |
I looked through this, and it's not going to cause an issue for Spack, mainly because it's a circular dependency from So, our Spack packages can install straight from git like this:
I verified that this works fine in a Spack environment with
Neither of those is a big deal. We don't currently use PEP518 (because it's still provisional, right?) -- we have our own package format, so we don't really have to ignore anything. We can just omit the I gotta say, though, that I had to dig more than I really expected to figure this out. I am probably not as up to date on the latest in Python packaging as I should be, but here are a few suggestions: DocsGiven that Yes, you can install I think the docs should mention the two methods discussed above:
There should probably be a caveat that these methods are really for people writing build systems or package managers, but it would sure make things more obvious.
|
By defining a dependency on setuptools, we're deliberately breaking the spec because no front-ends actually supported
This is not a good reason not to use wheels to bootstrap things, it's just Debian's convention. I don't really care to argue the point, I already lost this battle a while ago, and it is already unnecessary for people to build from wheels. We will eventually come back into compliance with the spec when support for the full spec is widespread enough that it won't break too many things to do so.
Our documentation is not well-organized and out of date in many ways. There are many things in the wish list. I would not recommend documenting either of these, since I don't consider either of these to be the right way to produce a setuptools wheel / installation. Once we are able to ship a
This is probably a mistake. PEP 517 and 518 are provisional in the same sense that |
This is good.
👍🏻
Ok.
I don't think that makes a whole lot of sense, since the two ways I mentioned are the only ways that actually work without
I didn't mean to say that we would not be moving towards them. Yes, they look promising. At the very least PEP517 can help us, and it would be great to mine dependency specs when things support PEP518. I do not think it is a "mistake" for us to have our own package format and our own dependency specification, beyond what PEP518 prescribes. Spack supports many more types of packages than |
This is not true at all. Any PEP 517-compatible front-end can install
PEP 517 specifies how PEP 517-compliant things can be installed.
I'm saying it's a mistake to wait for PEP 518 to no longer be provisional before implementing it. It's essentially done now, and you probably want to understand how it fits into your workflow before it stops being provisional, so you still have an opportunity to get it changed (though as time goes on it will become harder to change PEP 518 for backwards-compat reasons). My overall point is this: for many packages, you already need a PEP 517/518 front-end to install the package correctly. Sometimes it is possible to make ad-hoc modifications to the build system to avoid this, but you'll have a much easier time if you actually make use of the |
This would be extremely helpful. I did not know this because it is not documented. I tried looking at packaging.python.org, but the only thing there that seems relevant is:
I will look into reworking our python support to use
At the moment, we do get most of the version information that goes into a |
I love Python as a language, but its lack of a consistent build system leaves a lot to be desired. I realize that this is one of the reasons setuptools was created. Once upon a time, if I needed to know what modules a Python library depends on, I could check in For comparison, the R language has an incredibly uniform and robust build system, where every package is required to use a I think PEP 517/518 look great, but until someone drops backwards compatibility and forces packages to use |
@adamjstewart: I do think people are moving in the |
Per Paul's comment in #1644, this change restores the build backend and removes the workaround to avoid pep517.
Rather than selecting 40.0, I chose 40.8 based on the error message reported in #1923.