-
-
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
PEP 518 and the future of custom or directly invoked commands? #1515
Comments
I think what's likely needed is a standalone "build environment" library that handles the common task of creating a PEP 517 style isolated build environment (note that it's PEP 517 that discusses isolated builds, rather than PEP 518 - although as this issue proves, it's not something that's limited to PEP 517 implementations...) The https://github.com/pypa/pep517 project includes a build environment abstraction that might be useful here. Alternatively, pip's own build isolation code might be something we could split out (or merge with the pep517 library). Build isolation code in pip has proved quite tricky to get right, so it's definitely something that's worth doing once and sharing among projects :-) |
@pfmoore I think the question of how the isolated build environment is implemented is important (and I agree that a standalone library for building it would make this much easier to implement), but we may want to start by determining whether having a command line script that is just a PEP 518-aware version of invoking |
Sure - that's not something I have much of an opinion on, though, so I'll defer to others on that point :-) What I will say is that IMO that's purely a setuptools question. The whole point of PEP 518 and 517 is to decouple tools like pip from build backends like setuptools, so that pip only interacts with setuptools via a very narrowly defined interface (PEP 517). So anything outside of that is specific to setuptools. In much the same way as flit has its own commands ( PS Is there any reason why the tool can't just be called |
No reason, for whatever reason I just thought it seemed weird to call it that. Let's assume the command is called
That's kinda already the problem, except right now we have to say, "Well don't use |
In jaraco/pip-run#33, I've started exploring if our existing tooling might already support the need.
It's not quite as elegant as |
I think the current trajectory of
setuptools
is that we're deprecating direct invocation of most if not all custom commands, and as such the PEP 518 support is moving entirely topip
. This is fine forinstall
andwheel
and presumablybuild
and several other commands will also be implemented inpip
, whiletest
is switching over topytest
andupload
is switching over totwine
.However, people have long been able to write custom commands and have integrated them into their workflow, so they invoke
python setup.py lint
orpython setup.py clean
or something. What are we planning on doing for all of those?My $0.02 is that I think we can't realistically get rid of these (and, frankly, I'm not sure we want to), but invocation via
setup.py
is a non-starter because the dependencies really have to happen before the script is invoked.As such, I suggest that we create a new entry point script distributed with
setuptools
, likepysetup
. This would be a thin wrapper aroundpython setup.py
that is PEP 518-aware. It would install the required dependencies in an isolated build environment and could even address #1201 with a[tool.setup]
section ofpyproject.toml
.CC: @jaraco @dstufft @benoit-pierre @di @pradyunsg @pfmoore
The text was updated successfully, but these errors were encountered: