Project Installation

Version 6 (Etienne Pallier, 03/24/2016 12:51 pm)

1 1 Etienne Pallier
h1. Project Installation
2 1 Etienne Pallier
3 6 Etienne Pallier
4 6 Etienne Pallier
HOWTO Format Redmine Wiki : http://www.redmine.org/projects/redmine/wiki/FrRedmineWikiFormatting
5 6 Etienne Pallier
6 6 Etienne Pallier
{{>toc}}
7 6 Etienne Pallier
8 6 Etienne Pallier
9 3 Etienne Pallier
---
10 3 Etienne Pallier
11 1 Etienne Pallier
h2. %{margin-left:0px; font-weight:bold; font-size:25px;  display:block; color:red;}TODO%
12 1 Etienne Pallier
13 1 Etienne Pallier
 * Mettre en place une collaboration via le gitlab
14 1 Etienne Pallier
15 1 Etienne Pallier
 * Séparation des BD Django et Pyros
16 1 Etienne Pallier
17 1 Etienne Pallier
 * Intégration des modules Django déjà développés
18 1 Etienne Pallier
19 1 Etienne Pallier
 * Intégration continue avec Jenkins (+ run des tests sur une VM Windows)
20 1 Etienne Pallier
21 1 Etienne Pallier
 * Planifier la suite...
22 1 Etienne Pallier
23 1 Etienne Pallier
 * Doc pour le meeting de mai
24 3 Etienne Pallier
25 3 Etienne Pallier
---
26 2 Etienne Pallier
27 2 Etienne Pallier
h2. %{margin-left:0px; font-weight:bold; font-size:25px;  display:block; color:red;}LIENS UTILES%
28 2 Etienne Pallier
29 2 Etienne Pallier
 * Liens vers web local :
30 2 Etienne Pallier
31 2 Etienne Pallier
  * homepage: http://localhost:8000
32 2 Etienne Pallier
  * admin: http://localhost:8000/admin
33 2 Etienne Pallier
34 2 Etienne Pallier
 * Django:
35 2 Etienne Pallier
36 2 Etienne Pallier
  * Coding style: https://docs.djangoproject.com/en/dev/internals/contributing/writing-code/coding-style/
37 2 Etienne Pallier
38 2 Etienne Pallier
 * Git docs: 
39 2 Etienne Pallier
40 2 Etienne Pallier
  * https://git-scm.com/docs
41 2 Etienne Pallier
  * https://git-scm.com/book/fr/v1/Les-bases-de-Git-Travailler-avec-des-d%C3%A9p%C3%B4ts-distants
42 2 Etienne Pallier
  * les workflows: https://aresu.dsi.cnrs.fr/spip.php?article219
43 2 Etienne Pallier
  * Git for Eclipse users : http://wiki.eclipse.org/EGit/Git_For_Eclipse_Users
44 2 Etienne Pallier
45 2 Etienne Pallier
 * CADOR web interface: http://cador.obs-hp.fr/ros/manual/cador_actions.html
46 2 Etienne Pallier
47 2 Etienne Pallier
 * pylint (analyse de code) : https://www.pylint.org
48 2 Etienne Pallier
49 2 Etienne Pallier
 * pyreverse (uml diagrams generation, inclus dans pylint) : https://www.logilab.org/blogentry/6883
50 2 Etienne Pallier
51 2 Etienne Pallier
 * tox (a generic virtualenv management and test command line tool) : https://testrun.org/tox/latest/index.html
