Skip to content

Commit

Permalink
replace references to easy_install by pip
Browse files Browse the repository at this point in the history
  • Loading branch information
scoder committed Feb 5, 2012
1 parent f1ede1c commit 1e1fbbd
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 35 deletions.
20 changes: 10 additions & 10 deletions INSTALL.txt
Original file line number Diff line number Diff line change
Expand Up @@ -47,22 +47,22 @@ so newer versions will give you better compliance with the W3C spec.
Installation
------------

Get the `easy_install`_ tool and run the following as super-user (or
Get the pip_ tool and run the following as super-user (or
administrator)::

easy_install --allow-hosts=lxml.de,*.python.org lxml
pip install lxml

.. _easy_install: http://peak.telecommunity.com/DevCenter/EasyInstall
.. _pip: http://pypi.python.org/pypi/pip

* On **MS Windows**, the above will install the binary builds that we
provide. If there is no binary build of the latest release yet,
please search PyPI_ for the last release that has them and pass that
version to ``easy_install`` like this::
version to ``pip`` like this::

easy_install --allow-hosts=lxml.de,*.python.org lxml==2.2.2
pip install lxml==2.3

* On **Linux** (and most other well-behaved operating systems),
``easy_install`` will manage to build the source distribution as
``pip`` will manage to build the source distribution as
long as libxml2 and libxslt are properly installed, including
development packages, i.e. header files, etc. Use your package
management tool to look for packages like ``libxml2-dev`` or
Expand All @@ -73,7 +73,7 @@ administrator)::
and make sure you have a working Internet connection, as this will
download libxml2 and libxslt in order to build them::

STATIC_DEPS=true sudo easy_install --allow-hosts=lxml.de,*.python.org lxml
STATIC_DEPS=true sudo pip install lxml

.. _PyPI: http://cheeseshop.python.org/pypi/lxml

Expand Down Expand Up @@ -110,12 +110,12 @@ can have any kind of effect from disappearing functionality to crashes
in either of the two.

To get a static build, either pass the ``--static-deps`` option to the
setup.py script, or run ``easy_install`` with the ``STATIC_DEPS`` or
setup.py script, or run ``pip`` with the ``STATIC_DEPS`` or
``STATICBUILD`` environment variable set to true, i.e.

::

STATIC_DEPS=true easy_install lxml
STATIC_DEPS=true pip install lxml

The ``STATICBUILD`` environment variable is handled equivalently to
the ``STATIC_DEPS`` variable, but is used by some other extension
Expand All @@ -132,7 +132,7 @@ build from PyPI.

Unless you know what you are doing, this means: *do not install
libxml2 or libxslt if you use a binary build of lxml*. Just use
``easy_install`` by following the installation instructions above.
``pip`` by following the installation instructions above.

*Only* if you want to upgrade the libraries and/or compile lxml from
sources, you should install a `binary distribution`_ of libxml2 and
Expand Down
45 changes: 20 additions & 25 deletions doc/build.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,13 @@ How to build lxml from source
To build lxml from source, you need libxml2 and libxslt properly
installed, *including the header files*. These are likely shipped in
separate ``-dev`` or ``-devel`` packages like ``libxml2-dev``, which
you must install before trying to build lxml. The build process also
requires setuptools_. The lxml source distribution comes with a
script called ``ez_setup.py`` that can be used to install them.

.. _setuptools: http://peak.telecommunity.com/DevCenter/setuptools
you must install before trying to build lxml.

.. contents::
..
1 Cython
2 Github, git and hg
3 Setuptools
3 Building the sources
4 Running the tests and reporting errors
5 Building an egg
6 Building lxml on MacOS-X
Expand All @@ -25,7 +21,7 @@ script called ``ez_setup.py`` that can be used to install them.
Cython
------

.. _EasyInstall: http://peak.telecommunity.com/DevCenter/EasyInstall
.. _pip: http://pypi.python.org/pypi/pip
.. _Cython: http://www.cython.org

The lxml.etree and lxml.objectify modules are written in Cython_.
Expand All @@ -44,9 +40,9 @@ build.
*Only* if you are interested in building lxml from a checkout of the
developer sources (e.g. to test a bug fix that has not been release
yet) or if you want to be an lxml developer, then you do need a
working Cython installation. You can use EasyInstall_ to install it::
working Cython installation. You can use pip_ to install it::

easy_install "Cython>=0.16"
pip install "Cython>=0.16"

lxml currently requires Cython 0.16, later release versions should
work as well.
Expand All @@ -73,27 +69,26 @@ through the web.
.. _`source tar-ball`: https://github.com/lxml/lxml/tarball/master


Setuptools
----------
Building the sources
---------------------

Usually, building lxml is done through setuptools. Clone the source
repository as described above (or download the `source tar-ball`_ and
unpack it) and then type::
Clone the source repository as described above (or download
the `source tar-ball`_ and unpack it) and then type::

python setup.py build

or::

python setup.py bdist_egg
python setup.py bdist_egg # requires 'setuptools' or 'distribute'

If you want to test lxml from the source directory, it is better to build it
in-place like this::

python setup.py build_ext -i
python setup.py build_ext -i

or, in Unix-like environments::

make
make inplace

If you get errors about missing header files (e.g. ``Python.h`` or
``libxml/xmlversion.h``) then you need to make sure the development
Expand All @@ -112,13 +107,13 @@ files to the include path like::

where the file is in ``/usr/include/libxml2/libxml/xmlversion.h``

To use lxml.etree in-place, you can place lxml's ``src`` directory on your
Python module search path (PYTHONPATH) and then import ``lxml.etree`` to play
with it::
To use lxml.etree in-place, you can place lxml's ``src`` directory
on your Python module search path (PYTHONPATH) and then import
``lxml.etree`` to play with it::

# cd lxml
# PYTHONPATH=src python
Python 2.5.1
Python 2.7.2
Type "help", "copyright", "credits" or "license" for more information.
>>> from lxml import etree
>>>
Expand Down Expand Up @@ -164,7 +159,7 @@ Building an egg
---------------

This is the procedure to make an lxml egg for your platform (assuming
that you have setuptools_ installed):
that you have "setuptools" or "distribute" installed):

* Download the lxml-x.y.tar.gz release. This contains the pregenerated C so
that you can be sure you build exactly from the release sources. Unpack
Expand Down Expand Up @@ -223,16 +218,16 @@ with the desired target versions like this::
Instead of ``build``, you can use any target, like ``bdist_egg`` if
you want to use setuptools to build an installable egg.

Note that this also works with EasyInstall_. Since you can't pass
Note that this also works with pip_. Since you can't pass
command line options in this case, you have to use an environment
variable instead::

STATIC_DEPS=true easy_install lxml
STATIC_DEPS=true pip install lxml

Some machines may require an additional run with "sudo" to install the
package into the Python package directory::

STATIC_DEPS=true sudo easy_install lxml
STATIC_DEPS=true sudo pip install lxml

The ``STATICBUILD`` environment variable is handled equivalently to
the ``STATIC_DEPS`` variable, but is used by some other extension
Expand Down

0 comments on commit 1e1fbbd

Please sign in to comment.