.. moduleauthor:: Paul Ross .. sectionauthor:: Paul Ross .. Downloading and installing CPIP ####################################### Installing CPIP ####################################### ******************************************* Requirements ******************************************* For cpip will need to have installed (with links): * `Python `_ Thats it! CPIP has been tested with Python 2.7 and 3.3. CPIP used to run just fine on Windows but I haven't had a recent opportunity (or reason) to test CPIP on a Windows box. ******************************************* Download ******************************************* cpip's project page is at http://sourceforge.net/projects/cpip/ [#]_. From there you can either download an archive from the files section or pull the latest source from the repository. In any case you will unzip or clone/pull to a *directory* of your choice on your machine referred to hereon as :file:`{}`. From a Release ======================== Releases are made irregularly and they are on the `downloads page `_. Select the release that you want and unpack the file to your directory :file:`{}` From the Hg Repo =========================== The Mercurial repository has the most up-to-date code, get it with:: $ mkdir $ cd $ hg clone http://hg.code.sf.net/p/cpip/code . ******************************************* Installing and Testing ******************************************* Follow this to test that your installation of CPIP works. Installing ================== Setting the Environment -------------------------- Put :file:`{}` on your ``$PYTHONPATH`` Testing ============================ To make sure that cpip can be imported from your ``$PYTHONPATH`` do this:: $ python3 Python 3.2 (r32:88452, Feb 20 2011, 11:12:31) [GCC 4.2.1 (Apple Inc. build 5664)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> import cpip >>> dir(cpip) ['CPIP_VERSION', 'ExceptionCpip', 'RELEASE_NOTES', '__all__', '__author__', '__builtins__', '__cached__', '__date__', '__doc__', '__file__', '__name__', '__package__', '__path__', '__rights__', '__version__'] >>> cpip.CPIP_VERSION (0, 9, 1) >>> Unit Testing -------------------------- To run all the unit tests in the core:: $ cd $ python3 core/test/UnitTest.py Testing the Demo Code -------------------------- See the :ref:`cpip.tutorial.PpLexer` for an example of running a CPIP ``PpLexer`` on the demonstration code. This gives the core CPIP software a good workout. .. rubric:: Footnotes .. [#] Our home page that has, among other things, this *very fine documentation* is at http://cpip.sourceforge.net