setup.rst 6.64 KB
Newer Older
1
.. -*- coding: utf-8 -*-
Adrien Di Mascio's avatar
Adrien Di Mascio committed
2

Sandrine Ribeau's avatar
Sandrine Ribeau committed
3
.. _SetUpEnv:
Adrien Di Mascio's avatar
Adrien Di Mascio committed
4

5
6
Installation of a *CubicWeb* environment
========================================
Adrien Di Mascio's avatar
Adrien Di Mascio committed
7

Nicolas Chauvat's avatar
Nicolas Chauvat committed
8
9
10
11
12
13
Official releases are available from the `CubicWeb.org forge`_ and from
`PyPI`_. Since CubicWeb is developed using `Agile software development
<http://en.wikipedia.org/wiki/Agile_software_development>`_ techniques, releases
happen frequently. In a version numbered X.Y.Z, X changes after a few years when
the API breaks, Y changes after a few weeks when features are added and Z
changes after a few days when bugs are fixed.
14

Nicolas Chauvat's avatar
Nicolas Chauvat committed
15
16
Depending on your needs, you will chose a different way to install CubicWeb on
your system:
17

18
- `Installation using docker`_
Nicolas Chauvat's avatar
Nicolas Chauvat committed
19
20
21
22
- `Installation on Debian/Ubuntu`_
- `Installation in a virtualenv`_
- `Installation with pip`_
- `Installation from tarball`_
23

Nicolas Chauvat's avatar
Nicolas Chauvat committed
24
If you are a power-user and need the very latest features, you will
25

Nicolas Chauvat's avatar
Nicolas Chauvat committed
26
- `Install from version control`_
27

Nicolas Chauvat's avatar
Nicolas Chauvat committed
28
Once the software is installed, move on to :ref:`ConfigEnv` for better control
29
30
31
and advanced features of |cubicweb|.

.. _`Installation on Debian/Ubuntu`: DebianInstallation_
Nicolas Chauvat's avatar
Nicolas Chauvat committed
32
.. _`Installation in a virtualenv`: VirtualenvInstallation_
33
34
.. _`Installation with pip`: PipInstallation_
.. _`Installation from tarball`: TarballInstallation_
Nicolas Chauvat's avatar
Nicolas Chauvat committed
35
.. _`Install from version control`: MercurialInstallation_
36

37

38
39
40
41
42
43
44
45
46
47
48
49
.. _DockerInstallation:

Docker install
--------------

Detailed instructions on how to deploy CubicWeb using docker can be found
on the `docker hub <https://hub.docker.com/r/logilab/cubicweb>`_.

The images there are built using the following source code :
`docker-cubicweb <https://hg.logilab.org/master/docker-cubicweb/>`_,
see it's `README <https://hg.logilab.org/master/docker-cubicweb/file/tip/README.rst>`_

50
51
.. _DebianInstallation:

52
53
54
55
Debian/Ubuntu install
---------------------

|cubicweb| is packaged for Debian/Ubuntu (and derived
Nicolas Chauvat's avatar
Nicolas Chauvat committed
56
57
58
distributions). Their integrated package-management system make
installation and upgrade much easier for users since
dependencies (like databases) are automatically installed.
59

60
Depending on the distribution you are using, add the appropriate line to your
61
`list of sources` (for example by editing ``/etc/apt/sources.list``), replacing
62
``<release>`` with e.g. ``buster`` or ``bionic``::
63

64
65
  deb http://apt.logilab.fr <release> main  # all cubicweb & cubes
  deb http://apt.logilab.fr <release> cubicweb-3.26  # latest cubicweb 3.26 & cubes
66

67
The repositories are signed with `Logilab's gnupg key`_. You can download
68
and register the key to avoid warnings::
69

70
  wget -O/etc/apt/trusted.gpg.d/logilab.gpg https://www.logilab.fr/logilab-debian-keyring.gpg
71
72

Update your list of packages and perform the installation::
73

Nicolas Chauvat's avatar
Nicolas Chauvat committed
74
  apt-get update
75
  apt-get install python3-cubicweb --install-recommends
76

77
78
79
``python3-cubicweb`` installs the framework itself, allowing you to create new
instances. Installing recommended packages will install the development
environment allowing you to develop new cubes.
80

Nicolas Chauvat's avatar
Nicolas Chauvat committed
81
82
83
There is also a wide variety of :ref:`cubes <AvailableCubes>`. You can access a
list of available cubes using ``apt-cache search cubicweb`` or at the
`CubicWeb.org forge`_.
84

85
86
.. note::

87
  `python3-cubicweb` will install basic sqlite support. You can easily setup
Nicolas Chauvat's avatar
Nicolas Chauvat committed
88
89
  :ref:`cubicweb with other database <DatabaseInstallation>` using the following
  virtual packages :
90

