author | Denis Laxalde <denis.laxalde@logilab.fr> |
Wed, 29 Mar 2017 13:29:41 +0200 | |
branch | 3.25 |
changeset 12114 | 40446d4e1ee2 |
parent 11689 | 213f60272d49 |
permissions | -rw-r--r-- |
1714
a721966779be
new book layout, do not compile yet
sylvain.thenault@logilab.fr
parents:
diff
changeset
|
1 |
|
a721966779be
new book layout, do not compile yet
sylvain.thenault@logilab.fr
parents:
diff
changeset
|
2 |
.. _foundationsCube: |
a721966779be
new book layout, do not compile yet
sylvain.thenault@logilab.fr
parents:
diff
changeset
|
3 |
|
a721966779be
new book layout, do not compile yet
sylvain.thenault@logilab.fr
parents:
diff
changeset
|
4 |
.. _cubelayout: |
a721966779be
new book layout, do not compile yet
sylvain.thenault@logilab.fr
parents:
diff
changeset
|
5 |
|
a721966779be
new book layout, do not compile yet
sylvain.thenault@logilab.fr
parents:
diff
changeset
|
6 |
Standard structure for a cube |
a721966779be
new book layout, do not compile yet
sylvain.thenault@logilab.fr
parents:
diff
changeset
|
7 |
----------------------------- |
a721966779be
new book layout, do not compile yet
sylvain.thenault@logilab.fr
parents:
diff
changeset
|
8 |
|
11689
213f60272d49
[doc] Update book sections about cubes being Python packages
Denis Laxalde <denis.laxalde@logilab.fr>
parents:
10491
diff
changeset
|
9 |
A cube named "mycube" is Python package "cubicweb-mycube" structured as |
213f60272d49
[doc] Update book sections about cubes being Python packages
Denis Laxalde <denis.laxalde@logilab.fr>
parents:
10491
diff
changeset
|
10 |
follows: |
1714
a721966779be
new book layout, do not compile yet
sylvain.thenault@logilab.fr
parents:
diff
changeset
|
11 |
|
a721966779be
new book layout, do not compile yet
sylvain.thenault@logilab.fr
parents:
diff
changeset
|
12 |
:: |
a721966779be
new book layout, do not compile yet
sylvain.thenault@logilab.fr
parents:
diff
changeset
|
13 |
|
11689
213f60272d49
[doc] Update book sections about cubes being Python packages
Denis Laxalde <denis.laxalde@logilab.fr>
parents:
10491
diff
changeset
|
14 |
cubicweb-mycube/ |
1714
a721966779be
new book layout, do not compile yet
sylvain.thenault@logilab.fr
parents:
diff
changeset
|
15 |
| |
11689
213f60272d49
[doc] Update book sections about cubes being Python packages
Denis Laxalde <denis.laxalde@logilab.fr>
parents:
10491
diff
changeset
|
16 |
|-- cubicweb_mycube/ |
213f60272d49
[doc] Update book sections about cubes being Python packages
Denis Laxalde <denis.laxalde@logilab.fr>
parents:
10491
diff
changeset
|
17 |
| | |
213f60272d49
[doc] Update book sections about cubes being Python packages
Denis Laxalde <denis.laxalde@logilab.fr>
parents:
10491
diff
changeset
|
18 |
| |-- data/ |
213f60272d49
[doc] Update book sections about cubes being Python packages
Denis Laxalde <denis.laxalde@logilab.fr>
parents:
10491
diff
changeset
|
19 |
| | |-- cubes.mycube.css |
213f60272d49
[doc] Update book sections about cubes being Python packages
Denis Laxalde <denis.laxalde@logilab.fr>
parents:
10491
diff
changeset
|
20 |
| | |-- cubes.mycube.js |
213f60272d49
[doc] Update book sections about cubes being Python packages
Denis Laxalde <denis.laxalde@logilab.fr>
parents:
10491
diff
changeset
|
21 |
| | `-- external_resources |
213f60272d49
[doc] Update book sections about cubes being Python packages
Denis Laxalde <denis.laxalde@logilab.fr>
parents:
10491
diff
changeset
|
22 |
| | |
213f60272d49
[doc] Update book sections about cubes being Python packages
Denis Laxalde <denis.laxalde@logilab.fr>
parents:
10491
diff
changeset
|
23 |
| | |
213f60272d49
[doc] Update book sections about cubes being Python packages
Denis Laxalde <denis.laxalde@logilab.fr>
parents:
10491
diff
changeset
|
24 |
| |-- entities.py |
213f60272d49
[doc] Update book sections about cubes being Python packages
Denis Laxalde <denis.laxalde@logilab.fr>
parents:
10491
diff
changeset
|
25 |
| | |
213f60272d49
[doc] Update book sections about cubes being Python packages
Denis Laxalde <denis.laxalde@logilab.fr>
parents:
10491
diff
changeset
|
26 |
| |-- i18n/ |
213f60272d49
[doc] Update book sections about cubes being Python packages
Denis Laxalde <denis.laxalde@logilab.fr>
parents:
10491
diff
changeset
|
27 |
| | |-- en.po |
213f60272d49
[doc] Update book sections about cubes being Python packages
Denis Laxalde <denis.laxalde@logilab.fr>
parents:
10491
diff
changeset
|
28 |
| | |-- es.po |
213f60272d49
[doc] Update book sections about cubes being Python packages
Denis Laxalde <denis.laxalde@logilab.fr>
parents:
10491
diff
changeset
|
29 |
| | `-- fr.po |
213f60272d49
[doc] Update book sections about cubes being Python packages
Denis Laxalde <denis.laxalde@logilab.fr>
parents:
10491
diff
changeset
|
30 |
| | |
213f60272d49
[doc] Update book sections about cubes being Python packages
Denis Laxalde <denis.laxalde@logilab.fr>
parents:
10491
diff
changeset
|
31 |
| |-- __init__.py |
213f60272d49
[doc] Update book sections about cubes being Python packages
Denis Laxalde <denis.laxalde@logilab.fr>
parents:
10491
diff
changeset
|
32 |
| | |
213f60272d49
[doc] Update book sections about cubes being Python packages
Denis Laxalde <denis.laxalde@logilab.fr>
parents:
10491
diff
changeset
|
33 |
| | |
213f60272d49
[doc] Update book sections about cubes being Python packages
Denis Laxalde <denis.laxalde@logilab.fr>
parents:
10491
diff
changeset
|
34 |
| |-- migration/ |
213f60272d49
[doc] Update book sections about cubes being Python packages
Denis Laxalde <denis.laxalde@logilab.fr>
parents:
10491
diff
changeset
|
35 |
| | |-- postcreate.py |
213f60272d49
[doc] Update book sections about cubes being Python packages
Denis Laxalde <denis.laxalde@logilab.fr>
parents:
10491
diff
changeset
|
36 |
| | `-- precreate.py |
213f60272d49
[doc] Update book sections about cubes being Python packages
Denis Laxalde <denis.laxalde@logilab.fr>
parents:
10491
diff
changeset
|
37 |
| | |
213f60272d49
[doc] Update book sections about cubes being Python packages
Denis Laxalde <denis.laxalde@logilab.fr>
parents:
10491
diff
changeset
|
38 |
| |-- __pkginfo__.py |
213f60272d49
[doc] Update book sections about cubes being Python packages
Denis Laxalde <denis.laxalde@logilab.fr>
parents:
10491
diff
changeset
|
39 |
| | |
213f60272d49
[doc] Update book sections about cubes being Python packages
Denis Laxalde <denis.laxalde@logilab.fr>
parents:
10491
diff
changeset
|
40 |
| |-- schema.py |
213f60272d49
[doc] Update book sections about cubes being Python packages
Denis Laxalde <denis.laxalde@logilab.fr>
parents:
10491
diff
changeset
|
41 |
| | |
213f60272d49
[doc] Update book sections about cubes being Python packages
Denis Laxalde <denis.laxalde@logilab.fr>
parents:
10491
diff
changeset
|
42 |
| | |
213f60272d49
[doc] Update book sections about cubes being Python packages
Denis Laxalde <denis.laxalde@logilab.fr>
parents:
10491
diff
changeset
|
43 |
| |-- site_cubicweb.py |
213f60272d49
[doc] Update book sections about cubes being Python packages
Denis Laxalde <denis.laxalde@logilab.fr>
parents:
10491
diff
changeset
|
44 |
| | |
213f60272d49
[doc] Update book sections about cubes being Python packages
Denis Laxalde <denis.laxalde@logilab.fr>
parents:
10491
diff
changeset
|
45 |
| |-- hooks.py |
213f60272d49
[doc] Update book sections about cubes being Python packages
Denis Laxalde <denis.laxalde@logilab.fr>
parents:
10491
diff
changeset
|
46 |
| | |
213f60272d49
[doc] Update book sections about cubes being Python packages
Denis Laxalde <denis.laxalde@logilab.fr>
parents:
10491
diff
changeset
|
47 |
| | |
213f60272d49
[doc] Update book sections about cubes being Python packages
Denis Laxalde <denis.laxalde@logilab.fr>
parents:
10491
diff
changeset
|
48 |
| `-- views.py |
1714
a721966779be
new book layout, do not compile yet
sylvain.thenault@logilab.fr
parents:
diff
changeset
|
49 |
|-- debian/ |
a721966779be
new book layout, do not compile yet
sylvain.thenault@logilab.fr
parents:
diff
changeset
|
50 |
| |-- changelog |
a721966779be
new book layout, do not compile yet
sylvain.thenault@logilab.fr
parents:
diff
changeset
|
51 |
| |-- compat |
a721966779be
new book layout, do not compile yet
sylvain.thenault@logilab.fr
parents:
diff
changeset
|
52 |
| |-- control |
a721966779be
new book layout, do not compile yet
sylvain.thenault@logilab.fr
parents:
diff
changeset
|
53 |
| |-- copyright |
a721966779be
new book layout, do not compile yet
sylvain.thenault@logilab.fr
parents:
diff
changeset
|
54 |
| |-- cubicweb-mycube.prerm |
a721966779be
new book layout, do not compile yet
sylvain.thenault@logilab.fr
parents:
diff
changeset
|
55 |
| `-- rules |
a721966779be
new book layout, do not compile yet
sylvain.thenault@logilab.fr
parents:
diff
changeset
|
56 |
|-- MANIFEST.in |
a721966779be
new book layout, do not compile yet
sylvain.thenault@logilab.fr
parents:
diff
changeset
|
57 |
|-- setup.py |
11689
213f60272d49
[doc] Update book sections about cubes being Python packages
Denis Laxalde <denis.laxalde@logilab.fr>
parents:
10491
diff
changeset
|
58 |
`-- test/ |
213f60272d49
[doc] Update book sections about cubes being Python packages
Denis Laxalde <denis.laxalde@logilab.fr>
parents:
10491
diff
changeset
|
59 |
|-- data/ |
213f60272d49
[doc] Update book sections about cubes being Python packages
Denis Laxalde <denis.laxalde@logilab.fr>
parents:
10491
diff
changeset
|
60 |
| `-- bootstrap_cubes |
213f60272d49
[doc] Update book sections about cubes being Python packages
Denis Laxalde <denis.laxalde@logilab.fr>
parents:
10491
diff
changeset
|
61 |
|-- pytestconf.py |
213f60272d49
[doc] Update book sections about cubes being Python packages
Denis Laxalde <denis.laxalde@logilab.fr>
parents:
10491
diff
changeset
|
62 |
|-- realdb_test_mycube.py |
213f60272d49
[doc] Update book sections about cubes being Python packages
Denis Laxalde <denis.laxalde@logilab.fr>
parents:
10491
diff
changeset
|
63 |
`-- test_mycube.py |
1714
a721966779be
new book layout, do not compile yet
sylvain.thenault@logilab.fr
parents:
diff
changeset
|
64 |
|
a721966779be
new book layout, do not compile yet
sylvain.thenault@logilab.fr
parents:
diff
changeset
|
65 |
|
11689
213f60272d49
[doc] Update book sections about cubes being Python packages
Denis Laxalde <denis.laxalde@logilab.fr>
parents:
10491
diff
changeset
|
66 |
We can use subpackages instead of Python modules for ``views.py``, ``entities.py``, |
1714
a721966779be
new book layout, do not compile yet
sylvain.thenault@logilab.fr
parents:
diff
changeset
|
67 |
``schema.py`` or ``hooks.py``. For example, we could have: |
a721966779be
new book layout, do not compile yet
sylvain.thenault@logilab.fr
parents:
diff
changeset
|
68 |
|
a721966779be
new book layout, do not compile yet
sylvain.thenault@logilab.fr
parents:
diff
changeset
|
69 |
:: |
a721966779be
new book layout, do not compile yet
sylvain.thenault@logilab.fr
parents:
diff
changeset
|
70 |
|
11689
213f60272d49
[doc] Update book sections about cubes being Python packages
Denis Laxalde <denis.laxalde@logilab.fr>
parents:
10491
diff
changeset
|
71 |
cubicweb-mycube/ |
1714
a721966779be
new book layout, do not compile yet
sylvain.thenault@logilab.fr
parents:
diff
changeset
|
72 |
| |
11689
213f60272d49
[doc] Update book sections about cubes being Python packages
Denis Laxalde <denis.laxalde@logilab.fr>
parents:
10491
diff
changeset
|
73 |
|-- cubicweb_mycube/ |
213f60272d49
[doc] Update book sections about cubes being Python packages
Denis Laxalde <denis.laxalde@logilab.fr>
parents:
10491
diff
changeset
|
74 |
| | |
213f60272d49
[doc] Update book sections about cubes being Python packages
Denis Laxalde <denis.laxalde@logilab.fr>
parents:
10491
diff
changeset
|
75 |
|-- entities.py |
213f60272d49
[doc] Update book sections about cubes being Python packages
Denis Laxalde <denis.laxalde@logilab.fr>
parents:
10491
diff
changeset
|
76 |
. |-- hooks.py |
213f60272d49
[doc] Update book sections about cubes being Python packages
Denis Laxalde <denis.laxalde@logilab.fr>
parents:
10491
diff
changeset
|
77 |
. `-- views/ |
213f60272d49
[doc] Update book sections about cubes being Python packages
Denis Laxalde <denis.laxalde@logilab.fr>
parents:
10491
diff
changeset
|
78 |
. |-- __init__.py |
213f60272d49
[doc] Update book sections about cubes being Python packages
Denis Laxalde <denis.laxalde@logilab.fr>
parents:
10491
diff
changeset
|
79 |
|-- forms.py |
213f60272d49
[doc] Update book sections about cubes being Python packages
Denis Laxalde <denis.laxalde@logilab.fr>
parents:
10491
diff
changeset
|
80 |
|-- primary.py |
213f60272d49
[doc] Update book sections about cubes being Python packages
Denis Laxalde <denis.laxalde@logilab.fr>
parents:
10491
diff
changeset
|
81 |
`-- widgets.py |
1714
a721966779be
new book layout, do not compile yet
sylvain.thenault@logilab.fr
parents:
diff
changeset
|
82 |
|
a721966779be
new book layout, do not compile yet
sylvain.thenault@logilab.fr
parents:
diff
changeset
|
83 |
|
a721966779be
new book layout, do not compile yet
sylvain.thenault@logilab.fr
parents:
diff
changeset
|
84 |
where : |
a721966779be
new book layout, do not compile yet
sylvain.thenault@logilab.fr
parents:
diff
changeset
|
85 |
|
a721966779be
new book layout, do not compile yet
sylvain.thenault@logilab.fr
parents:
diff
changeset
|
86 |
* ``schema`` contains the schema definition (server side only) |
5608
f9ab62103ad4
proof read documentation
Alexandre Fayolle <alexandre.fayolle@logilab.fr>
parents:
5394
diff
changeset
|
87 |
* ``entities`` contains the entity definitions (server side and web interface) |
4437
21f2e01fdd6a
update exemples using the 3.6 api and add/fix some sections (schema, vreg, talk about CW_MODE in concepts...). So much to do :'(
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
4431
diff
changeset
|
88 |
* ``hooks`` contains hooks and/or views notifications (server side only) |
1714
a721966779be
new book layout, do not compile yet
sylvain.thenault@logilab.fr
parents:
diff
changeset
|
89 |
* ``views`` contains the web interface components (web interface only) |
2476
1294a6bdf3bf
application -> instance where it makes sense
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
1714
diff
changeset
|
90 |
* ``test`` contains tests related to the cube (not installed) |
1714
a721966779be
new book layout, do not compile yet
sylvain.thenault@logilab.fr
parents:
diff
changeset
|
91 |
* ``i18n`` contains message catalogs for supported languages (server side and |
a721966779be
new book layout, do not compile yet
sylvain.thenault@logilab.fr
parents:
diff
changeset
|
92 |
web interface) |
5608
f9ab62103ad4
proof read documentation
Alexandre Fayolle <alexandre.fayolle@logilab.fr>
parents:
5394
diff
changeset
|
93 |
* ``data`` contains data files for static content (images, css, |
f9ab62103ad4
proof read documentation
Alexandre Fayolle <alexandre.fayolle@logilab.fr>
parents:
5394
diff
changeset
|
94 |
javascript code)...(web interface only) |
1714
a721966779be
new book layout, do not compile yet
sylvain.thenault@logilab.fr
parents:
diff
changeset
|
95 |
* ``migration`` contains initialization files for new instances (``postcreate.py``) |
a721966779be
new book layout, do not compile yet
sylvain.thenault@logilab.fr
parents:
diff
changeset
|
96 |
and a file containing dependencies of the component depending on the version |
a721966779be
new book layout, do not compile yet
sylvain.thenault@logilab.fr
parents:
diff
changeset
|
97 |
(``depends.map``) |
a721966779be
new book layout, do not compile yet
sylvain.thenault@logilab.fr
parents:
diff
changeset
|
98 |
* ``debian`` contains all the files managing debian packaging (you will find |
a721966779be
new book layout, do not compile yet
sylvain.thenault@logilab.fr
parents:
diff
changeset
|
99 |
the usual files ``control``, ``rules``, ``changelog``... not installed) |
a721966779be
new book layout, do not compile yet
sylvain.thenault@logilab.fr
parents:
diff
changeset
|
100 |
* file ``__pkginfo__.py`` provides component meta-data, especially the distribution |
a721966779be
new book layout, do not compile yet
sylvain.thenault@logilab.fr
parents:
diff
changeset
|
101 |
and the current version (server side and web interface) or sub-cubes used by |
a721966779be
new book layout, do not compile yet
sylvain.thenault@logilab.fr
parents:
diff
changeset
|
102 |
the cube. |
a721966779be
new book layout, do not compile yet
sylvain.thenault@logilab.fr
parents:
diff
changeset
|
103 |
|
a721966779be
new book layout, do not compile yet
sylvain.thenault@logilab.fr
parents:
diff
changeset
|
104 |
|
5393
875bdc0fe8ce
[doc/book] hide most XXXs
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
4437
diff
changeset
|
105 |
At least you should have the file ``__pkginfo__.py``. |
1714
a721966779be
new book layout, do not compile yet
sylvain.thenault@logilab.fr
parents:
diff
changeset
|
106 |
|
a721966779be
new book layout, do not compile yet
sylvain.thenault@logilab.fr
parents:
diff
changeset
|
107 |
|
a721966779be
new book layout, do not compile yet
sylvain.thenault@logilab.fr
parents:
diff
changeset
|
108 |
The :file:`__init__.py` and :file:`site_cubicweb.py` files |
a721966779be
new book layout, do not compile yet
sylvain.thenault@logilab.fr
parents:
diff
changeset
|
109 |
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
a721966779be
new book layout, do not compile yet
sylvain.thenault@logilab.fr
parents:
diff
changeset
|
110 |
|
5608
f9ab62103ad4
proof read documentation
Alexandre Fayolle <alexandre.fayolle@logilab.fr>
parents:
5394
diff
changeset
|
111 |
.. XXX WRITEME |
f9ab62103ad4
proof read documentation
Alexandre Fayolle <alexandre.fayolle@logilab.fr>
parents:
5394
diff
changeset
|
112 |
|
1714
a721966779be
new book layout, do not compile yet
sylvain.thenault@logilab.fr
parents:
diff
changeset
|
113 |
The :file:`__pkginfo__.py` file |
a721966779be
new book layout, do not compile yet
sylvain.thenault@logilab.fr
parents:
diff
changeset
|
114 |
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
5393
875bdc0fe8ce
[doc/book] hide most XXXs
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
4437
diff
changeset
|
115 |
|
6120
c000e41316ec
[book] some more documentation and cleanups
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
5608
diff
changeset
|
116 |
It contains metadata describing your cube, mostly useful for packaging. |
c000e41316ec
[book] some more documentation and cleanups
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
5608
diff
changeset
|
117 |
|
c000e41316ec
[book] some more documentation and cleanups
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
5608
diff
changeset
|
118 |
Two important attributes of this module are __depends__ and __recommends__ |
c000e41316ec
[book] some more documentation and cleanups
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
5608
diff
changeset
|
119 |
dictionaries that indicates what should be installed (and each version if |
c000e41316ec
[book] some more documentation and cleanups
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
5608
diff
changeset
|
120 |
necessary) for the cube to work. |
c000e41316ec
[book] some more documentation and cleanups
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
5608
diff
changeset
|
121 |
|
c000e41316ec
[book] some more documentation and cleanups
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
5608
diff
changeset
|
122 |
Dependency on other cubes are expected to be of the form 'cubicweb-<cubename>'. |
c000e41316ec
[book] some more documentation and cleanups
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
5608
diff
changeset
|
123 |
|
c000e41316ec
[book] some more documentation and cleanups
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
5608
diff
changeset
|
124 |
When an instance is created, dependencies are automatically installed, while |
c000e41316ec
[book] some more documentation and cleanups
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
5608
diff
changeset
|
125 |
recommends are not. |
c000e41316ec
[book] some more documentation and cleanups
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
5608
diff
changeset
|
126 |
|
c000e41316ec
[book] some more documentation and cleanups
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
5608
diff
changeset
|
127 |
Recommends may be seen as a kind of 'weak dependency'. Eg, the most important |
c000e41316ec
[book] some more documentation and cleanups
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
5608
diff
changeset
|
128 |
effect of recommending a cube is that, if cube A recommends cube B, the cube B |
c000e41316ec
[book] some more documentation and cleanups
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
5608
diff
changeset
|
129 |
will be loaded before the cube A (same thing happend when A depends on B). |
c000e41316ec
[book] some more documentation and cleanups
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
5608
diff
changeset
|
130 |
|
c000e41316ec
[book] some more documentation and cleanups
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
5608
diff
changeset
|
131 |
Having this behaviour is sometime desired: on schema creation, you may rely on |
c000e41316ec
[book] some more documentation and cleanups
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
5608
diff
changeset
|
132 |
something defined in the other's schema; on database creation, on something |
c000e41316ec
[book] some more documentation and cleanups
Sylvain Thénault <sylvain.thenault@logilab.fr>
parents:
5608
diff
changeset
|
133 |
created by the other's postcreate, and so on. |
1714
a721966779be
new book layout, do not compile yet
sylvain.thenault@logilab.fr
parents:
diff
changeset
|
134 |
|
11689
213f60272d49
[doc] Update book sections about cubes being Python packages
Denis Laxalde <denis.laxalde@logilab.fr>
parents:
10491
diff
changeset
|
135 |
The :file:`setup.py` file |
213f60272d49
[doc] Update book sections about cubes being Python packages
Denis Laxalde <denis.laxalde@logilab.fr>
parents:
10491
diff
changeset
|
136 |
------------------------- |
213f60272d49
[doc] Update book sections about cubes being Python packages
Denis Laxalde <denis.laxalde@logilab.fr>
parents:
10491
diff
changeset
|
137 |
|
213f60272d49
[doc] Update book sections about cubes being Python packages
Denis Laxalde <denis.laxalde@logilab.fr>
parents:
10491
diff
changeset
|
138 |
This is standard setuptools based setup module which reads most of its data |
213f60272d49
[doc] Update book sections about cubes being Python packages
Denis Laxalde <denis.laxalde@logilab.fr>
parents:
10491
diff
changeset
|
139 |
from :file:`__pkginfo__.py`. In the ``setup`` function call, it should also |
213f60272d49
[doc] Update book sections about cubes being Python packages
Denis Laxalde <denis.laxalde@logilab.fr>
parents:
10491
diff
changeset
|
140 |
include an entry point definition under the ``cubicweb.cubes`` group so that |
213f60272d49
[doc] Update book sections about cubes being Python packages
Denis Laxalde <denis.laxalde@logilab.fr>
parents:
10491
diff
changeset
|
141 |
CubicWeb can discover cubes (in particular their custom ``cubicweb-ctl`` |
213f60272d49
[doc] Update book sections about cubes being Python packages
Denis Laxalde <denis.laxalde@logilab.fr>
parents:
10491
diff
changeset
|
142 |
commands): |
213f60272d49
[doc] Update book sections about cubes being Python packages
Denis Laxalde <denis.laxalde@logilab.fr>
parents:
10491
diff
changeset
|
143 |
|
213f60272d49
[doc] Update book sections about cubes being Python packages
Denis Laxalde <denis.laxalde@logilab.fr>
parents:
10491
diff
changeset
|
144 |
:: |
213f60272d49
[doc] Update book sections about cubes being Python packages
Denis Laxalde <denis.laxalde@logilab.fr>
parents:
10491
diff
changeset
|
145 |
|
213f60272d49
[doc] Update book sections about cubes being Python packages
Denis Laxalde <denis.laxalde@logilab.fr>
parents:
10491
diff
changeset
|
146 |
setup( |
213f60272d49
[doc] Update book sections about cubes being Python packages
Denis Laxalde <denis.laxalde@logilab.fr>
parents:
10491
diff
changeset
|
147 |
# ... |
213f60272d49
[doc] Update book sections about cubes being Python packages
Denis Laxalde <denis.laxalde@logilab.fr>
parents:
10491
diff
changeset
|
148 |
entry_points={ |
213f60272d49
[doc] Update book sections about cubes being Python packages
Denis Laxalde <denis.laxalde@logilab.fr>
parents:
10491
diff
changeset
|
149 |
'cubicweb.cubes': [ |
213f60272d49
[doc] Update book sections about cubes being Python packages
Denis Laxalde <denis.laxalde@logilab.fr>
parents:
10491
diff
changeset
|
150 |
'mycube=cubicweb_mycube', |
213f60272d49
[doc] Update book sections about cubes being Python packages
Denis Laxalde <denis.laxalde@logilab.fr>
parents:
10491
diff
changeset
|
151 |
], |
213f60272d49
[doc] Update book sections about cubes being Python packages
Denis Laxalde <denis.laxalde@logilab.fr>
parents:
10491
diff
changeset
|
152 |
}, |
213f60272d49
[doc] Update book sections about cubes being Python packages
Denis Laxalde <denis.laxalde@logilab.fr>
parents:
10491
diff
changeset
|
153 |
# ... |
213f60272d49
[doc] Update book sections about cubes being Python packages
Denis Laxalde <denis.laxalde@logilab.fr>
parents:
10491
diff
changeset
|
154 |
) |
213f60272d49
[doc] Update book sections about cubes being Python packages
Denis Laxalde <denis.laxalde@logilab.fr>
parents:
10491
diff
changeset
|
155 |
|
1714
a721966779be
new book layout, do not compile yet
sylvain.thenault@logilab.fr
parents:
diff
changeset
|
156 |
|
a721966779be
new book layout, do not compile yet
sylvain.thenault@logilab.fr
parents:
diff
changeset
|
157 |
:file:`migration/precreate.py` and :file:`migration/postcreate.py` |
a721966779be
new book layout, do not compile yet
sylvain.thenault@logilab.fr
parents:
diff
changeset
|
158 |
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
5393
875bdc0fe8ce
[doc/book] hide most XXXs
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
4437
diff
changeset
|
159 |
|
875bdc0fe8ce
[doc/book] hide most XXXs
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
4437
diff
changeset
|
160 |
.. XXX detail steps of instance creation |
1714
a721966779be
new book layout, do not compile yet
sylvain.thenault@logilab.fr
parents:
diff
changeset
|
161 |
|
a721966779be
new book layout, do not compile yet
sylvain.thenault@logilab.fr
parents:
diff
changeset
|
162 |
|
a721966779be
new book layout, do not compile yet
sylvain.thenault@logilab.fr
parents:
diff
changeset
|
163 |
External resources such as image, javascript and css files |
a721966779be
new book layout, do not compile yet
sylvain.thenault@logilab.fr
parents:
diff
changeset
|
164 |
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
5393
875bdc0fe8ce
[doc/book] hide most XXXs
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
4437
diff
changeset
|
165 |
|
875bdc0fe8ce
[doc/book] hide most XXXs
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
4437
diff
changeset
|
166 |
.. XXX naming convention external_resources file |
1714
a721966779be
new book layout, do not compile yet
sylvain.thenault@logilab.fr
parents:
diff
changeset
|
167 |
|
a721966779be
new book layout, do not compile yet
sylvain.thenault@logilab.fr
parents:
diff
changeset
|
168 |
|
a721966779be
new book layout, do not compile yet
sylvain.thenault@logilab.fr
parents:
diff
changeset
|
169 |
Out-of the box testing |
a721966779be
new book layout, do not compile yet
sylvain.thenault@logilab.fr
parents:
diff
changeset
|
170 |
~~~~~~~~~~~~~~~~~~~~~~ |
a721966779be
new book layout, do not compile yet
sylvain.thenault@logilab.fr
parents:
diff
changeset
|
171 |
|
5393
875bdc0fe8ce
[doc/book] hide most XXXs
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
4437
diff
changeset
|
172 |
.. XXX MANIFEST.in, __pkginfo__.include_dirs, debian |
1714
a721966779be
new book layout, do not compile yet
sylvain.thenault@logilab.fr
parents:
diff
changeset
|
173 |
|
a721966779be
new book layout, do not compile yet
sylvain.thenault@logilab.fr
parents:
diff
changeset
|
174 |
|
a721966779be
new book layout, do not compile yet
sylvain.thenault@logilab.fr
parents:
diff
changeset
|
175 |
Packaging and distribution |
a721966779be
new book layout, do not compile yet
sylvain.thenault@logilab.fr
parents:
diff
changeset
|
176 |
~~~~~~~~~~~~~~~~~~~~~~~~~~ |
a721966779be
new book layout, do not compile yet
sylvain.thenault@logilab.fr
parents:
diff
changeset
|
177 |
|
5393
875bdc0fe8ce
[doc/book] hide most XXXs
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
4437
diff
changeset
|
178 |
.. XXX MANIFEST.in, __pkginfo__.include_dirs, debian |
875bdc0fe8ce
[doc/book] hide most XXXs
Aurelien Campeas <aurelien.campeas@logilab.fr>
parents:
4437
diff
changeset
|
179 |