Re: [Distutils] should setuptools be an implicit dependency of every egg?

2006-09-20 Thread Martijn Faassen
Tres Seaver wrote:
 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA1
 
 Jim Fulton wrote:
 
 These downsides are, in practice, pretty minor.  My main objection is  
 that I don't like encouraging people to be sloppy about  
 dependencies.  The counter argument, of course, is that the standard  
 library is an implicit dependency and we are behaving as if  
 setuptools is part of the standard library.
 
 Perhaps we need a lint-like utility ('candle.py', perhaps :) which
 examines a given egg, looking for issues such as imports from packages
 which are not in a path synthesized from the egg's dependencies?

That'd be useful. It'd be especially useful if it were integrated into 
setuptools, as that way it's a bit more likely people will actually use it.

Regards,

Martijn
___
Distutils-SIG maillist  -  Distutils-SIG@python.org
http://mail.python.org/mailman/listinfo/distutils-sig


Re: [Distutils] should setuptools be an implicit dependency of every egg?

2006-09-20 Thread Jim Fulton

On Sep 19, 2006, at 8:11 AM, Jim Fulton wrote:
...
 Note that the scripts generated by zc.buildout don't use
 pkg_resources to determine the eggs to be loaded at run time.

It's also worth noting that the eggs documentation, http:// 
peak.telecommunity.com/DevCenter/PythonEggs, explicitly advertises  
that setuptools is not needed to use eggs:

   If you have a pure-Python .egg file that doesn't use any in- 
package data files, and you don't mind manually placing it on  
sys.path or PYTHONPATH, you can use the egg without installing  
setuptools. 

I'm going to start with the following compromise in zc.buildout.  If  
an egg uses namespace packages, then I'll treat setuptools as a  
dependency of the egg even if the egg doesn't list it as a  
dependency.  This will address the common case of eggs using  
setuptools soley for namespace-package support.

Jim

--
Jim Fulton  mailto:[EMAIL PROTECTED]Python 
Powered!
CTO (540) 361-1714  
http://www.python.org
Zope Corporationhttp://www.zope.com http://www.zope.org



___
Distutils-SIG maillist  -  Distutils-SIG@python.org
http://mail.python.org/mailman/listinfo/distutils-sig


[Distutils] should setuptools be an implicit dependency of every egg?

2006-09-19 Thread Martijn Faassen
Hi there,

Normally setuptools is installed system-wide. When you install an egg 
using easy_install, the egg itself can count on setuptools being 
available, and use for instance its resource management API and 
namespace package marking facility. It therefore is unnecessary to users 
to mark setuptools as a dependency to their eggs in setup.py. Since it's 
unnecessary, it'll just not be done.

This works fine in the case of system-wide installation of setuptools, 
but when installing eggs locally, such as in Buildout, this can lead to 
problems. Buildout makes sure that only eggs that are dependencies are 
importable when starting up a script. An egg that is depending on 
setuptools implicitly will therefore not have access to setuptools 
facilities.

Telling everybody who makes eggs that use setuptools to please take 
Buildout into account and include setuptools as an explicit dependency 
in setup.py seems like a hopeless exercise, as things will just plain 
work for most egg users and developers, at least until the possible 
eventuality of Buildout reaching critical mass in the community.

What would work for Buildout, and as far as I can see does no harm to 
everybody else, is to make setuptools an implicit dependency of all 
eggs. It won't affect anyone else (but for a hopefully tiny performance 
impact) as setuptools is definitely available on the system when 
installing the egg through easy_install anyway.

So, would this be something that could be added to setuptools?

Regards,

Martijn
___
Distutils-SIG maillist  -  Distutils-SIG@python.org
http://mail.python.org/mailman/listinfo/distutils-sig


Re: [Distutils] should setuptools be an implicit dependency of every egg?

2006-09-19 Thread Bob Ippolito
On 9/19/06, Martijn Faassen [EMAIL PROTECTED] wrote:

 Normally setuptools is installed system-wide. When you install an egg
 using easy_install, the egg itself can count on setuptools being
 available, and use for instance its resource management API and
 namespace package marking facility. It therefore is unnecessary to users
 to mark setuptools as a dependency to their eggs in setup.py. Since it's
 unnecessary, it'll just not be done.

..
 So, would this be something that could be added to setuptools?

+1

-bob
___
Distutils-SIG maillist  -  Distutils-SIG@python.org
http://mail.python.org/mailman/listinfo/distutils-sig


Re: [Distutils] should setuptools be an implicit dependency of every egg?

2006-09-19 Thread Jim Fulton

