-
Notifications
You must be signed in to change notification settings - Fork 139
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
Cannot add setup.py through the PEP 517 hook #501
Comments
Why would you need setup.py? I think the documentation is just outdated after implementing PPE-660. |
This is why. |
I don't follow, can you please summarize and state clearly. There is a lot of parallel discussion going on there. |
There is at least one downstream integrator who cannot yet handle the PEP 517 process in their automation, necessitating a I can work around this by using |
I'm personally would vote for PS. I don't think we intend to support legacy build systems. |
I know – the comment I linked to was referring to a legacy build system. |
Isn't support for legacy installers exactly why the |
It seems I cannot use |
IMO providing more/better migration paths is quite important to get adoption of newer build systems/tools, being overly eager to drop legacy support is a mistake IMO, similar to how not providing backwards compatibility was a huge problem with how the python2->python3 upgrade itself was rolled out. Many packages were only able to migrate once improved support/tooling for single source python2/python3 code-bases was introduced as it allowed for incremental migration(often the only feasible way to migrate larger projects). In the same way build tools especially should try to simultaneously support legacy/modern installation methods for the purpose of simplifying migration(by allowing it to be done more incrementally), being overly eager to drop backwards compatibility ultimately slows down the ecosystem upgrade process IMO. |
flit has supported generating |
For my immediate needs, I think I need to drop flit-scm and go back to writing versions directly to |
I mean, PEP517 tooling is really only just starting to mature somewhat, even basic core functionality like installer cli support is still a work in progress for example.
It looks like python 3.11(last version compatible with distutils) isn't going to be EOL until 2027, so 5 years sounds about right for the upper range it would make sense to keep legacy install support around for. We're still in the process of purging the last remnants of python2 from buildroot ourselves, legacy build tooling tends to stick around for a while so it's helpful to support it as long as feasible for incremental migrations. |
I'm pretty sure you can use pip to install wheels, this is what virtualenv has been doing since day 1 - https://github.com/pypa/virtualenv/blob/main/src/virtualenv/seed/embed/pip_invoke.py#L36-L38. I'd consider pip very mature. You could also use pip to build wheels for a similarly long timeframe; with build being around for a year and a half too. That being said I'm not saying |
Last I checked pip cross compilation support is very broken/non-existant in general.
It tends to handle any non-standard install scenarios where all aspects of an installation need to be tightly controlled(like cross builds/installs) poorly in my experience.
To make things easier for those on older non-EOL python versions, at least until tooling/migration paths mature a bit more would be a reason, it's somewhat subjective though as different users have different needs. |
Couldn't you use pip under the same python you're building the wheel for?
It's the de facto standard for like 20 years, not sure how much would the installer project help 🤔 here.
PEP-517/518 works independently of the python version. It's not tied to a language feature, so why would the build system be tied to an interpreter version. |
Nope, when cross compiling you have to build using the host python, you can't run the target python on the host(since target python may be built for an entirely incompatible architecture).
For normal python application development sure, but I don't think pip ever really worked right for cross builds+installs. Installer seems to be the closest to what's needed for cross compilation installs.
Legacy distutils deprecation is tied to the interpreter version from my understanding. |
Yes, but the build logic one should use is not tied to distutils. PEP-517+518 has been the recommended way of building packages for over six years now, and those PEPs at no point use or mandate any dependency on distutils, so IMHO this point is orthogonal to this topic.
Sure, if you don't want to setup the same python on the build machine as the target interpreter. But IMHO that's a bad idea, you should always build/install on the build machine with the same python interpreter as the target machine because otherwise, your wheel build might not generate a compatible wheel. |
Sure, I just mean that would give a potential EOL timeline for distutils based build system fallbacks.
I mean the
So of course we have to cross compile the target python interpreter on the build machine as well...the problem is you can't actually run the target python interpreter on the build(host in buildroot terminology) machine so we also have to build a host python interpreter(from the same upstream source but targeting the architecture of the build/host machine) for the build/host system architecture, this host interpreter is basically a part of the host cross-toolchain.
Except that's not really possible, say I'm building for a Doing this is a bit tricky for a number of reasons since we have to do things like override the sysconfig and some other stuff so that any c extensions get built against the |
You can pass
Yup! We missed a line! Line 85 in 68ed852
One implementation-related concern here is that Is there a reason that you can't run |
Yes, as I stated before: I am using flit-scm as the actual backend to avoid having to update the version number in two places. This is my preference, but I can live without this convenience if this feature request is not accepted. |
Ah, I missed this while skimming through the discussion. Like Bernat, I lean toward not adding the setup.py generation logic to more places. Unlike Bernat, I think we should drop support from generating the setup.py stub sometime late this year/early next year (i.e. not immediately) since we just flipped the default to not generating the setup.py file by default. |
Where could I get details about your process for this? |
Whew. There's quite a lot written here before I read any of it, so apologies if I've missed some of it. It seems that the motivation for this request is coming from @jameshilliard's issues with PEP 517 backends and tooling. We're working on this - in particular, flit_core now vendors tomli to avoid the circular dependency. I'd rather focus on moving forwards and fixing the issues with the new way of doing things rather than making it easier to go back to the old way of doing things. We've just turned If you are considering using Flit to package |
Yeah, having it in
This functionality is most useful for downstream integrators rather than package authors IMO. Since the need for a |
The infrastructure code for this is pretty all in |
FWIW, I believe that Buildroot is now able to build flit-based projects without the use of |
Well basic flit support for target packages was added prior to that commit, but that one reworked things further to use new bootstrapping method for our host toolchain.
Well it may still be desirable for packaging things for distros that haven't yet introduced proper flit infrastructure support which can be somewhat complex depending on requirements. |
I'm going to close this now. I think we have a better bootstrapping story than when we were having the discussion, and I assume that in the last two years downstreams have worked out better how to build packages without setup.py. I'll reopen it if anyone strongly disagrees, but I was against expanding generating setup.py then, and I'll be against it now. 😉 One final remark on re-reading this thread. There was some disagreement on whether we were being too hasty to break the old way of doing things. And perhaps we were! But I also suspect that downstream packaging ecosystems only really start adapting when the old way breaks, so leaving compatibility machinery in for longer doesn't actually help that much, unless we're willing to keep it and support it for ever. I don't think downstreams are being lazy - you have a lot of packages to deal with, you want them to be as similar as possible and to work from one release to the next with as little manual intervention as possible. It all makes sense! But perhaps when situations like this occur, we can understand why it seems to downstreams like a very quick change, and downstreams can understand why it doesn't seem that way to us upstream. 🙂 |
Using flit as the build back-end, there seems to be no way to specify that I want to generate a
setup.py
. Forwheel
, this is important to have for now. The help forflit build
also incorrectly states that generating asetup.py
is the default. Would you consider adding a configuration option inpyproject.toml
for this, under[tool.flit.sdist]
?The text was updated successfully, but these errors were encountered: