File: installation.rst

package info (click to toggle)
python-aioxmpp 0.13.3-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, sid
  • size: 6,244 kB
  • sloc: python: 97,761; xml: 215; makefile: 155; sh: 63
file content (151 lines) | stat: -rw-r--r-- 4,941 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
Installation
############

You have three options for installing :mod:`aioxmpp`:

1. :ref:`ug-installation-packages`: only on ArchLinux and only if you use AUR,
   but if you do, this is the preferred way for your platform if you want
   to use :mod:`aioxmpp` in your project. It is not recommended if you want to
   hack on :mod:`aioxmpp` (use the third way then).

2. :ref:`ug-installation-pypi`: this is recommended if you simply want to use
   :mod:`aioxmpp` in a project or need it as an dependency for something. It is
   not recommended if you want to hack on :mod:`aioxmpp`.

3. :ref:`ug-installation-source`: this is recommended if you want to hack on
   :mod:`aioxmpp` or if you anticipate requiring bugfixes or new features while
   you use :mod:`aioxmpp`.

.. note::

   You can help adding a third (and then new first way, because that way is the
   one I prefer most) way: Become a package maintainer for :mod:`aioxmpp` for
   your favourite Linux distribution. `rku <https://github.com/rku/>`_ was so
   kind to create an `ArchLinux package in AUR
   <https://aur.archlinux.org/packages/python-aioxmpp/>`_, but other
   distributions are still lacking the awesomeness (``;-)``) of :mod:`aioxmpp`.
   *You* can change that.

.. _ug-installation-packages:

Installing using your system’s package manager
==============================================

Currently, aioxmpp is only packaged in AUR of ArchLinux. On ArchLinux, that
is the preferred way to install aioxmpp.

For other environments, you have to resort to the ways outlined below.

.. _ug-installation-pypi:

Installing from PyPI
====================

.. _ug-installation-pypi-deps-packages:

Installing dependencies using your system’s package manager (recommended)
-------------------------------------------------------------------------

For Debian 8 (Jessie):

.. code-block:: bash

   apt install --no-install-recommends python3-dnspython python3-openssl \
     python3-pyasn1 python3-pyasn1-modules build-essential libxml2-dev \
     libxslt1-dev python3-dev libz-dev python3-pip


For Debian 9 (Stretch):

.. code-block:: bash

   apt install --no-install-recommends python3-dnspython python3-openssl \
     python3-pyasn1 python3-pyasn1-modules python3-multidict \
     python3-tzlocal python3-lxml python3-babel python3-pip

.. _ug-installation-pypi-deps-pypi:

Installing dependencies from PyPI
---------------------------------

You will need some build dependencies for the dependencies, since some (such as
lxml and PyOpenSSL) include C code which will be built during installation.

In addition, we recommend installing PyOpenSSL using your system’s package
manager even if you install other dependencies using pip.

For Debian 8 (Jessie) and 9 (Stretch):

.. code-block:: bash

   apt install --no-install-recommends build-essential libssl-dev \
     libxml2-dev libxslt1-dev python3-dev python3-openssl libz-dev \
     python3-pip


You can now proceed to installing aioxmpp via pip, which will install the
dependencies from pip too.

Installing aioxmpp
------------------

Now, simply running

.. code-block:: bash

   pip3 install aioxmpp

should install everything necessary to run aioxmpp.

.. note::

   On Debian Jessie (Debian 8), the pip from the packages is too old to install
   aioxmpp: it does not know the ``~=`` version comparison operator. This is
   unfortunate, but ``~=`` provides safety against accidental incompatible
   changes in dependencies.

   To install on Debian Jessie, you will need to upgrade pip using:

   .. code-block:: bash

      pip3 install --upgrade setuptools
      pip3 install --upgrade pip

   (You may add the ``--user`` flag or use a virtualenv if you don’t want to
   upgrade pip system-wide.)


.. _ug-installation-source:

Installing in editable mode from source
=======================================

Editable mode allows you to hack on aioxmpp while still being able to import it
from everywhere. You can read more about it in the relevant chapter from the
`Python Packaging User Guide
<https://packaging.python.org/en/latest/distributing/#working-in-development-mode>`_.

To install in editable mode, you first need a clone of the aioxmpp repository.
Then you tell pip to install the local directory in editable mode. If you
prefer to install dependencies using your system’s package manager, be sure
to do so first (see :ref:`ug-installation-pypi-deps-packages`), because
:program:`pip3` will install them for you if they are missing.

.. code-block:: bash

   git clone https://github.com/horazont/aioxmpp
   cd aioxmpp
   git checkout devel  # make sure to use the devel branch
   pip3 install -e .  # install in editable mode

Running the unittests
---------------------

To run the unittests, I personally recommend using the nosetests runner:

.. code-block:: bash

   cd path/to/source/of/aioxmpp
   nosetests3 tests

If any of the tests fail for you, this is worth a bug report.