-
-
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
Clarity on installation from source #2550
Comments
pyproject.toml says setuptools is needed: Lines 2 to 5 in c121d28
With that, we cannot use any PEP 517/518 compliant builder if we don't already have setuptools. My idea was to do something like:
But that relies on the fact that for a certain part of our bootstrap process, we have the setuptools wheel bundled in Python. I can imagine others don't. Also, AFAIK ensurepip guarantees only pip, not setuptools. |
There is the Line 7 in c121d28
|
Let's assumme that
So I tried to bootstrap setuptools the following way and it has failed:
|
…t by caching the data that is bootstrapped. pypa/setuptools#2550
#1644 is relevant here. |
This assumption is fine, but the way I'm thinking, the environment still needs a foundational tool that's not setuptools that implements PEP 517 and can resolve build dependencies and make them available for building. And ideally, that tool should support resolving these build dependencies even if those dependencies depend on Setuptools (as pip can through wheels). My goal in this issue is to describe, demonstrate, and test how that would work. I don't yet have a great answer, but I'm working on it. |
I have solved the issue by just caching the egg-info. I think that we just need the bootstrap script back. Or maybe just to ship the info in the repo. |
Yep. I had a bit of a breakthrough today. In b968c01, I found one can add the minimal entry points as a separate set of metadata and they'll be sufficient when setuptools' own metadata has not been generated. It was working for me locally, but I see some CI failures, so it may require some more thinking. |
In #2582, I've managed to simplify the packaging, removing Setuptools build dependency on itself. I've also started working on a technique to install from source following PEP 517 processes in this Dockerfile:
Unfortunately, this approach violates point 2
And I've thought about it more and I don't think it's possible in a PEP 517 world. In PEP 517, there are two artifacts that can be produced, an sdist or a wheel. An sdist is just a source distribution, so isn't installable. A wheel is the only installable artifact produced by PEP 517. The problem arises in that wheel has Setuptools as a build dependency and Setuptools has wheel as a build dependency. Best I can tell, you can't break this dependency in a PEP 517 world without involving a pre-built wheel. I'll need to ponder this more. |
It is absolutely possible, given that python is an interpretable language (so packages not necessarily require compilation) and that a package is just a dir with files and that we can use packages that are not yet installed and that we can append the path to packages with any dir we like.
That is not quite a problem. I just clone the 3 repos, Here is my source: https://github.com/KOLANICH-GHActions/bootstrap-python-packaging/blob/master/action.sh The problems appeared when |
BTW, PEP 517 was itself a big mistake (and it was obvious since its introduction): now I have too install 3 tools ( |
I suffer the same error message when I attempt to build setuptools on my system (using python 3.8). |
@jachymb, there is a workaround in this issue. Clone KOLANICH-GHActions/bootstrap-python-packaging@a7f9b55 into egg-info dir |
That workaround shouldn't be necessary anymore with #2582 and the v54 release. |
Setuptools exists at a unique place in the Python ecosystem, and although this project aims to be a distributed third-party package like any other, because it is required to build many of the packages in the ecosystem, it has unique bootstrapping challenges, including:
I'd like to put together a story (documentation) about how to bootstrap a Python system to include Setuptools from source, including some integration tests that continuously validate these expectations and the associated constraints so that upstream platforms like Fedora and Debian can have a reliable means to supply Setuptools (only) when needed.
The text was updated successfully, but these errors were encountered: