Ian Bicking: the old part of his blog

Testing Install Procedures

I've been trying to test installation procedures for Paste as I get ready for a release. This is hard, because I've installed everything piecewise as I've been doing development.

So I've created a script to set up a non-root installation of Python, suitable for testing installation procedures. It follows the instructions located in the setuptools documentation; it's located in non_root_python.py.

To do testing I've created a new user on my system, so I don't mix things up with my normal development, and so I have nothing to lose. Then I use it like:

/usr/bin/python non_root_python.py --no-site-packages --clear

In the process it copies (symlinks) the standard library into ~/lib/pythonX.Y (and site-packages unless you use --no-site-packages).

The --clear argument can be used to reset the system quickly, so you can restart your installation process from zero.

I also use --include-package=sqlite --include-package=_sqlite to copy those modules/packages from site-packages, because easy_install doesn't install pysqlite very well.

You have to make sure ~/bin is first in your $PATH, but it's pretty straight-forward. I'll have to test the Windows installation procedure later.

Created 26 Sep '05


This whole project sounds so cool. I agree with the people who think you're taking python to the next level of usability and power. Very impressive work. Thank you.

I just have to find the time to figure out just what it is you're actually doing <g>. (I know the basics from following this blog. I mean actually finding the time to do those detail tasks like RTFM/browse the source code and examples to learn how to really use this beast).

# Bob Joad

Hello, Ian.

I'm on a Windows XP box and 'd like to trial your installation procedure.

Should I just use trunk from SVN?

# Max Ischenko

Hi Max. The instructions in this document should more-or-less work, including installing the application itself; that would be a good place to start:


The Subversion repository will be moving around a little (probably tonight) as I put in place the newly refactored core Paste project.

# Ian Bicking

And definitely tell me how it goes, I'm quite curious. Platform issues always catch me where I least expect them.

# Ian Bicking

Hmm, I wanted to start simple, but the following command failed:

D:\Projects\3rd-party\paste\bin>easy_install.py -v -f http://pythonpaste.org/package_index.html \
   --script-dir=bin    PasteWebKit ZPTKit 'SQLObject>=0.7a' WSGIUtils
error: Could not find distribution for Requirement('PasteWebKit', [], ())

I checked package index by hand, it looks fine.

# Max Ischenko

We've done something remotely like this in PDK. Our acceptance test framework runs each test in a freshly installed sandbox. The sandbox is a temporary directory and the process running in the sandbox has PATH and PYTHONPATH set.

Our system is written in bash. Bash has been a nice choice for us as our application is command line based. What better test environment than the shell? The framework is just a quick hack that I knocked out. It has been expanded to run tests in parallel, have pretty green/read pass/fail indicators, etc.

The best thing I did was _not_ log output from the tests by default. Because of that debugging is often as simple as placing a sh invocation in the middle of a test. That gives you an interactive shell in the sandbox at the requested point. This is so convenient that I don't run pdk from my development directory. I virtually always invoke it from an acceptance test sandbox.


-- Darrin

# Darrin Thompson