91
  * `python3-cubicweb-postgresql-support` contains the necessary dependencies for
92
    using :ref:`cubicweb with postgresql datatabase <PostgresqlConfiguration>`
93

94
.. _`list of sources`: http://wiki.debian.org/SourcesList
95
.. _`Logilab's gnupg key`: https://www.logilab.fr/logilab-debian-keyring.gpg
96
97
.. _`CubicWeb.org Forge`: http://www.cubicweb.org/project/

98
.. _VirtualenvInstallation:
99

100
101
`Virtualenv` install
--------------------
102

103
104
105
106
|cubicweb| can be safely installed, used and contained inside a
`virtualenv`_. You can use either :ref:`pip <PipInstallation>` or
:ref:`easy_install <EasyInstallInstallation>` to install |cubicweb|
inside an activated virtual environment.
107

108
.. _PipInstallation:
109

110
111
`pip` install
-------------
112

113
`pip <https://pip.pypa.io/>`_ is a python tool that helps downloading,
114
115
116
building, installing, and managing Python packages and their dependencies. It
is fully compatible with `virtualenv`_ and installs the packages from sources
published on the `The Python Package Index`_.
Nicolas Chauvat's avatar
Nicolas Chauvat committed
117

118
.. _`virtualenv`: https://virtualenv.pypa.io
Nicolas Chauvat's avatar
Nicolas Chauvat committed
119
120

A working compilation chain is needed to build the modules that include C
121
extensions. If you really do not want to compile anything, installing `lxml <http://lxml.de/>`_,
Denis Laxalde's avatar
Denis Laxalde committed
122
and `libgecode <http://www.gecode.org/>`_ will help.
123

124
125
126
127
128
129
130
131
132
For Debian, these minimal dependencies can be obtained by doing::

  apt-get install gcc python-pip python-dev python-lxml

or, if you prefer to get as much as possible from pip::

  apt-get install gcc python-pip python-dev libxslt1-dev libxml2-dev

For Windows, you can install pre-built packages (possible `source
133
134
135
136
137
138
139
140
<http://www.lfd.uci.edu/~gohlke/pythonlibs/>`_). For a minimal setup, install:

- pip http://www.lfd.uci.edu/~gohlke/pythonlibs/#pip
- setuptools http://www.lfd.uci.edu/~gohlke/pythonlibs/#setuptools
- libxml-python http://www.lfd.uci.edu/~gohlke/pythonlibs/#libxml-python>
- lxml http://www.lfd.uci.edu/~gohlke/pythonlibs/#lxml and

Make sure to choose the correct architecture and version of Python.
141
142

Finally, install |cubicweb| and its dependencies, by running::
143

144
145
  pip install cubicweb[pyramid]

Paul Tonelli's avatar
Paul Tonelli committed
146
Many other :ref:`cubes <AvailableCubes>` are available. A list is available at
Nicolas Chauvat's avatar
Nicolas Chauvat committed
147
148
`PyPI <http://pypi.python.org/pypi?%3Aaction=search&term=cubicweb&submit=search>`_
or at the `CubicWeb.org forge`_.
149

150
151
152
For example, installing the *blog cube* is achieved by::

  pip install cubicweb-blog
153
154

.. _SourceInstallation:
155

156
Install from source
157
-------------------
158

159
160
.. _TarballInstallation:

Nicolas Chauvat's avatar
Nicolas Chauvat committed
161
You can download the archive containing the sources from
162
`http://download.logilab.org/pub/cubicweb/ <http://download.logilab.org/pub/cubicweb/>`_.
163

164
Make sure you also have all the :ref:`InstallDependencies`.
165

166
167
168
169
170
171
172
173
174
Once uncompressed, you can install the framework from inside the uncompressed
folder with::

  python setup.py install

Or you can run |cubicweb| directly from the source directory by
setting the :ref:`resource mode <RessourcesConfiguration>` to `user`. This will
ease the development with the framework.

Nicolas Chauvat's avatar
Nicolas Chauvat committed
175
There is also a wide variety of :ref:`cubes <AvailableCubes>`. You can access a
176
list of availble cubes at the `CubicWeb.org Forge`_.
177

178

179
.. _MercurialInstallation:
180

181
Install from version control system
182
-----------------------------------
183

Nicolas Chauvat's avatar
Nicolas Chauvat committed
184
185
To keep-up with on-going development, clone the :ref:`Mercurial
<MercurialPresentation>` repository::
186

187
  hg clone -u 'last(tag())' http://hg.logilab.org/cubicweb # stable version
Nicolas Chauvat's avatar
Nicolas Chauvat committed
188
  hg clone http://hg.logilab.org/cubicweb # development branch
189

Nicolas Chauvat's avatar
Nicolas Chauvat committed
190
Make sure you also have all the :ref:`InstallDependencies`.