131 lines
4.0 KiB
Plaintext
131 lines
4.0 KiB
Plaintext
|
..
|
||
|
==============
|
||
|
Downloading
|
||
|
==============
|
||
|
|
||
|
.. _`PyPI project page`: http://pypi.python.org/pypi/py/
|
||
|
|
||
|
Latest Release, see `PyPI project page`_
|
||
|
|
||
|
using easy_install (via Distribute or setuptools)
|
||
|
===================================================
|
||
|
|
||
|
It is recommended to use `Distribute for installation`_ as a drop-in
|
||
|
replacement for setuptools_. While setuptools should work well on
|
||
|
Python2 versions, `Distribute`_ allows to install py.test on Python3
|
||
|
and it avoids issue on Windows. With either packaging system
|
||
|
you can type::
|
||
|
|
||
|
easy_install -U py
|
||
|
|
||
|
to get the latest release of the py lib and py.test. The ``-U`` switch
|
||
|
will trigger an upgrade if you already have an older version installed.
|
||
|
On Linux systems you may need to execute the command as superuser and
|
||
|
on Windows you might need to write down the full path to ``easy_install``.
|
||
|
|
||
|
The py lib and its tools are expected to work well on Linux,
|
||
|
Windows and OSX, Python versions 2.4, 2.5, 2.6 through to
|
||
|
the Python3 versions 3.0 and 3.1. Jython
|
||
|
|
||
|
.. _mercurial: http://mercurial.selenic.com/wiki/
|
||
|
.. _`Distribute`:
|
||
|
.. _`Distribute for installation`: http://pypi.python.org/pypi/distribute#installation-instructions
|
||
|
.. _`distribute installation`: http://pypi.python.org/pypi/distribute
|
||
|
.. _checkout:
|
||
|
.. _tarball:
|
||
|
|
||
|
Working from version control or a tarball
|
||
|
=================================================
|
||
|
|
||
|
To follow development or help with fixing things
|
||
|
for the next release, checkout the complete code
|
||
|
and documentation source with mercurial_::
|
||
|
|
||
|
hg clone https://bitbucket.org/hpk42/py-trunk/
|
||
|
|
||
|
This currrently contains a 1.0.x branch and the
|
||
|
default 'trunk' branch where mainline development
|
||
|
takes place.
|
||
|
|
||
|
.. There also is a readonly subversion
|
||
|
checkout available which contains the latest release::
|
||
|
svn co https://codespeak.net/svn/py/dist
|
||
|
|
||
|
You can go to the python package index and
|
||
|
download and unpack a TAR file::
|
||
|
|
||
|
http://pypi.python.org/pypi/py/
|
||
|
|
||
|
|
||
|
activating a checkout with setuptools
|
||
|
--------------------------------------------
|
||
|
|
||
|
With a working `Distribute`_ or setuptools_ installation you can type::
|
||
|
|
||
|
python setup.py develop
|
||
|
|
||
|
in order to work with the tools and the lib of your checkout.
|
||
|
|
||
|
.. _`no-setuptools`:
|
||
|
|
||
|
.. _`directly use a checkout`:
|
||
|
|
||
|
directly use a checkout or tarball
|
||
|
-------------------------------------------------------------
|
||
|
|
||
|
Once you got yourself a checkout_ or tarball_ you only need to
|
||
|
set ``PYTHONPATH`` and ``PATH`` environment variables.
|
||
|
It is usually a good idea to add the parent directory of the ``py`` package
|
||
|
directory to your ``PYTHONPATH`` and ``py/bin`` or ``py\bin\win32`` to your
|
||
|
system wide ``PATH`` settings. There are helper scripts that set ``PYTHONPATH`` and ``PATH`` on your system:
|
||
|
|
||
|
on windows execute::
|
||
|
|
||
|
# inside autoexec.bat or shell startup
|
||
|
c:\\path\to\checkout\bin\env.cmd
|
||
|
|
||
|
on linux/OSX add this to your shell initialization::
|
||
|
|
||
|
# inside .bashrc
|
||
|
eval `python ~/path/to/checkout/bin/env.py`
|
||
|
|
||
|
both of which which will get you good settings
|
||
|
for ``PYTHONPATH`` and ``PATH``.
|
||
|
|
||
|
|
||
|
note: scripts look for "nearby" py-lib
|
||
|
-----------------------------------------------------
|
||
|
|
||
|
Note that all `command line scripts`_ will look
|
||
|
for "nearby" py libs, so if you have a layout like this::
|
||
|
|
||
|
mypkg/
|
||
|
subpkg1/
|
||
|
tests/
|
||
|
tests/
|
||
|
py/
|
||
|
|
||
|
issuing ``py.test subpkg1`` will use the py lib
|
||
|
from that projects root directory.
|
||
|
|
||
|
.. _`command line scripts`: bin.html
|
||
|
|
||
|
Debian and RPM packages
|
||
|
===================================
|
||
|
|
||
|
As of August 2009 pytest/pylib 1.0 RPMs and Debian packages
|
||
|
are not available. You will only find 0.9 versions -
|
||
|
on Debian systems look for ``python-codespeak-lib``
|
||
|
and Dwayne Bailey has put together a Fedora `RPM`_.
|
||
|
|
||
|
If you can help with providing/upgrading distribution
|
||
|
packages please use of the contact_ channels in case
|
||
|
of questions or need for changes.
|
||
|
|
||
|
.. _contact: contact.html
|
||
|
|
||
|
.. _`RPM`: http://translate.sourceforge.net/releases/testing/fedora/pylib-0.9.2-1.fc9.noarch.rpm
|
||
|
|
||
|
.. _`setuptools`: http://pypi.python.org/pypi/setuptools
|
||
|
|