1
+ # Tools
2
+
1
3
<!-- [](https://github.com/psf/black) -->
2
4
[ ![ pre-commit] ( https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit&logoColor=white )] ( https://github.com/pre-commit/pre-commit )
3
5
4
- # Tools
5
6
Yet another small C++ generic library, extending the standard library for ease
6
7
of use.
7
8
8
9
## Content
10
+
9
11
- DataBase: a singleton used to parse specifically formatted files and present
10
12
the content as key/values.
11
13
Written before I heard of YAML... so considered as deprecated.
@@ -29,7 +31,9 @@ of use.
29
31
- Vector3: yet another implementation of the 3-dimensional mathematical vector.
30
32
31
33
## Build
34
+
32
35
### Layout
36
+
33
37
The library is built with ` cmake ` and has been tested with ` g++ ` and ` clang ` .
34
38
35
39
The build layout is included in the repository, with the ` source ` , ` build ` and
@@ -45,6 +49,7 @@ at the compilation if the optional prerequisites are installed and the Python
45
49
virtual environment activated (with ` poetry shell ` ).
46
50
47
51
### Prerequisites
52
+
48
53
Required:
49
54
50
55
- ` make `
@@ -61,6 +66,7 @@ Optional:
61
66
then run ` poetry install ` to install the optional Python packages
62
67
63
68
### Option
69
+
64
70
A Makefile is provided at the root to run ` cmake ` then ` make ` in a single step,
65
71
with the following options:
66
72
@@ -77,7 +83,9 @@ with the following options:
77
83
- ` clean_lib_bin ` : remove the ` install ` directory
78
84
79
85
## Contribute
86
+
80
87
### Tooling set
88
+
81
89
A set of formatters and static analysis tools is used to guarantee the homogeneity
82
90
of the code and catch mistakes:
83
91
@@ -102,17 +110,18 @@ An other solution is to use `poetry run git commit ...` (for configuration of an
102
110
for instance.
103
111
104
112
### Tooling installation
113
+
105
114
- ` pre-commit ` , as a Python tool, can be installed with:
106
115
107
- + `pipx`
116
+ - ` pipx ` (preferred)
108
117
109
118
pipx install pre-commit
110
119
111
- + ` pip ` (or ` pip3 ` on Debian-like distribution)
120
+ - ` pip ` (or ` pip3 ` on Debian-like distribution)
112
121
113
122
pip install -U pre-commit
114
123
115
- + ` snap ` (system-wide)
124
+ - ` snap ` (system-wide)
116
125
117
126
sudo snap install pre-commit
118
127
@@ -125,12 +134,16 @@ for instance.
125
134
[ documentation] ( https://python-poetry.org/docs/#installation ) , it is best
126
135
installed with its own installer:
127
136
128
- curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | python -
137
+ curl -sSL \
138
+ https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py \
139
+ | python -
129
140
130
141
or on Debian-like distribution (using ` python3 ` instead of ` python ` which is
131
142
` python2 ` ):
132
143
133
- curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | python3 -
144
+ curl -sSL \
145
+ https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py \
146
+ | python3 -
134
147
135
148
Once ` poetry ` is installed, run ` poetry install --dev ` to install all the project
136
149
packages and the development tooling.
@@ -158,7 +171,8 @@ for instance.
158
171
On Debian-like distribution, use:
159
172
160
173
sudo apt install clang-format-11
161
- sudo update-alternatives --install /usr/bin/clang-format clang-format /usr/bin/clang-format-11 50
174
+ sudo update-alternatives --install /usr/bin/clang-format clang-format \
175
+ /usr/bin/clang-format-11 50
162
176
163
177
- ` cpplint ` , a Python tool, is either installed through ` poetry ` , either installed
164
178
at a higher level with ` pip ` , ` pipx ` or a package manager.
@@ -169,7 +183,9 @@ All together, on Ubuntu 20.04 or higher, run:
169
183
libclang-11-dev python3 python3-pip
170
184
sudo apt remove --purge python3-virtualenv virtualenv
171
185
pip3 install virtualenv pre-commit
172
- curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | python3 -
186
+ curl -sSL \
187
+ https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py \
188
+ | python3 -
173
189
# cd path/to/repository/
174
190
poetry install --dev
175
191
poetry shell
0 commit comments