30 Creating initial buildout |
30 Creating initial buildout |
31 ------------------------- |
31 ------------------------- |
32 |
32 |
33 PyAMS provides a new Pyramid scaffold, called *pyams*, provided by the *pyams_base* package. |
33 PyAMS provides a new Pyramid scaffold, called *pyams*, provided by the *pyams_base* package. |
34 |
34 |
35 A simple option to install PyAMS is to create a buildout environment including *Pyramid* and *PyAMS_base* packages: |
35 A simple option to install PyAMS is to create a buildout environment including *Pyramid* and all *PyAMS* packages: |
36 |
36 |
37 .. code-block:: bash |
37 .. code-block:: bash |
38 |
38 |
39 # mkdir /var/local/env/ |
39 # mkdir /var/local/ |
40 # pip3 install virtualenv |
40 # pip3 install virtualenv |
41 # virtualenv --python=python3.5 pyams |
41 # virtualenv --python=python3.5 env |
42 # cd pyams |
42 # cd env |
43 # . bin/activate |
43 # . bin/activate |
44 (pyams) # pip3.5 install zc.buildout |
44 (pyams) # pip3.5 install cookiecutter |
45 (pyams) # buildout init |
45 (pyams) # cookiecutter hg+http://hg.ztfy.org/pyams/scaffolds/pyams |
46 |
46 |
47 Then update your Buildout configuration file *buildout.cfg* as follow: |
47 CookieCutter will ask for for a small set of input variables that you can change or not. |
48 |
|
49 .. code-block:: ini |
|
50 |
|
51 [buildout] |
|
52 find-links = http://download.ztfy.org/eggs |
|
53 extends = http://download.ztfy.org/pyams/pyams-0.1.0.cfg |
|
54 socket-timeout = 3 |
|
55 show-picked-versions = true |
|
56 newest = false |
|
57 allow-hosts = |
|
58 *.python.org |
|
59 *.sourceforge.net |
|
60 github.com |
|
61 bitbucket.org |
|
62 versions = versions |
|
63 eggs-directory = eggs |
|
64 parts = pyramid |
|
65 |
|
66 [pyramid] |
|
67 recipe = zc.recipe.egg |
|
68 dependent-scripts = true |
|
69 eggs = |
|
70 pyramid |
|
71 pyams_base |
|
72 interpreter = py3.4 |
|
73 |
|
74 Then launch the buildout initialization: |
|
75 |
|
76 .. code-block:: bash |
|
77 |
|
78 (pyams) # ./bin/buildout |
|
79 (pyams) # ./bin/pcreate -l |
|
80 Available scaffolds: |
|
81 alchemy: Pyramid project using SQLAlchemy, SQLite, URL dispatch, and |
|
82 pyams: Pyramid project using all PyAMS packages |
|
83 pyams_asyncio: Pyramid AsyncIO project using websockets for PyAMS notifications |
|
84 starter: Pyramid starter project using URL dispatch and Chameleon |
|
85 zodb: Pyramid project using ZODB, traversal, and Chameleon |
|
86 (pyams) # ./bin/pcreate -t pyams myapp |
|
87 (pyams) # cd myapp |
|
88 |
48 |
89 You can then check, and eventually update, the proposed Buildout configuration file *buildout.cfg*, to add or remove |
49 You can then check, and eventually update, the proposed Buildout configuration file *buildout.cfg*, to add or remove |
90 packages or update settings to your needs. Then finalize Bootstrap initialization: |
50 packages or update settings to your needs. Then finalize Bootstrap initialization: |
91 |
51 |
92 .. code-block:: bash |
52 .. code-block:: bash |
93 |
53 |
94 (pyams) # ../bin/buildout bootstrap |
54 (pyams) # python3.5 bootstrap.py |
95 (pyams) # ./bin/buildout |
55 (pyams) # ./bin/buildout |
96 |
56 |
97 This last operation can be quite long, as many packages have to downloaded, compiled and installed in the virtual |
57 This last operation can be quite long, as many packages have to downloaded, compiled and installed in the virtual |
98 environment. If you encounter any compile error, just install the required dependencies and restart the buildout. |
58 environment. If you encounter any compile error, just install the required dependencies and restart the buildout. |
99 |
59 |