On Sep 19, 2006, at 5:43 AM, Martijn Faassen wrote:

 Hi there,

 Normally setuptools is installed system-wide. When you install an egg
 using easy_install, the egg itself can count on setuptools being
 available, and use for instance its resource management API and
 namespace package marking facility. It therefore is unnecessary to  
 users
 to mark setuptools as a dependency to their eggs in setup.py. Since  
 it's
 unnecessary, it'll just not be done.

 This works fine in the case of system-wide installation of setuptools,
 but when installing eggs locally, such as in Buildout, this can  
 lead to
 problems. Buildout makes sure that only eggs that are dependencies are
 importable when starting up a script. An egg that is depending on
 setuptools implicitly will therefore not have access to setuptools
 facilities.

Note that the scripts generated by zc.buildout don't use  
pkg_resources to determine the eggs to be loaded at run time.  The  
needed eggs are computed at install time and their locations are  
written into the script.  If a script doesn't need setuptools (as  
determined from egg dependencies), then setuptools is not included in  
the script path.  Unfortunately, many eggs that do import  
pkg_resurces or setuptools don't bother to list setuptools as a  
dependency.

 Telling everybody who makes eggs that use setuptools to please take
 Buildout into account and include setuptools as an explicit dependency
 in setup.py seems like a hopeless exercise, as things will just plain
 work for most egg users and developers, at least until the possible
 eventuality of Buildout reaching critical mass in the community.

I would put this differently.  I would ask people to be accurate  
about their dependencies rather than implicitly assuming that  
setuptools is around.

 What would work for Buildout, and as far as I can see does no harm to
 everybody else, is to make setuptools an implicit dependency of all
 eggs. It won't affect anyone else (but for a hopefully tiny  
 performance
 impact) as setuptools is definitely available on the system when
 installing the egg through easy_install anyway.

setuptools is avaialble to buildout, because buildout uses it.  The  
small downsides of making setuptools an implicit dependency of every  
egg is that:

- setuptools will be included in the path of every script even when  
not needed.  This probably has a tiny performance penalty.

- setuptools will be downloaded an installed in some cases where it  
isn't needed.  zc.buildout can install scripts for versions of Python  
other than that used to run zc.buildout.  For example, you could run  
zc.buildout with Python2.4 and asl it to install a Python 2.3  
script.  We actually do this on occasion when we use buildout to  
install applications that don't support Python 2.4. These  
applications generally don't use setuptools, but I might still have  
to install setuptools just because we consider every egg, implicitly  
to depending on it.

These downsides are, in practice, pretty minor.  My main objection is  
that I don't like encouraging people to be sloppy about  
dependencies.  The counter argument, of course, is that the standard  
library is an implicit dependency and we are behaving as if  
setuptools is part of the standard library.


 So, would this be something that could be added to setuptools?

Nothing would have to change in setuptools.  If we agree that  
setuptools is an implicit requirement of every egg, even if the egg  
never imports anything from the setuptools egg, then I'll modify  
zc.buildout to include setuptools in the path of every script.

Jim

--
Jim Fulton  mailto:[EMAIL PROTECTED]Python 
Powered!
CTO (540) 361-1714  
http://www.python.org
Zope Corporationhttp://www.zope.com http://www.zope.org



___
Distutils-SIG maillist  -  Distutils-SIG@python.org
http://mail.python.org/mailman/listinfo/distutils-sig


Re: [Distutils] should setuptools be an implicit dependency of every egg?

2006-09-19 Thread Tres Seaver
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Jim Fulton wrote:

 These downsides are, in practice, pretty minor.  My main objection is  
 that I don't like encouraging people to be sloppy about  
 dependencies.  The counter argument, of course, is that the standard  
 library is an implicit dependency and we are behaving as if  
 setuptools is part of the standard library.

Perhaps we need a lint-like utility ('candle.py', perhaps :) which
examines a given egg, looking for issues such as imports from packages
which are not in a path synthesized from the egg's dependencies?


Tres.
- --
===
Tres Seaver  +1 202-558-7113  [EMAIL PROTECTED]
Palladion Software   Excellence by Designhttp://palladion.com
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.2.2 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFFECcW+gerLs4ltQ4RAuLaAKDOUslXaXEkF6Wfm1ZuQNjvCZvtzACfQBPU
MjwS1kpOSpPzJPw6UWyiXaY=
=EMPe
-END PGP SIGNATURE-

___
Distutils-SIG maillist  -  Distutils-SIG@python.org
http://mail.python.org/mailman/listinfo/distutils-sig