[Distutils] Comments on PEP 426
Oscar Benjamin
oscar.j.benjamin at gmail.com
Thu Sep 5 11:36:54 CEST 2013
On 4 September 2013 19:16, Éric Araujo <merwok at netwok.org> wrote:
> Le 30/08/2013 03:23, Paul Moore a écrit :
>> On 30 August 2013 00:08, Nick Coghlan <ncoghlan at gmail.com> wrote:
>>> We also need to officially bless pip's trick of forcing the use of
>>> setuptools for distutils based setup.py files.
>> Do we? What does official blessing imply? We've managed for years without
>> the trick being "official"...
>>
>> The main reason it is currently used is to allow setup.py install to
>> specify --record, so that we can get the list of installed files. If
>> distutils added a --record flag, for example, I don't believe we'd need the
>> hack at all. (Obviously, we'd still need setuptools so we could use wheel
>> to build wheels, but that's somewhat different as it's a new feature).
>> Maybe a small distutils patch is better than blessing setuptools here?
>
> distutils’ install command provides --record.
Indeed it does. I've created a minimal pip-compatible setup.py here:
https://github.com/oscarbenjamin/setuppytest
https://github.com/oscarbenjamin/setuppytest/blob/master/setuppytest/setup.py
The parts that pip requires that are not included in distutils are:
1) The egg_info command.
2) Creating the .egg-info directory during the install command.
3) --single-version-externally-managed
I didn't test what happens if the sdist is installed to satisfy a
dependency (I'm not sure how to do that without uploading to PyPI) but
it presumably would do something different from
--single-version-externally-managed in that case.
The precise invocations that the setup.py needs to support are:
python setup.py egg_info --egg-base $EGG_DIRECTORY
$ python setup.py install --record $RECORD_FILE \
--single-version-externally-managed \
[--install-headers $HEADERS_DIR]
The --install-headers option is provided when installing into a virtualenv.
Oscar
More information about the Distutils-SIG
mailing list