Skip to content

Commit 069f2c9

Browse files
pauloxnetniccolomineotrottomv
authored
TG-1016 Update README (#306)
Co-authored-by: Niccolò Mineo <[email protected]> Co-authored-by: Matteo Vitali <[email protected]>
1 parent 96a5194 commit 069f2c9

File tree

11 files changed

+118
-36
lines changed

11 files changed

+118
-36
lines changed

.github/workflows/test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
python-version: "3.12"
2525
- name: Install dependencies
2626
run: |
27-
python -m pip install --upgrade pip
27+
python -m pip install --upgrade pip setuptools
2828
python -m pip install -r requirements/test.txt
2929
- name: Run Test
3030
run: |

Dockerfile

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,16 @@ RUN apt-get update \
1111
gnupg \
1212
libpq-dev \
1313
software-properties-common \
14-
&& curl -fsSL https://apt.releases.hashicorp.com/gpg | apt-key add - \
15-
&& apt-add-repository "deb https://apt.releases.hashicorp.com $(lsb_release -cs) main" \
14+
&& curl https://apt.releases.hashicorp.com/gpg | gpg --dearmor > /usr/share/keyrings/hashicorp-archive-keyring.gpg \
15+
&& gpg --no-default-keyring --keyring /usr/share/keyrings/hashicorp-archive-keyring.gpg --fingerprint \
16+
&& echo "deb [signed-by=/usr/share/keyrings/hashicorp-archive-keyring.gpg] https://apt.releases.hashicorp.com $(lsb_release -cs) main" | tee /etc/apt/sources.list.d/hashicorp.list \
1617
&& apt-get update \
1718
&& apt-get install --assume-yes --no-install-recommends \
1819
terraform \
1920
&& rm -rf /var/lib/apt/lists/*
2021
COPY ./requirements/common.txt requirements/common.txt
21-
RUN python3 -m pip install --no-cache-dir -r requirements/common.txt
22+
RUN python3 -m pip install --no-cache-dir --upgrade pip setuptools \
23+
&& python3 -m pip install --no-cache-dir -r requirements/common.txt
2224
COPY . .
2325
RUN mkdir ${OUTPUT_BASE_DIR}
2426
ENTRYPOINT [ "python", "/app/start.py" ]

Makefile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@ outdated: ## Check outdated requirements and dependencies
2020

2121
.PHONY: pip
2222
pip: pip_update ## Compile requirements
23-
python3 -m piptools compile --generate-hashes --no-header --quiet --resolver=backtracking --upgrade --output-file requirements/common.txt requirements/common.in
24-
python3 -m piptools compile --generate-hashes --no-header --quiet --resolver=backtracking --upgrade --output-file requirements/local.txt requirements/local.in
25-
python3 -m piptools compile --generate-hashes --no-header --quiet --resolver=backtracking --upgrade --output-file requirements/test.txt requirements/test.in
23+
python3 -m piptools compile --generate-hashes --no-header --quiet --resolver=backtracking --strip-extras --upgrade --output-file requirements/common.txt requirements/common.in
24+
python3 -m piptools compile --generate-hashes --no-header --quiet --resolver=backtracking --strip-extras --upgrade --output-file requirements/local.txt requirements/local.in
25+
python3 -m piptools compile --generate-hashes --no-header --quiet --resolver=backtracking --strip-extras --upgrade --output-file requirements/test.txt requirements/test.in
2626

2727
.PHONY: pip_update
2828
pip_update: ## Update requirements and dependencies

README.md

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,29 +6,34 @@
66
77
## 🧩 Requirements
88

9-
The Talos script can be run either using Docker or as a local shell command.
9+
The Talos script can be run either using Docker or a Python virtual environment.
1010

1111
### 🐋 Docker
1212

1313
In order to run Talos via Docker, a working [Docker installation](https://docs.docker.com/get-docker/) is the only requirement.
1414

15-
### 👨‍💻 Shell command
15+
### 🐍 Virtual environment
1616

17-
In order to run Talos as a shell command, first clone the repository in a local projects directory
17+
In order to run Talos in a virtual environment, first clone the repository in a local projects directory and ensure it is your current directory:
1818

1919
```console
2020
cd ~/projects
2121
git clone [email protected]:20tab/django-continuous-delivery.git talos-django
22+
cd talos-django
2223
```
2324

24-
Then, install the following requirements
25+
Then, create and activate a virtual environment and install the requirements:
2526

26-
| Requirements | Instructions |
27-
| ---------------------- | ---------------------------------------------------------------------------- |
28-
| 🌎 Terraform | [Install Guide](https://learn.hashicorp.com/tutorials/terraform/install-cli) |
29-
| 🐍 Python Dependencies | `pip install -r talos-django/requirements/common.txt` |
27+
```console
28+
python3.12 -m venv .venv
29+
source .venv/bin/activate
30+
python3 -m pip install --upgrade pip setuptools
31+
python3 -m pip install -r requirements/common.txt
32+
```
33+
34+
The `terraform` cli package is required, unless you want to generate a project only locally. To install it we suggest to use the official [install guide](https://learn.hashicorp.com/tutorials/terraform/install-cli).
3035

31-
## 🔑 Credentials
36+
## 🔑 Credentials (optional)
3237

3338
### 🦊 GitLab
3439

@@ -40,7 +45,7 @@ It can be generated in the GitLab User Settings panel.
4045

4146
## 🚀️ Quickstart
4247

43-
Change to the projects directory, for example
48+
Change to the projects directory, for example:
4449

4550
```console
4651
cd ~/projects
@@ -52,9 +57,10 @@ cd ~/projects
5257
docker run --interactive --tty --rm --volume $PWD/.dumps:/app/.dumps --volume $PWD/.logs:/app/.logs --volume $PWD:/data 20tab/talos-django:latest
5358
```
5459

55-
### 👨‍💻 Shell command
60+
### 🐍 Virtual environment
5661

5762
```console
63+
source talos-django/.venv/bin/activate
5864
./talos-django/start.py
5965
```
6066

bootstrap/runner.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -275,8 +275,8 @@ def format_files(self):
275275
[
276276
"python3",
277277
"-m",
278-
"black",
279-
"-q",
278+
"ruff",
279+
"format",
280280
f"{self.service_dir.resolve()}",
281281
]
282282
)
@@ -294,6 +294,7 @@ def compile_requirements(self):
294294
"--no-header",
295295
"--quiet",
296296
"--resolver=backtracking",
297+
"--strip-extras",
297298
"--upgrade",
298299
"--output-file",
299300
]

requirements/common.in

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
click~=8.1.0
22
cookiecutter~=2.5.0
3+
pip-tools~=7.3.0
34
pydantic~=1.10.0
45
python-slugify~=8.0.0
6+
ruff~=0.1.0
57
validators~=0.20.0

requirements/common.txt

Lines changed: 49 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ binaryornot==0.4.4 \
66
--hash=sha256:359501dfc9d40632edc9fac890e19542db1a287bbcfa58175b66658392018061 \
77
--hash=sha256:b8b71173c917bddcd2c16070412e369c3ed7f0528926f70cac18a6c97fd563e4
88
# via cookiecutter
9+
build==1.0.3 \
10+
--hash=sha256:538aab1b64f9828977f84bc63ae570b060a8ed1be419e7870b8b4fc5e6ea553b \
11+
--hash=sha256:589bf99a67df7c9cf07ec0ac0e5e2ea5d4b37ac63301c4986d1acb126aa83f8f
12+
# via pip-tools
913
certifi==2023.11.17 \
1014
--hash=sha256:9b469f3a900bf28dc19b8cfbf8019bf47f7fdd1a65a1d4ffb98fc14166beb4d1 \
1115
--hash=sha256:e036ab49d5b79556f99cfc2d9320b34cfbe5be05c5871b51de9329f0603b0474
@@ -112,6 +116,7 @@ click==8.1.7 \
112116
# via
113117
# -r requirements/common.in
114118
# cookiecutter
119+
# pip-tools
115120
cookiecutter==2.5.0 \
116121
--hash=sha256:8aa2f12ed11bc05628651e9dc4353a10571dd9908aaaaeec959a2b9ea465a5d2 \
117122
--hash=sha256:e61e9034748e3f41b8bd2c11f00d030784b48711c4d5c42363c50989a65331ec
@@ -124,9 +129,9 @@ idna==3.6 \
124129
--hash=sha256:9ecdbbd083b06798ae1e86adcbfe8ab1479cf864e4ee30fe4e46a003d12491ca \
125130
--hash=sha256:c05567e9c24a6b9faaa835c4821bad0590fbb9d5779e7caa6e1cc4978e7eb24f
126131
# via requests
127-
jinja2==3.1.2 \
128-
--hash=sha256:31351a702a408a9e7595a8fc6150fc3f43bb6bf7e319770cbc0db9df9437e852 \
129-
--hash=sha256:6088930bfe239f0e6710546ab9c19c9ef35e29792895fed6e6e31a023a182a61
132+
jinja2==3.1.3 \
133+
--hash=sha256:7d6d50dd97d52cbc355597bd845fabfbac3f551e1f99619e39a35ce8c370b5fa \
134+
--hash=sha256:ac8bd6544d4bb2c9792bf3a159e80bba8fda7f07e81bc3aed565432d5925ba90
130135
# via cookiecutter
131136
markdown-it-py==3.0.0 \
132137
--hash=sha256:355216845c60bd96232cd8d8c40e8f9765cc86f46880e43a8fd22dc1a1a8cab1 \
@@ -198,6 +203,14 @@ mdurl==0.1.2 \
198203
--hash=sha256:84008a41e51615a49fc9966191ff91509e3c40b939176e643fd50a5c2196b8f8 \
199204
--hash=sha256:bb413d29f5eea38f31dd4754dd7377d4465116fb207585f97bf925588687c1ba
200205
# via markdown-it-py
206+
packaging==23.2 \
207+
--hash=sha256:048fb0e9405036518eaaf48a55953c750c11e1a1b68e0dd1a9d62ed0c092cfc5 \
208+
--hash=sha256:8c491190033a9af7e1d931d0b5dacc2ef47509b34dd0de67ed209b5203fc88c7
209+
# via build
210+
pip-tools==7.3.0 \
211+
--hash=sha256:8717693288720a8c6ebd07149c93ab0be1fced0b5191df9e9decd3263e20d85e \
212+
--hash=sha256:8e9c99127fe024c025b46a0b2d15c7bd47f18f33226cf7330d35493663fc1d1d
213+
# via -r requirements/common.in
201214
pydantic==1.10.13 \
202215
--hash=sha256:1740068fd8e2ef6eb27a20e5651df000978edce6da6803c2bef0bc74540f9548 \
203216
--hash=sha256:210ce042e8f6f7c01168b2d84d4c9eb2b009fe7bf572c2266e235edf14bacd80 \
@@ -240,6 +253,10 @@ pygments==2.17.2 \
240253
--hash=sha256:b27c2826c47d0f3219f29554824c30c5e8945175d888647acd804ddd04af846c \
241254
--hash=sha256:da46cec9fd2de5be3a8a784f434e4c4ab670b4ff54d605c4c2717e9d49c4c367
242255
# via rich
256+
pyproject-hooks==1.0.0 \
257+
--hash=sha256:283c11acd6b928d2f6a7c73fa0d01cb2bdc5f07c57a2eeb6e83d5e56b97976f8 \
258+
--hash=sha256:f271b298b97f5955d53fb12b72c1fb1948c22c1a6b70b315c54cedaca0264ef5
259+
# via build
243260
python-dateutil==2.8.2 \
244261
--hash=sha256:0123cacc1627ae19ddf3c27a5de5bd67ee4586fbdd6440d9748f8abb483d3e86 \
245262
--hash=sha256:961d03dc3453ebbc59dbdea9e4e11c5651520a876d0f4db161e8674aae935da9
@@ -310,6 +327,25 @@ rich==13.7.0 \
310327
--hash=sha256:5cb5123b5cf9ee70584244246816e9114227e0b98ad9176eede6ad54bf5403fa \
311328
--hash=sha256:6da14c108c4866ee9520bbffa71f6fe3962e193b7da68720583850cd4548e235
312329
# via cookiecutter
330+
ruff==0.1.11 \
331+
--hash=sha256:09c415716884950080921dd6237767e52e227e397e2008e2bed410117679975b \
332+
--hash=sha256:0f58948c6d212a6b8d41cd59e349751018797ce1727f961c2fa755ad6208ba45 \
333+
--hash=sha256:190a566c8f766c37074d99640cd9ca3da11d8deae2deae7c9505e68a4a30f740 \
334+
--hash=sha256:231d8fb11b2cc7c0366a326a66dafc6ad449d7fcdbc268497ee47e1334f66f77 \
335+
--hash=sha256:4b077ce83f47dd6bea1991af08b140e8b8339f0ba8cb9b7a484c30ebab18a23f \
336+
--hash=sha256:5b25093dad3b055667730a9b491129c42d45e11cdb7043b702e97125bcec48a1 \
337+
--hash=sha256:6464289bd67b2344d2a5d9158d5eb81025258f169e69a46b741b396ffb0cda95 \
338+
--hash=sha256:934832f6ed9b34a7d5feea58972635c2039c7a3b434fe5ba2ce015064cb6e955 \
339+
--hash=sha256:97ce4d752f964ba559c7023a86e5f8e97f026d511e48013987623915431c7ea9 \
340+
--hash=sha256:9b8f397902f92bc2e70fb6bebfa2139008dc72ae5177e66c383fa5426cb0bf2c \
341+
--hash=sha256:9bd4025b9c5b429a48280785a2b71d479798a69f5c2919e7d274c5f4b32c3607 \
342+
--hash=sha256:a7f772696b4cdc0a3b2e527fc3c7ccc41cdcb98f5c80fdd4f2b8c50eb1458196 \
343+
--hash=sha256:c4a88efecec23c37b11076fe676e15c6cdb1271a38f2b415e381e87fe4517f18 \
344+
--hash=sha256:e1ad00662305dcb1e987f5ec214d31f7d6a062cae3e74c1cbccef15afd96611d \
345+
--hash=sha256:ea0d3e950e394c4b332bcdd112aa566010a9f9c95814844a7468325290aabfd9 \
346+
--hash=sha256:eb85ee287b11f901037a6683b2374bb0ec82928c5cbc984f575d0437979c521a \
347+
--hash=sha256:f9d4d88cb6eeb4dfe20f9f0519bd2eaba8119bde87c3d5065c541dbae2b5a2cb
348+
# via -r requirements/common.in
313349
six==1.16.0 \
314350
--hash=sha256:1e61c37477a1626458e36f7b1d82aa5c9b094fa4802892072e49de9c60c4c926 \
315351
--hash=sha256:8abb2f1d86890a2dfb989f9a77cfcfd3e47c2a354b01111771326f8aa26e0254
@@ -333,3 +369,13 @@ urllib3==2.1.0 \
333369
validators==0.20.0 \
334370
--hash=sha256:24148ce4e64100a2d5e267233e23e7afeb55316b47d30faae7eb6e7292bc226a
335371
# via -r requirements/common.in
372+
wheel==0.42.0 \
373+
--hash=sha256:177f9c9b0d45c47873b619f5b650346d632cdc35fb5e4d25058e09c9e581433d \
374+
--hash=sha256:c45be39f7882c9d34243236f2d63cbd58039e360f85d0913425fbd7ceea617a8
375+
# via pip-tools
376+
377+
# WARNING: The following packages were not pinned, but pip requires them to be
378+
# pinned when the requirements file includes hashes and the requirement is not
379+
# satisfied by a package already installed. Consider using the --allow-unsafe flag.
380+
# pip
381+
# setuptools

requirements/local.in

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
-r test.in
22
black~=23.12.0
33
ipython~=8.20.0
4-
pip-tools~=7.3.0
54
pre-commit~=3.6.0
65
types-python-slugify~=8.0.0

requirements/local.txt

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ cookiecutter==2.5.0 \
154154
--hash=sha256:8aa2f12ed11bc05628651e9dc4353a10571dd9908aaaaeec959a2b9ea465a5d2 \
155155
--hash=sha256:e61e9034748e3f41b8bd2c11f00d030784b48711c4d5c42363c50989a65331ec
156156
# via -r requirements/common.in
157-
coverage[toml]==7.4.0 \
157+
coverage==7.4.0 \
158158
--hash=sha256:04387a4a6ecb330c1878907ce0dc04078ea72a869263e53c72a1ba5bbdf380ca \
159159
--hash=sha256:0676cd0ba581e514b7f726495ea75aba3eb20899d824636c6f59b0ed2f88c471 \
160160
--hash=sha256:0e8d06778e8fbffccfe96331a3946237f87b1e1d359d7fbe8b06b96c95a5407a \
@@ -244,9 +244,9 @@ jedi==0.19.1 \
244244
--hash=sha256:cf0496f3651bc65d7174ac1b7d043eff454892c708a87d1b683e57b569927ffd \
245245
--hash=sha256:e983c654fe5c02867aef4cdfce5a2fbb4a50adc0af145f70504238f18ef5e7e0
246246
# via ipython
247-
jinja2==3.1.2 \
248-
--hash=sha256:31351a702a408a9e7595a8fc6150fc3f43bb6bf7e319770cbc0db9df9437e852 \
249-
--hash=sha256:6088930bfe239f0e6710546ab9c19c9ef35e29792895fed6e6e31a023a182a61
247+
jinja2==3.1.3 \
248+
--hash=sha256:7d6d50dd97d52cbc355597bd845fabfbac3f551e1f99619e39a35ce8c370b5fa \
249+
--hash=sha256:ac8bd6544d4bb2c9792bf3a159e80bba8fda7f07e81bc3aed565432d5925ba90
250250
# via cookiecutter
251251
markdown-it-py==3.0.0 \
252252
--hash=sha256:355216845c60bd96232cd8d8c40e8f9765cc86f46880e43a8fd22dc1a1a8cab1 \
@@ -382,7 +382,7 @@ pexpect==4.9.0 \
382382
pip-tools==7.3.0 \
383383
--hash=sha256:8717693288720a8c6ebd07149c93ab0be1fced0b5191df9e9decd3263e20d85e \
384384
--hash=sha256:8e9c99127fe024c025b46a0b2d15c7bd47f18f33226cf7330d35493663fc1d1d
385-
# via -r requirements/local.in
385+
# via -r requirements/common.in
386386
platformdirs==4.1.0 \
387387
--hash=sha256:11c8f37bcca40db96d8144522d925583bdb7a31f7b0e37e3ed4318400a8e2380 \
388388
--hash=sha256:906d548203468492d432bcb294d4bc2fff751bf84971fbb2c10918cc206ee420
@@ -543,7 +543,7 @@ ruff==0.1.11 \
543543
--hash=sha256:ea0d3e950e394c4b332bcdd112aa566010a9f9c95814844a7468325290aabfd9 \
544544
--hash=sha256:eb85ee287b11f901037a6683b2374bb0ec82928c5cbc984f575d0437979c521a \
545545
--hash=sha256:f9d4d88cb6eeb4dfe20f9f0519bd2eaba8119bde87c3d5065c541dbae2b5a2cb
546-
# via -r requirements/test.in
546+
# via -r requirements/common.in
547547
six==1.16.0 \
548548
--hash=sha256:1e61c37477a1626458e36f7b1d82aa5c9b094fa4802892072e49de9c60c4c926 \
549549
--hash=sha256:8abb2f1d86890a2dfb989f9a77cfcfd3e47c2a354b01111771326f8aa26e0254

requirements/test.in

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
-r common.in
22
coverage[toml]~=7.4.0
33
mypy~=1.8.0
4-
ruff~=0.1.0

0 commit comments

Comments
 (0)