[Distutils] EasyInstall: suggested usage patterns

Ian Bicking ianb at colorstudy.com
Thu Jun 16 07:41:11 CEST 2005


Phillip J. Eby wrote:
>> Deployment
>>
>> * I have developed a web application.  Maybe it also doesn't have a
>> distutils script...?
> 
> 
> Note that with setuptools, a setup script doesn't have to say much 
> besides metadata like name, version, author, etc.  You can use the 
> 'find_packages()' function to automatically include all packages 
> (perhaps excepting those that have been somehow marked as being checked 
> out by 'package.py develop'), so it's mostly a matter of listing scripts 
> and such.
> 
> Note, by the way, that information like author, license, and a number of 
> other things could easily be defaulted by a configuration file, too, if 
> set in e.g.  the ~/.pydistutils.cfg file on a per-user basis.

You mean when generating setup.py?  I wouldn't want the setup.py to 
simply omit these details and then pick them up from a configuration 
file.  I might forget to explicitly put those values in if that's the 
case, then someone else will get different values based on their 
environment.

>>  It could, though currently I don't develop one for
>> my web applications.  Also, I sometimes make hot fixes, especially when
>> the application is deployed but not yet live.
> 
> 
> Surely this could be done by deploying a project directory?

You mean, deploy the application as a checkout with the egg-info 
directory?  That's what I would be inclined to do.  But it should be 
explicit if this is the recommended way to deploy if you are expecting 
to do hot fixes.

>> * Some libraries are internal, and so aren't available from a public
>> location.  Maybe on the web with HTTP auth, though I'm more inclined to
>> simply keep them in a branch in the private repository.  Or fetch over 
>> scp.
> 
> 
> Sure; EasyInstall also supports "find_links" pages that list links to 
> source archives or eggs, so you can use this technique to access them 
> more easily by putting the download pages in your configuration file(s).

This might be useful to list in a ~/.pydistutils.cfg -- I could put the 
URL to some central page (for my company) that in turn pointed to places 
in a private repository.  Or even just to internally preferred/tested 
releases of other people's software (assuming that directory took 
precedence over PyPI when installing without an explicit version).

>> * Should I change my require()s to use a specific version of the
>> libraries, so that I don't accidentally upgrade (/break) the application
>> when a later application is installed?  How do I manage that process?
> 
> 
> That won't prevent breakage, if you end up with a conflict between the 
> versions required by multiple components.  Sadly, I have no silver 
> bullet for you regarding management.

Well, presumably I've tested my application in development, and I 
installed specific versions of packages during development.  If I could 
record the actual versions I installed (some of which had explicitly 
installed versions, and some which were just the most recent release) 
then I could duplicate that tested environment later when the most 
recent versions had changed.

-- 
Ian Bicking  /  ianb at colorstudy.com  / http://blog.ianbicking.org


More information about the Distutils-SIG mailing list