The Artima Developer Community
Sponsored Link

Python Buzz Forum
workingenv revisited

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Ian Bicking

Posts: 900
Nickname: ianb
Registered: Apr, 2003

Ian Bicking is a freelance programmer
workingenv revisited Posted: May 28, 2006 7:15 PM
Reply to this message Reply

This post originated from an RSS feed registered with Python Buzz by Ian Bicking.
Original Post: workingenv revisited
Feed Title: Ian Bicking
Feed URL: http://www.ianbicking.org/feeds/atom.xml
Feed Description: Thoughts on Python and Programming.
Latest Python Buzz Posts
Latest Python Buzz Posts by Ian Bicking
Latest Posts From Ian Bicking

Advertisement

I did some work on the script I mentioned previously for setting up environments (as an alternative to virtual-python.py. I also moved it slightly, to http://svn.colorstudy.com/home/ianb/workingenv

It now plays nicely with Setuptools. Well, maybe that's an exaggeration; at least the two are talking again.

Here's the way it basically works:

$ wget http://svn.colorstudy.com/home/ianb/workingenv/workingenv.py
$ python workingenv.py new-environ/
$ source new-environ/bin/activate

Now everything you do will use the libraries installed in new-environ/ (and no other libraries!), and new libraries will be installed into that location (until you deactivate). Any scripts installed will go in the new-environ/bin/ directory, and (at least if you are using Setuptools) will implicitly activate the environment whenever they are invoked. The explicit activation should (hopefully) only be necessary during development.

activate doesn't do anything fancy, just update $PYTHONPATH to include new-environ/lib/python2.4. Setuptools doesn't need to be installed (if it isn't, it will be installed for you). It should work with Python 2.3, but probably not earlier.

I also added a notion of a requirements listing for a new environment, basically a list of packages to be installed. Admittedly this is only loosely related to the installation. But anyway, you can use this to quickly set up a nice fresh environment. Since the TurboGears people have been thinking about this some (though admittedly I haven't read through the discussion) I threw together a couple half-assed examples for 0.8 and 0.9. It goes like:

$ python workingenv.py -r \
  http://svn.colorstudy.com/home/ianb/workingenv/tg-example.txt \
  new-environ/

This reads that text file, gets requirements out of it (including a --find-links setting), and installs everything. The advantage of this is that the requirements listing isn't associated with any one package. It can have highly constrained requirements (i.e., exact versions), but this doesn't cause a cascade of changes when a single package is updated. Also, the requirements are only checked at installation, they aren't checked at runtime, so you can manually install other versions for testing and development without getting conflicts.

Read: workingenv revisited

Topic: As the world wakes up… Previous Topic   Next Topic Topic: Microcontent is Everywhere

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use