52 2 Etienne Pallier
53 2 Etienne Pallier
---
54 4 Etienne Pallier
55 4 Etienne Pallier
h2. %{margin-left:0px; font-weight:bold; font-size:25px;  display:block; color:red;}I - DATABASE SCHEMA (v0.2.1)%
56 4 Etienne Pallier
57 4 Etienne Pallier
58 4 Etienne Pallier
{{thumbnail(PYROS_PDM_v021.png, size=300, title=Pyros data model)}}
59 4 Etienne Pallier
60 4 Etienne Pallier
61 4 Etienne Pallier
---
62 5 Etienne Pallier
63 5 Etienne Pallier
h2. %{margin-left:0px; font-weight:bold; font-size:25px;  display:block; color:red;}II - Get the project (from gitlab)%
64 5 Etienne Pallier
65 5 Etienne Pallier
h3. Gitlab management interface
66 5 Etienne Pallier
67 5 Etienne Pallier
https://gitlab.irap.omp.eu/epallier/pyros
68 5 Etienne Pallier
69 5 Etienne Pallier
https://gitlab.irap.omp.eu/epallier/pyros/team
70 5 Etienne Pallier
71 5 Etienne Pallier
Browse the code: https://gitlab.irap.omp.eu/epallier/pyros/tree/master
72 5 Etienne Pallier
73 5 Etienne Pallier
h3. Project structure
74 5 Etienne Pallier
75 5 Etienne Pallier
Once you have fetched the project, you should obtain this structure:
76 5 Etienne Pallier
77 5 Etienne Pallier
<pre>
78 5 Etienne Pallier
79 5 Etienne Pallier
PYROS/
80 5 Etienne Pallier
├── install/
81 5 Etienne Pallier
│   └── REQUIREMENTS.txt
82 5 Etienne Pallier
│   └── INSTALLATION.txt
83 5 Etienne Pallier
├── public/
84 5 Etienne Pallier
│   └── static/
85 5 Etienne Pallier
├── src/
86 5 Etienne Pallier
│   ├── manage.py
87 5 Etienne Pallier
│   ├── pyros/
88 5 Etienne Pallier
│   │   ├── __init__.py
89 5 Etienne Pallier
│   │   ├── __pycache__
90 5 Etienne Pallier
│   │   ├── settings.py
91 5 Etienne Pallier
│   │   ├── urls.py
92 5 Etienne Pallier
│   │   └── wsgi.py
93 5 Etienne Pallier
│   └── pyrosapp/
94 5 Etienne Pallier
│       ├── __init__.py
95 5 Etienne Pallier
│       ├── admin.py
96 5 Etienne Pallier
│       ├── apps.py
97 5 Etienne Pallier
│       ├── migrations
98 5 Etienne Pallier
│       ├── models.py
99 5 Etienne Pallier
│       ├── tests.py
100 5 Etienne Pallier
│       └── views.py
101 5 Etienne Pallier
102 5 Etienne Pallier
103 5 Etienne Pallier
</pre>
104 5 Etienne Pallier
105 5 Etienne Pallier
h3. From the terminal
106 5 Etienne Pallier
107 5 Etienne Pallier
<pre>
108 5 Etienne Pallier
git clone https://gitlab.irap.omp.eu/epallier/pyros.git PYROS
109 5 Etienne Pallier
(or also : git clone git@gitlab.irap.omp.eu:epallier/pyros.git PYROS)
110 5 Etienne Pallier
</pre>
111 5 Etienne Pallier
112 5 Etienne Pallier
This creates a PYROS/ folder containing the project (with a .git/ subfolder for synchronization with the git repository)
113 5 Etienne Pallier
114 5 Etienne Pallier
_If you just wanted a static copy of the project (without synchronization), just remove the .git/ folder:_
115 5 Etienne Pallier
<pre>
116 5 Etienne Pallier
$ rm -r .git/
117 5 Etienne Pallier
</pre>
118 5 Etienne Pallier
119 5 Etienne Pallier
h3. From Eclipse
120 5 Etienne Pallier
121 5 Etienne Pallier
1) Deactivate CA certificate verification
122 5 Etienne Pallier
123 5 Etienne Pallier
Window -> Preferences -> Team -> git -> configuration -> Add entry
124 5 Etienne Pallier
125 5 Etienne Pallier
Key = http.sslVerify
126 5 Etienne Pallier
Value = false
127 5 Etienne Pallier
128 5 Etienne Pallier
2) Fetch the project
129 5 Etienne Pallier
130 5 Etienne Pallier
File/Import project from git
131 5 Etienne Pallier
132 5 Etienne Pallier
Select repository source: Clone URI: https://gitlab.irap.omp.eu/epallier/pyros.git
133 5 Etienne Pallier
134 5 Etienne Pallier
Directory: 
135 5 Etienne Pallier
par défaut, il propose : /Users/epallier/git/pyros
136 5 Etienne Pallier
mais on peut le mettre ailleurs (c'est ce que j'ai fait)
137 5 Etienne Pallier
138 5 Etienne Pallier
initial branch: master
139 5 Etienne Pallier
remote name: origin
140 5 Etienne Pallier
141 5 Etienne Pallier
Import as general project
142 5 Etienne Pallier
143 5 Etienne Pallier
Project name: PYROS
144 5 Etienne Pallier
145 5 Etienne Pallier
146 5 Etienne Pallier
3) Configure the project
147 5 Etienne Pallier
148 5 Etienne Pallier
The project is created. Now, you have to set it as a «PyDev » and a « Django » project.
149 5 Etienne Pallier
150 5 Etienne Pallier
clic droit sur le projet / PyDev / set as a PyDev project
151 5 Etienne Pallier
152 5 Etienne Pallier
clic droit sur le projet / PyDev / set as a Django project
153 5 Etienne Pallier
154 5 Etienne Pallier
clic droit sur le projet : on doit maintenant avoir un sous-menu Django
155 5 Etienne Pallier
156 5 Etienne Pallier
clic droit sur le dossier src / PyDev / set as source folder (add to PYTHONPATH)
157 5 Etienne Pallier
158 5 Etienne Pallier
clic droit sur projet / Properties / Pydev-Django :
159 5 Etienne Pallier
  - Django manage.py : src/manage.py
160 5 Etienne Pallier
  - Django settings module : pyros.settings
161 5 Etienne Pallier
162 5 Etienne Pallier
163 5 Etienne Pallier
4) Set Code style
164 5 Etienne Pallier
165 5 Etienne Pallier
Window/Preferences : Pydev / Editor
166 5 Etienne Pallier
- Auto Imports : uncheck « Do auto import »
167 5 Etienne Pallier
- Code style:
168 5 Etienne Pallier
	- Locals … : camelCase
169 5 Etienne Pallier
	- Methods : camelCase() with first lower
170 5 Etienne Pallier
- Code style / Code Formatter: activer « use autopep8.py for code formatting »
171 5 Etienne Pallier
- Tabs : Tab length : 4
172 5 Etienne Pallier
173 5 Etienne Pallier
(il faudra aussi faire un peu plus loin : https://projects.irap.omp.eu/projects/pyros/wiki/Wiki#Eclipse-only-Set-the-Python3-virtual-environment-as-the-project-interpreter)