I have been using Trac for a while now, and having published some plugins for it, I need an environment where I can test them with different version of Python and of Trac.
So today I set up on both Ubuntu and Windows 7 an environment where Pyhton 2.5 and 2.6 and Trac 0.11 and 0.12 coexist.
The simple procedure I used on Windows doesn't require adminstrator privileges.
Here is is:
1) Downloaded Python 2.5 and 2.6 portable edition from here:
2) Run both installers, and for the destination directories specify, for example:
c:\Python\Python2.5
and
c:\Python\Python2.6
3) Download Trac 0.11 and 0.12 source archives, as tar.gz files and extract them (for example with 7Zip) in separate directories, for example:
c:\Users\Roberto\Downloads\Trac011
and
c:\Users\Roberto\Downloads\Trac012
Then, setup the two pythons. Let's start for example with Python 2.5.
4) Open a command prompt, add to the local PATH variable the Python "App" subdirectory:
set PATH=c:\Python\Python2.5\App;%PATH%
5) Install virtualenv, a python component to manage multiple segregated python environments. Note: you will need internet connection to do this.
python -m easy_install virtualenv
6) Create two environments, for Trac 0.11 and Trac 012 under Python 2.5, for example under your home directory into "Py25Trac011" and "Py25Trac012":
python -m virtualenv Py25Trac011
python -m virtualenv Py25Trac012
The, install Trac 0.11 and Trac 012 in the corresponding virtual envs. Let's start with 0.11.
7) First, you need to set up environment variables to point to the virtual environment of choice:
cmd /k Py25Trac011\Scripts\activate.bat
You will notice that your command prompt text will now display "Py25Trac011", to remind you the virtual environment you are using.
8) Install Trac 0.11 in the virtual environment. Note: you will need internet connection to do this, as some packages will be downloaded and installed into the virtual environment.
cd c:\Users\Roberto\Downloads\Trac011
python setup.py install
This is the basic flow for one Python version and one Trac version.
You can now repeat step 7) and 8) to install Trac 0.12 under Python 2.5.
Note: Use a different command prompt to set up the environment variables (step 7) for each virtual environment, to avoid conflicts. And remeber to first add the Python version of choice to your PATH variable first (step 4).
You can then repeat steps 4) to 8) to setup virtual environments for Trac 0.11 and Trac 0.12 under Python 2.6.
Remember that every time you will want to run one version of Trac with one version of Python, you will need to do two things:
1) Set your PATH variable to the correct Python (step 4)
2) Set your enviuronment variables to the correct virtual environment (step 7)
Only then you can, for example, start your tracd daemon.
You may want to create four different batch scripts to automate this recurring environment setup.
