|
BuildingAndTestingPygr
Building pygr and running the tests
To run the tests, 'cd tests && python runtest.py -b'; omit -b to use in-place code instead of the build directory. runtest will fail out if it cannot import pygr from within the working directory, to avoid running the tests on the installed version. OverviewGenerally speaking, the following steps must be taken to build and install Pygr on your machine:
Installing PythonThis should be pretty straightforward. For ready-to-use binaries look to either your system's package repository (Linux, BSD, Fink, Cygwin, ...) or installers provided at Python.org (Windows, Mac OS X). If all else fails, you can always try building Python from source. Pygr should work correctly with any version of Python between 2.3 and 2.6, inclusive. Python 3.0 is not supported and no conversion has been planned yet, primarily because even its latest version (3.0.1) exhibits visibly worse I/O performance than the 2.x branch. Installing PyrexPygr extension code is written in Pyrex rather than plain C, making it necessary to have Pyrex code translated into C before the compiler can do its job. Official Pygr packages come with pre-build C files so if you want to install one of these, you may skip this step. Conversely, you will need Pyrex installed to build Pygr using the code from our Git repository. Pyrex hasn't been officially declared finished yet, which means two things to Pygr users: one is that you'll want the latest available version (as of now, 0.9.8.5) in order to avoid bugs, the other is that unless your system's software repositories contain new-enough Pyrex packages (many do - look for pyrex or python-pyrex), you'll need to build the module by hand. Fortunately the latter is very easy:
In case of Pygr Pyrex is only required at build time, it can safely be removed afterwards. The C Compiler etc.Pygr is not a pure-Python module and a C compiler, along with possible assistant tools, must be present at build time for it to finish successfully. You will also need Python's header files. How all these should be obtained depends a lot on the system you use:
Like Pyrex, both the compiler and the header files are build-time dependencies only. They can safely be removed afterwards. MySQL/SQLite SupportThe following Python modules must be present in your system in order for Pygr to support accessing MySQL and SQLite databases:
Both are fairly common in package repositories, and if all else fails they can be built from the source the same way as Pyrex (then again, note that building mysql-python is more complicated than most Python modules, especially under Windows - see here for details of the latter case). Note that Pygr only checks for SQL-related modules at run time - they needn't be present at the time of installation. BLAST SupportPygr uses standard command-line BLAST tools to provide BLAST support. To have this work:
Just like with SQL modules, Pygr only looks for BLAST tools at run time. Building and Installing PygrIf you want your Pygr installation to be system-wide, the procedure is exactly the same as for Pyrex - obtain the sources, enter the directory and run python setup.py install (possibly with -Ox). If however your installation is only to be local, you've got two options:
Testing Your BuildSource packages of Pygr come with a test suite which allows one to verify that your build runs correctly. To run then, cd to the subdirectory tests and run python runtest.py -b if you ran build or install earlier, or python runtest.py if you created an in-place build. Note that the test suite will abort if it cannot find appropriate files locally, i.e. in either the build subdirectory or in place - even if the very same version of Pygr is already present in Python path. This happens by design to avoid version mismatches between Pygr and the test suite. Running the tests will display some information pertaining to their progress, followed by a summary. If everything is right, all tests should pass. Depending of what optional components are present in your system you may observe some test suites having been skipped. PackagingInstead of installing Pygr into the local Python package tree using install one may opt to create an appropriate package and either install the package instead (e.g. to have Pygr under the control of a package manager) or share it with users who for either can't or don't want to build Pygr from source. A wide selection of binary packages of Pygr can be found on our Downloads page; to find out how to create packages of different formats or to learn more about how we build the provided ones, see the PackagingPygr Wiki page. Known IssuesThe setup script fails to invoke Pyrex correctly under Python 2.3/2.4 if setuptools are installed. Specifically, the following condition must be met for this bug to trigger:
|
Sign in to add a comment