-
-
Notifications
You must be signed in to change notification settings - Fork 25
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
Source tarball does not contain setup.py #44
Comments
Hello!
We’ll be happy to help these tools to follow PEP517, as we already did for other distributions. What is your distribution? |
Oh, and here's a working tinycss build for version
I was researching how to actually port/handle PEP517 based builds but best I can tell it's still somewhat feature incomplete, either that or I'm just not seeing how to make it work here. |
I’ve read your discussion on pypa/flit#462, and I agree with @takluyver. In my opinion, using wheels as the boundary between the build and install steps is the best solution, as wheels are described in a "specification" and don’t depend on specific tools for the install step. That’s what The build step may look strange for you, because you’re building a wheel. Moreover, this build has often already been built and put on PyPI. For Python-only packages, this step is actually useless (in my opinion), and distributions could just reuse the wheel distributed on PyPI. But distributions often like to launch tests, and tests are often only packaged in source packages, and not in wheels (because it’s often useless to install tests). So… The steps could be:
Some packagers are disturbed by the "install the wheel" part, but as it’s been discussed in pypa/flit#462, I think that it’s actually the "easy" part. The wheels are all the same, and a naive way to install them is "just" to put what’s in them on the filesystem. Of course, distributions will have different habits depending on their specific filesystem tweaks, and it may require some workarounds for some packages. But it’s a much better solution, in my opinion, to adapt the structure of a wheel than to adapt an obscure At least, for Python-only packages, it should work easily when you know where to put the python files. For many other packages, it will also work exactly the same way. For some packages, it may require some adjustments, for sure. The "hard" part is the build step. Using the In a nutshell, here’s what I would propose:
The current distutils/setuptools commands used in the current buildroot’s packaging system can still be used for packages where wheels won’t work, but with time I suppose that all the packages will be able to use the "standard" way. Please let me know if I can write some code to help. I don’t know Makefiles very well and I won’t easily be able to test, but I suppose that I can at least help with the overall organization and the |
Yeah we probably don't want to be using wheels from pypi, we do run some tests although they are not always the ones in the sdists, using wheels doesn't really help us much at all since we have to support c extensions and such anyways.
IMO it's pretty much pointless to support wheel installs from pypi at all since we know for sure that those will never be usable for packages with c extensions. It would just add complexity to our infrastructure to support both sdist and wheel methods. We also have infrastructure that checks package license files which are usually only in sdists last I checked.
Well that's not really happened before with python packaging before, heh. The problem is usually that the "standard" doesn't get fully adopted.
Well since The dev env should be pretty easy to set up, you can just clone my branch and try building with |
The The idea I propose is, instead of directly using distutils/setuptools, to:
I can try to write a
I’ve launched
Maybe there’s an easy fix for that, otherwise I’ll try to find another solution. |
I would maybe start out first with trying to handle non-distutils/non-setuptools pep-517 packages correctly, in my experimental branch the build type selection is controlled via:
Which is currently enabling the To make it not use distutils code paths you would want to revert this:
to this:
and then create a flit specific handler like this instead:
for handling flit+pep517 builds.
Yeah, that would be helpful, I would try to just modify the existing Making sure it works right for packages with c extensions is probably the most difficult part as those need to be built against the target python libraries and not the host python libraries. Buildroot separates out host and target builds for pretty much all packages but it has to use the host python interpreter to actually build target python extensions while linking against the target python libraries, it's a bit non-trivial to do and at least for distutils/setuptools requires specific flags to be passed.
Oh, yeah, looks like this doesn't work with default configs due to the toolchain config needing some tweaks, this procedure should work from a fresh clone:
|
I have tried to build tinycss2. It didn’t work (mostly because I don’t understand how the host / target work), but I wrote some code that explains what I had in mind: https://github.com/CourtBouillon/buildroot/commit/8beef6927f6659749fda23a0f67b06e4ed1261d2 I’ve added a
You’ll probably be more able than me to fix this code and use the right destinations and environment variables depending on the different cases. If you’re interested in including some of this code, don’t hesitate to ping me! |
Ok, I'm seeing if I can clean it up and get it building, and yeah the host/target split is especially complex since we are using a host interpreter to build the package but it needs to have the right env passed so that it actually builds the package for the target.
Yeah, I'm pretty sure upstream doesn't want to ever install from downloaded wheels in general(since they will be missing stuff like license files), but the wheel intermediary build stage may be workable.
Hmm, I thought
Yeah, I'll play around with it and see if I can get something that looks clean enough to try and upstream. |
It is. What I mean is that the
Thanks a lot. |
This doesn't really sounds right to me, since
Yeah, so |
FYI there was a namespace clash with the |
I sent off a preliminary series with the pep-517 dependencies(well the parts that don't have strange bootstrapping requirements like |
I added
It explains why I had to build Python 2, even if I desperately tried hard to avoid this 😁.
👍 |
Yeah, I'm assuming if the build frontend can be changed over for
Yeah, I caught it since I was splitting things up into a series(while incrementally testing each patch) and noticed it went haywire when I added and tested So right now I have it so that the So I refactored and cleaned things up a bit more and now have things so that it's now able to build and install For setuptools the install path override seems to be done likes this I guess:
The define for the target installation stage that is broken should be Current testing branch is here. Any idea how I'm supposed to actually override that? |
You can explicitly define where packages are installed by defining the {
'stdlib': '$(TARGET_DIR)/xxx',
'platstdlib': '$(TARGET_DIR)/yyy',
…
} or use a dict-comprehension (less code but more complicated): {key: os.path.join('$(TARGET_DIR)', value[len('$(HOST_DIR)'):]) for key, value in sysconfig.get_paths().items()} |
Hmm, I'm wondering if that's actually the best approach, mostly since I don't see the setuptools/distutils infrastructure actually setting those params directly. |
One of the goals of PEP 517 is actually to be sure that generated wheels follow the standard, and that they can be installed independently from the build system. So, as long as the library you’re packaging is able to generate a wheel (and it should, as it’s the default way packages are installed using Before that, if you wanted to use non-standard prefixes to build and to install your packages, you had to change some environment variables, and cross the fingers hoping that |
It looks like the specific feature being used to redirect the install is this by way of the
I think those env variables are not changing the installation folder but rather redirecting the sysconfig to the target sysconfig so that target c libraries are built against the target interpreter. |
No. There’s an issue open about that, but it doesn’t look like it will be fixed soon.
By changing the sysconfig, I assume that it also changes the default installation folders, but I may be wrong. |
It looks like
--setup-py
needs to be passed to flit for this to get generated properly, a lot of tooling still don't work correctly with PEP-517 so this helps a lot with distro packaging.The text was updated successfully, but these errors were encountered: