[melbourne-pug] melbourne-pug Digest, Vol 93, Issue 8

Matthew Iversen teh.ivo at gmail.com
Thu Mar 6 12:27:33 CET 2014



>> I have been confused in the past in that setuptools is another
>> > package.
>> >
>> > Apparently setuptools is an add on for distutils?
> You're right to be confused; there's a lot of tangled history.
>
> The only things which affect us today:
>
> Current ?distutils? in the Python standard library has recently grown a
> lot of features that were once in the third-party ?setuptools?.
>
> The ?setuptools? library name is implemented by ?Distribute?, which was
> a fork but has now taken over as the active development for that code
> base. Any reference you see to using ?setuptools? can be implemented
> today by installing ?Distribute?.
No-one should be installing anything called `distribute` by choice any more.
Maybe for an older Linux distro, that's the best packaging library you
can get from the
distro's repository; but you can definitely get something better and
newer by installing setuptools yourself.

In 2013 distribute was merged into and subsumed by setuptools. Thus, the
only thing one needs to worry about
in 2014 is setuptools. If you are still installing distribute, you're
probably either installing a shim that actually installs
setuptools, or a very old 0.6 distribute.

I'm not sure why the choice was made, but I've seen lots of confusion
because `distribute` *used* to be the
"hot new thing to get" over `setuptools`, but it is in fact now the
opposite way around.

Details of the merge can be found at:
http://pythonhosted.org/setuptools/merge.html

Also see here for lots of correct and up to date knowledge on python
packaging in general:
https://python-packaging-user-guide.readthedocs.org

Anyway, to get the latest setuptools for any python environment, just
download and run
https://bitbucket.org/pypa/setuptools/raw/bootstrap/ez_setup.py
with python. (may need administrative privileges to install into system
python)

>
> In fact, many GNU+Linux distributions simply make Distribute available
> as the package name ?python-setuptools? for backward compatibility.
>
>> > http://stackoverflow.com/questions/10712809/how-to-require-and-install-a-package-using-python-3-x-distutils
>> >
>> > Is the information in this post on requires not working with distutils
>> > without setuptools still correct?
> Correct; Python's standard library ?distutils? still doesn't implement
> any of the ?pkg_resources? functionality, and you need third-party
> library (?Distribute?, available by the package name ?setuptools?) if
> you want that.
>
> Most packages don't need that functionality merely to *be installed*, so
> it's not essential and isn't in the standard library.
>
> But getting the library's own installed version string, which IMO is
> needed by any decent library, is part of that functionality deemed ?not
> essential? and not available in ?distutils?. So either you end up
> re-implementing it (badly), or you have to depend on the third-party
> ?pkg_resources? functionality anyway.
>
> -- \ ?Faith, n. Belief without evidence in what is told by one who |
> `\ speaks without knowledge, of things without parallel.? ?Ambrose |
> _o__) Bierce, _The Devil's Dictionary_, 1906 | Ben Finney

Vinay Sajip has also been developing a new library for low level
packaging stuff, called distlib, in case anyone's interested.
https://pypi.python.org/pypi/distlib

Cheers, Matt

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/melbourne-pug/attachments/20140306/afbf446d/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: OpenPGP digital signature
URL: <http://mail.python.org/pipermail/melbourne-pug/attachments/20140306/afbf446d/attachment.sig>


More information about the melbourne-pug mailing list