[Distutils] it's happened - wheels without sdists (flit)

Daniel Holth dholth at gmail.com
Tue Mar 31 14:20:25 CEST 2015


Most sdists already have static metadata in the form of a PKG-INFO
file or an .egg-info directory. If it has dependencies it's almost
guaranteed to have .egg-info because distutils does not support
dependencies. The only problem is that the static metadata is not
trustworthy because the dependencies often change based on the target
environment as detected in setup.py. To work reliably pip has to
execute setup.py before it can download a package's install_requires.
If we want to improve the dependency resolver we would need to put
install_requires in a static file and promise that it was actually
static.

On Tue, Mar 31, 2015 at 8:06 AM, Nick Coghlan <ncoghlan at gmail.com> wrote:
> On 31 March 2015 at 17:10, Paul Moore <p.f.moore at gmail.com> wrote:
>> On 31 March 2015 at 08:04, Paul Moore <p.f.moore at gmail.com> wrote:
>>> On 30 March 2015 at 16:56, Donald Stufft <donald at stufft.io> wrote:
>>>> Honestly, I don’t think that setup.py as a development interface is that
>>>> bad. It gets really bad when we start sticking it inside of a sdist and
>>>> using that as part of the installation metadata.
>>>>
>>>> It’s not unusual for me to want (or need) to do something a little bit
>>>> different in a project, or something that the original authors didn’t
>>>> quite intend to do. This is perfectly valid and fine inside of a file
>>>> that only ever gets executed on a developer machine. However it *needs*
>>>> to be “compiled” down to a static file when creating a sdist.
>>>
>>> Hmm, I don't think I'd ever really understood the distinction between
>>> "development setup" and "sdist" that clearly. I take your point, it's
>>> the sdist level that we want to avoid executable metadata formats in.
>>
>> Thinking some more about that, my confusion is probably in part
>> because pip doesn't distinguish between a "development directory" and
>> a sdist at the moment. For both, it runs "setup.py
>> bdist_wheel/install". So I guess work on a new sdist format would have
>> to include pip learning to distinguish between a sdist and a working
>> directory, and installing (or building wheels from) the two things
>> differently.
>
> Yep, the current PEP 426 draft suggests that sdists should grow a
> "dist-info" directory (akin to wheel files and installed packages),
> while development directories would continue to lack any of the
> generated metadata.
>
> Cheers,
> Nick.
>
> --
> Nick Coghlan   |   ncoghlan at gmail.com   |   Brisbane, Australia
> _______________________________________________
> Distutils-SIG maillist  -  Distutils-SIG at python.org
> https://mail.python.org/mailman/listinfo/distutils-sig


More information about the Distutils-SIG mailing list