Welcome to Pyramid
Pyramid is the internal website templating system used to build the python.org pages. (It is not connected to the Pyramid web framework, formerly named BFG, that's used with Pylons.)
Pyramid uses Nevow as its templating system and YAML as the format for its file based data. At the moment, Pyramid is closely tied with the python.org redesign project and is being used to build the site at http://www.python.org. See PythonWebsitePyramidUsersGuide for more information.
Pyramid has been tested on Debian, Ubuntu and Windows XP.
To check out and install pyramid:
svn co svn://pyramid.pollenation.net/pyramid/trunk pyramid-trunk cd pyramid-trunk python setup.py build sudo python setup.py install
Pyramid requires Python 2.4.
Pyramid also requires the following modules.
Important: Use the links at the bottom of this document to obtain the correct versions of the required packages:
- Zope Interfaces (required by Twisted)
- Twisted (I generally install the sumo package or see links below)
- Nevow (optionally use the egg in the PYTHONPATH set by exportpathCHANGEME.sh, but this is only for nevow 0.5.0)
- docutils (see links below)
- syck and pysyck (see links below)
- Beautiful Soup (see links below)
- xmldiff if you want to run the tests.
To install the Python packages (all but syck), do this:
python setup.py build sudo python setup.py install
To install syck, use the usual configure/make/install:
./configure make sudo make install
See PythonWebsitePyramidEggs for information on installing from eggs (tho I don't know if this is up to date).
Should be able to get away with Twisted Sumo windows installer http://twistedmatrix.com/projects/core/ (which includes zope interfaces as well as twisted and twisted web) and PySyck windows installer from xitology (which includes syck windows build)
XXX: Apparently, the exportpathCHANGEME.sh script is no longer used?
Once everything is installed, update the exportpathCHANGEME.sh script to point to your install location and try from the top pyramid subversion source directory:
XXX: Three tests are failing right now. I do know xmldiff is being used right now, but I don't know the accuracy of the rest.
This should pass nicely. (actually it may not as different installations spit out html attributes in different orders.. The unittests are being changed to perform xmldiff's to get around this - in the mean time as long as the diff that you see when you run the script looks very similar you should be ok). Note.. this is really a regression test rather than a unit test. The second test will probable show differences depending on what version of docutils that you are using.
For python.org-specific instructions, take a look at http://www.python.org/dev/pydotorg/website/.
If you have installed pyramid you should be able to use build.py as follows:
python <PATHTOPYRAMID>/pyramid/build.py -d testdata -o testout -v -R<rebuilddirs>
Be warned that the testout folder is emptied before being used. It won't delete any folders with .svn files in them. It will create the output folder if it doesn't already exist.
The basic instantwebserver works ok but needs fixing as it doesn't add a slash at the end of urls (anyone know how to do this?). When using instantwebserver, point your browser to http://localhost:8000/
Beginner's documentation is at:
The documentation has some python.org specific stuff in it but that is a good thing at the moment.
Debugging in Wing IDE
To debug pyramid in Wing IDE, set up a project, add pyramid (or a copy of it) as the "main debug file" and set the parameters and starting directory in the File Properties (right click on file or file's name in project view). This can help point at problems when running w/ -V doesn't provide enough info.
XXX: Are these *specific* versions required, or are more recent versions OK? The Twisted Sumo distribution includes Twisted Core 2.2.0. The Docutils development snapshot is a moving target (see the next FIXME note below).
We should specify version ranges where applicable, and allow the latest packages where possible.
TP: I'll check on this..
A requirement for Twisted
Twisted & Twisted Web
home page http://docutils.sourceforge.net/
syck & pysyck
You will need bison and yacc to build and install syck.
syck project page http://rubyforge.org/projects/syck/
We're now using the pysyck build from xitology.org - it's being used for dumping and reading YAML. The latest version should soon be in the rubyforge repository but for the moment can be obtained from the link below.
pysyck interface: http://xitology.org/pysyck
Download version 2.1.1 or later from http://www.crummy.com/software/BeautifulSoup/index.html#Download
xmldiff from logilab
If you are having problems getting pyramid to work, you might like to try the built in tests. The tests require comparing xml files and because of which we have another requirement for xmldiff
The python2.4-xmldiff (or python2.3-xmldiff) packages on debian/ubuntu work.
Please note that some versions of docutils build slightly different html and as such the 'testing firstpythontest' may fail but the system will still work. As long as the 'testing basic' wokrks then the system should be ok (or at least a vast majority of the system). Typical errors that may show up in the firstpythontest are entity encoding errors or changes in id's on links (due to docutils version differences).