[Distutils] Q about best practices now (or near future)

Daniel Holth dholth at gmail.com
Thu Jul 18 18:53:09 CEST 2013

On Thu, Jul 18, 2013 at 12:12 PM, Marcus Smith <qwcode at gmail.com> wrote:
>> It would actually be nice if "pkg_resources" and "setuptools-core"
>> were available as separate PyPI distributions, and setuptools bundled
>> them together with easy_install. It's a *long* way down the priority
>> list thing (and will likely never make it to the top, although it may
>> be more practical once pip vendors the bits it needs).
> the idea to have pip vendor setuptools crumbles a bit due to console scripts
> needing pkg_resources.
> you're left with 2 poor solutions: 1) rewriting script import lines, or 2)
> still installing setuptools anyway
> so, having a separate pkg_resources is higher up on the list I think for
> that reason.
> without a separate pkg_resources, I think the "dynamic install of
> setuptools" idea wins out, or no change at all.

I think it's still useful to have pip vendor just pkg_resources (as
pip.pkg_resources). It's easy, it gives you enough to install wheels,
and it's not the only thing you would do. It shouldn't make much
difference whether the vendoring happens before or after
pkg_resource's separation. The trickiest parts might be adding the
undeclared pkg_resources / setuptools dependency when appropriate and
figuring out whether we can install setuptools even if it's not
available as a wheel.

Meanwhile someone might add a flag or a plugin to setuptools'
console_scripts handler to generate them in a different way.

I am not worried that 99.9% of pypi-hosted packages depend on
setuptools or distutils. It is enough to introduce only the
possibility of getting along without it. For the rest it is
appropriate to install and use setuptools to build packages that were
in fact designed to use it.

More information about the Distutils-SIG mailing list