Courant News: Installation


04.18.09 Posted in Courant News, Software Development by Max

I’ve been work­ing all day on mak­ing the instal­la­tion script for Courant, and am now writ­ing the doc­u­men­ta­tion files. So I thought I’d take a few min­utes to sum­ma­rize the process in antic­i­pa­tion of release in the com­ing week.

For your techies, some back­ground: We have been using Sub­ver­sion (svn) for source con­trol, but there’s been a push to move towards git. The biggest holdup had been our depen­dence on svn:externals to pull in some other projects with­out hav­ing to fork them, which is a pretty poor rea­son. As a result, I’ve been seek­ing ways to get rid of that last ves­tige of svn so that we could allow peo­ple to use git if they pre­fer that. We intend to con­tinue using svn for Courant’s core code­base, but we appre­ci­ate the fact that many devs pre­fer to use git for their work­flow, so we don’t want to pre­clude that.

As a result, I’ve been seek­ing a solu­tion to simul­ta­ne­ously get rid of svn:externals while also eas­ing the process of installing and using Courant. Some posts by the famous djang­o­naut James Ben­nett, along with look­ing at projects like Pinax, con­vinced me that such a solu­tion existed in pip with vir­tualenv. Vir­tualenv allows you to cre­ate an iso­lated envi­ron­ment on your com­puter in which you can install python pack­ages with­out it pol­lut­ing the rest of your sys­tem, while pip allows you to install python pack­ages from the Chesse­shop or from a repos­i­tory (sup­ports svn, git, bzr, and hg currently).

Now for every­one: To use Courant, you first have to install python (2.5 rec­om­mended), svn, git, and what­ever data­base engine you’d like to use (we strongly rec­om­mend Post­greSQL, but MySQL works too). From there, you just down­load one file from the Courant servers, courant-boot.py. Run­ning courant-boot.py with some options will install Courant and all of its python depen­den­cies, includ­ing Django and many oth­ers, inside a fresh vir­tualenv. It can also set up a clean copy of our sam­ple project, or it can check­out your own site project from an exter­nal repository.

python courant-boot.py myvirtualenv -n website -p default

That one com­mand will cre­ate a new vir­tualenv called “myvir­tualenv,” install every­thing, and make a copy of the “default” sam­ple project in a folder called “web­site.” For the YDN, I can replace “default” with the URL to our pri­vate SVN repos­i­tory, and it will check out the Courant-powered ver­sion of our site and be all ready to go. I don’t think it could be much sim­pler. It should work per­fectly well across all the major oper­at­ing sys­tems, and I have per­son­ally tested it on Ubuntu and Win­dows. I’ll get Paul to ver­ify it works on OSX before release.

More detailed instal­la­tion instruc­tions, includ­ing a num­ber of other options and instruc­tions for how to set things up for devel­op­ing on Courant itself, will be included in the project doc­u­men­ta­tion. This was one of our last hur­dles before pub­lic release, so once we final­ize some remain­ing details and get team con­sen­sus, we will be open­ing up the project site. Stay tuned.



One Response to “Courant News: Installation”

  1. Can’t you replace svn:externals with git submodules?

    I’m glad you’re mak­ing it super easy to install, since the lower the bar­rier to entry, the more peo­ple will try it out.

Leave a Reply