[Distutils] PEP 517: Python 3 finder?
Nathaniel Smith
njs at pobox.com
Fri Jun 16 17:01:20 EDT 2017
On Jun 16, 2017 12:13 PM, "Daniel Holth" <dholth at gmail.com> wrote:
Build systems should be able to run under a different version of Python
than the one that is running 'pip install'. Does PEP 517 have anything to
say about that?
No, and I don't think it should. At the start of the bootstrap process, the
*only* thing we know about the system doing the build is that the python
being used to run pip is installed. Even if the build system could declare
a requirement for some other version of python, then what could we even do
with that information? pip3 install python==2.7? I guess I can imagine
building some system that tries to find other interpreters, or where you
can configure a database of installed interpreters that pip reads, or even
making it so that you actually can do the equivalent of "pip3 install
python==2.7". But that's all *way* out of scope for this initial PEP.
Then a flit back end could have a small amount of Python 2.7 compatible
interface code and create the wheel with Python 3 anyway.
If someone wants to experiment with this, then it's possible within the PEP
517 framework to write a 2.7-compatible backend that searches the system
for a python 3 install and then uses it. I'm not sure it's a good idea, but
you can do it :-).
For flit in particular I suspect this is unnecessary though. I see three
cases:
1. Developers building wheels to release: they can use python 3, no big
deal. The resulting wheels will be tagged as py2 or py2.py3 as appropriate.
2. End users installing from pypi: there are wheels on pypi so they never
need to run flit. (Key observation here: flit wheels are always pure
python, so they work everywhere the project is supported all.)
3. End users who have for whatever reason decided to manually get a source
tree (via git checkout or unpacking an sdist), and want to install it: if
they can manually get a source tree, they can also manually read and follow
directions to use python 3 to build it :-)
-n
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/distutils-sig/attachments/20170616/fa984517/attachment-0001.html>
More information about the Distutils-SIG
mailing list