2009-04-02 15:10:16 +08:00
|
|
|
==============
|
|
|
|
Downloading
|
|
|
|
==============
|
|
|
|
|
2009-06-24 23:47:29 +08:00
|
|
|
.. _`PyPI project page`: http://pypi.python.org/pypi/py/
|
2009-06-19 19:05:44 +08:00
|
|
|
|
|
|
|
Latest Release, see `PyPI project page`_
|
2009-06-19 18:19:59 +08:00
|
|
|
|
2009-07-15 03:17:13 +08:00
|
|
|
using setuptools / easy_install
|
2008-08-16 23:26:59 +08:00
|
|
|
===================================================
|
|
|
|
|
2009-06-30 18:42:57 +08:00
|
|
|
With a working `setuptools installation`_ you can type::
|
|
|
|
|
2008-08-30 02:55:42 +08:00
|
|
|
easy_install -U py
|
2008-08-16 23:26:59 +08:00
|
|
|
|
2008-08-30 02:55:42 +08:00
|
|
|
to get the latest release of the py lib. The ``-U`` switch
|
|
|
|
will trigger an upgrade if you already have an older version installed.
|
|
|
|
The py lib and its tools are expected to work well on Linux,
|
|
|
|
Windows and OSX, Python versions 2.3, 2.4, 2.5 and 2.6.
|
|
|
|
|
2008-09-23 22:42:27 +08:00
|
|
|
We provide binary eggs for Windows machines.
|
|
|
|
|
|
|
|
On other systems you need a working C-compiler in order to
|
2008-08-30 02:55:42 +08:00
|
|
|
install the full py lib. If you don't have a compiler available
|
|
|
|
you can still install the py lib but without greenlets - look
|
|
|
|
below for the ``install_lib`` target.
|
2008-08-16 23:26:59 +08:00
|
|
|
|
2009-07-15 03:17:13 +08:00
|
|
|
**IMPORTANT NOTE**: if you are using Windows and have
|
|
|
|
0.8 versions of the py lib on your system, please download
|
2008-08-21 18:18:58 +08:00
|
|
|
and execute http://codespeak.net/svn/py/build/winpathclean.py
|
|
|
|
This will check that no previous files are getting in the way.
|
2009-07-15 03:17:13 +08:00
|
|
|
You can find out the py lib version with::
|
2008-08-16 23:26:59 +08:00
|
|
|
|
2009-07-15 03:17:13 +08:00
|
|
|
import py
|
|
|
|
print py.version
|
2008-09-23 22:42:27 +08:00
|
|
|
|
2009-06-30 18:42:57 +08:00
|
|
|
|
2009-07-15 03:17:13 +08:00
|
|
|
.. _`checkout`:
|
2008-09-23 22:42:27 +08:00
|
|
|
|
2009-07-15 03:17:13 +08:00
|
|
|
Installing from version control / develop mode
|
|
|
|
=================================================
|
2008-09-23 22:42:27 +08:00
|
|
|
|
2009-07-15 03:17:13 +08:00
|
|
|
To follow development or help with fixing things
|
|
|
|
for the next release, checkout the complete code
|
|
|
|
and documentation source with mercurial_::
|
2008-09-23 22:42:27 +08:00
|
|
|
|
2009-07-15 03:17:13 +08:00
|
|
|
hg clone https://bitbucket.org/hpk42/py-trunk/
|
2008-08-16 23:26:59 +08:00
|
|
|
|
2009-07-15 03:17:13 +08:00
|
|
|
With a working `setuptools installation`_ you can then issue::
|
2008-08-16 23:26:59 +08:00
|
|
|
|
2009-07-15 03:17:13 +08:00
|
|
|
python setup.py develop
|
2009-06-30 18:42:57 +08:00
|
|
|
|
2009-07-15 03:17:13 +08:00
|
|
|
in order to work with your checkout version.
|
2008-08-16 23:26:59 +08:00
|
|
|
|
2009-07-15 03:17:13 +08:00
|
|
|
.. _mercurial: http://mercurial.selenic.com/wiki/
|
2008-08-16 23:26:59 +08:00
|
|
|
|
2009-07-15 03:17:13 +08:00
|
|
|
Working without setuptools / from source
|
|
|
|
==========================================
|
2008-08-16 23:26:59 +08:00
|
|
|
|
2009-07-15 03:17:13 +08:00
|
|
|
If you have a checkout_ or a tarball_ it is actually not neccessary to issue
|
|
|
|
``setup.py`` commands in order to use py lib and its tools. You can
|
|
|
|
simply add the root directory to ``PYTHONPATH`` and ``py/bin`` or
|
|
|
|
``py\bin\win32`` to your ``PATH`` settings.
|
2008-08-16 23:26:59 +08:00
|
|
|
|
2009-07-15 03:17:13 +08:00
|
|
|
There are also helper scripts to set the environment
|
|
|
|
on windows::
|
2008-08-16 23:26:59 +08:00
|
|
|
|
2009-07-15 03:17:13 +08:00
|
|
|
c:\\path\to\checkout\py\env.cmd
|
2008-08-16 23:26:59 +08:00
|
|
|
|
2009-07-15 03:17:13 +08:00
|
|
|
and on linux/osx you can add something like this to
|
|
|
|
your shell initialization::
|
2008-08-16 23:26:59 +08:00
|
|
|
|
2009-07-15 03:17:13 +08:00
|
|
|
eval `python ~/path/to/checkout/py/env.py`
|
2008-08-16 23:26:59 +08:00
|
|
|
|
2009-07-15 03:17:13 +08:00
|
|
|
both of which which will get you good settings
|
|
|
|
for ``PYTHONPATH`` and ``PATH``.
|
2008-08-16 23:26:59 +08:00
|
|
|
|
2009-07-15 03:17:13 +08:00
|
|
|
Note also that the command line scripts will look
|
|
|
|
for "nearby" py libs, so if you have a layout like this::
|
2008-08-16 23:26:59 +08:00
|
|
|
|
2009-07-15 03:17:13 +08:00
|
|
|
mypkg/
|
|
|
|
subpkg1/
|
|
|
|
tests/
|
|
|
|
tests/
|
|
|
|
py/
|
2008-08-16 23:26:59 +08:00
|
|
|
|
2009-07-15 03:17:13 +08:00
|
|
|
then issuing ``py.test subpkg1`` will use the py lib
|
|
|
|
from that projects root directory.
|
2008-08-16 23:26:59 +08:00
|
|
|
|
2009-07-15 03:17:13 +08:00
|
|
|
Debian and RPM packages
|
|
|
|
===================================
|
2008-08-16 23:26:59 +08:00
|
|
|
|
2009-07-15 03:17:13 +08:00
|
|
|
As of July 2009 pytest/pylib 1.0 RPMs and Debian packages
|
|
|
|
are not yet available. So you will only find older
|
|
|
|
versions.
|
2008-08-16 23:26:59 +08:00
|
|
|
|
2009-07-15 03:17:13 +08:00
|
|
|
On Debian systems look for ``python-codespeak-lib``.
|
|
|
|
*But this package is probably outdated - if somebody
|
|
|
|
can help with bringing this up to date,
|
|
|
|
that would be very much appreciated.*
|
2008-08-16 23:26:59 +08:00
|
|
|
|
2009-07-15 03:17:13 +08:00
|
|
|
Dwayne Bailey has thankfully put together a Fedora `RPM`_.
|
2008-08-16 23:26:59 +08:00
|
|
|
|
2009-07-15 03:17:13 +08:00
|
|
|
.. _`RPM`: http://translate.sourceforge.net/releases/testing/fedora/pylib-0.9.2-1.fc9.noarch.rpm
|
2008-08-16 23:26:59 +08:00
|
|
|
|
2009-07-15 03:17:13 +08:00
|
|
|
.. _`setuptools installation`: http://pypi.python.org/pypi/setuptools
|
2008-08-22 21:41:17 +08:00
|
|
|
|
2009-07-15 03:17:13 +08:00
|
|
|
.. _tarball:
|
2008-08-22 21:41:17 +08:00
|
|
|
|
2009-07-15 03:17:13 +08:00
|
|
|
Installing from a TAR archive
|
|
|
|
===================================================
|
2008-08-22 21:41:17 +08:00
|
|
|
|
2009-07-15 03:17:13 +08:00
|
|
|
You need a working `setuptools installation`_.
|
2008-08-22 21:41:17 +08:00
|
|
|
|
2009-07-15 03:17:13 +08:00
|
|
|
Go to the python package index (pypi) and download a tar file:
|
|
|
|
|
|
|
|
http://pypi.python.org/pypi/py/
|
|
|
|
|
|
|
|
and unpack it to a directory, where you then type::
|
|
|
|
|
|
|
|
python setup.py install
|
2008-08-16 23:26:59 +08:00
|
|
|
|