[Python-Dev] setuptools in 2.5. (summary) (original) (raw)

M.-A. Lemburg mal at egenix.com
Thu Apr 20 15:47:47 CEST 2006


Anthony Baxter wrote:

In an attempt to help this thread reach some sort of resolution, here's a collection of arguments against and in favour of setuptools in 2.5. My conclusions are at the end.

Thanks for the summary. I'd like to add some important aspects (for me at least) that are missing:

The arguments against:

- Someone should instead just fix distutils. Right. And the amount of yelling if distutils changed in a non-b/w compat way wouldn't be high. There's also the basic problem that the distutils code is horrible. - It monkeypatches pydoc and distutils! It only monkeypatches pydoc when the separate setuptools installer is used on older Pythons. How is this relevant for this discussion of Python 2.5? The monkeypatching for distutils should be reduced - see AMK's message for a breakdown of this. - Documentation beaker% pydoc xmlcore.etree no Python documentation found for 'xmlcore.etree' beaker% pydoc ctypes no Python documentation found for 'ctypes' The documentation (of which there is plenty) can and will be folded into the standard python docs. Most of the new modules in 2.5 went in before their docs. - Where's the PEP? I don't see the need. The stuff that could go into a PEP about formats and the like should go into the existing Distutils documentation. It's a far more useful place, and many more people are likely to find it there than in a PEP.

The PEP is needed to document the current discussion, not the setuptools technical documentation (this should of course go into the standard Python documentation).

Your summary along with the opinions of the ones who have commented it would be a good start. The PEP should also include the lists of things Martin and Fredrik have put forward.

Finally, the goal of the PEP should be to list the steps needed to integrate setuptools into the stdlib.

- It's a huge amount of code (or "ball of mud"), or, it adds too many features.

Most of these have been added over the last 2 years in response to feedback and requests from people on distutils-sig. There's been an obvious pent-up demand for a bunch of this work, and now that someone's working on it, these can get done. - It will break existing setup.py scripts! No it won't. If you don't type the letters 'import setuptools' into your setup.py, it won't be affected. - Rewriting from scratch is bad This isn't a rewrite - it's built on top of distutils. (An aside, I don't buy the "never rewrite" argument. As I mentioned in an earlier message, look at urllib2, twisted and email for starters. In addition, look at Firefox, Windows XP, and Mac OSX. Hell, Linux could be considered a rewrite of Minix, once upon a time.) - Eggs are inferior to distribution-specific packaging Not all operating systems have a decent packaging system. The ones that do, don't support multiple versions of the same library. In addition, there's no reason why existing packaging systems can't just bundle up the code as they do now - if they also add a .egg-info file to the packages, that would be even better! Finally, these don't support user installation of software. This is particularly useful in a hosting environment.

I think you're misrepresenting the argument here: eggs are not considered inferior. What packagers and application builders gripe about is the fact that setuptools forces them to use eggs instead of the standard Python way of installing packages.

I don't think anyone would be bothered by adding dependency information to their packages and thus make easy_install and friends work with regular Python packages as well.

And now let's look at some of the stuff that setuptools gives us:

- We have a CPAN-type system I do quite a number of Python talks, and this is always one of the most requested features. There's been many attempts to write this, none have been completed until now. If you honestly don't see that this is a big thing for Python, then I am very, very suprised. I suspect that this will be the #1 new feature of Python 2.5 that the users will notice and be happy about. - Multiple installs of different versions of the same package, including per-user installs. Again, as Python gets more widely used, this becomes a big issue. Sure, it's not necessarily a killer argument for python-dev, but stuff that's added to Python shouldn't just be just for the use of python-dev. The multiple installed versions feature also avoids the CPAN dependency hell problem - back when I used to work with Perl, this was a constant source of nightmarish problems.

I've never had a need for having multiple versions of a single package installed, so can't comment.

User installation is certainly possible with stock distutils.

The main problem with distutils is the lack of user documentation, not so much the lack of features.

- The "develop" mode

This makes life that bit less painful all-round.

Does it ? I usually point PYTHONPATH at my development tree and that's all it takes to do setup "develop" mode.

- The plugin/extension support

Extending distutils currently is a total pain in the arse.

Views differ on this one and most of this perception is due to missing distutils documentation.

- Backwards compatibility

easyinstall even works with existing packages that use traditional distutils, so long as they're in the Cheeseshop. Damn, this is nice. If you don't want to do the work to change your installation code, don't bother - it will still be useful. The conclusions: I'm a little suprised by the amount of fear and loathing this has generated. To me, there are such obvious benefits that I don't see why people are so vehemently against setuptools. I haven't seen any arguments that have convinced me that this isn't the right thing to do. Yes, there's still work to be done - but hell, we've only released the first alpha so far. For inclusion in the standard library, the usual benchmark is that the code offers useful functionality, and that it be the "best of breed". setuptools clearly meets these two criteria. (Ok, it's really "only of breed", but that also makes it "best", by default ). It's also been under development for over 2 years - according to svn, 0.0.1 was checked into svn back in March 2004. I'm also suprised by how much some people seem to think that the current state of distutils functionality is acceptable or desirable. It's not - it's a mess. Finally, I'd like to point out that I think some of the hostility towards Phillip's work has been excessive. He's done an amazing amount of work on this (look at the distutils-sig archive for the last two years for more), and produced something that's very very useful. He deserves far more credit for this than he seems to have been getting here.

He does and there's no doubt about it.

It would help a lot, though, if Phillip would be willing to reconsider some defaults he's using in setuptools to make them compatible to Python's default import mechanism.

A lot of the perceived hostility would go away if he'd play nice with standards that have existed in Python for years.

If Phillip thinks that we should change Python to always import packages from egg-files, then this would be a major change in the way Python works and thus require a complete PEP process.

-- Marc-Andre Lemburg eGenix.com

Professional Python Services directly from the Source (#1, Apr 20 2006)

Python/Zope Consulting and Support ... http://www.egenix.com/ mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/ mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/


::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! ::::



More information about the Python-Dev mailing list