From 7d6f05e2019488dd65e85dc6d12fd67c581b8737 Mon Sep 17 00:00:00 2001 From: emil Date: Mon, 4 Mar 2024 22:36:51 +0000 Subject: [PATCH] i-15 Automate project initialisation (#16) # Context This PR implements the following [issue](https://git.theliberatededge.org/the-liberated-edge/test_linux_containers/issues/15). # Acceptance criteria - [x] A task for project initialisation that eventually switches to a newly created Python virtual environment has been introduced. - [x] `README.md` has been updated to reflect the changes. Co-authored-by: emo Reviewed-on: https://git.theliberatededge.org/the-liberated-edge/test_linux_containers/pulls/16 --- README.md | 20 +++++++++++++------- Taskfile.yml | 4 ++++ 2 files changed, 17 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 8447005..01646dc 100644 --- a/README.md +++ b/README.md @@ -147,17 +147,23 @@ git clone \ cd test_linux_containers ``` -``` -pipenv install -``` +Prior to any further development one needs to initialise the project by running +the following commands on the command line. ``` -pipenv install --dev +task init-project pipenv-shell ``` -``` -pipenv shell -``` +These tasks will perform the following steps. + +1. Create a Python virtual environment through `pipenv`. +2. Any Python dependencies described in `Pipfile.lock`, such as Ansible, +will be downloaded and installed. +3. Any Python development dependencies described in `Pipfile.lock`, +such as linters and code formatters, will be downloaded and installed. +4. The virtual environment will be activated. + +From this point on, the project is properly initialised for development. ## Lint Ansible artifacts diff --git a/Taskfile.yml b/Taskfile.yml index 12e2671..3ff6bd1 100644 --- a/Taskfile.yml +++ b/Taskfile.yml @@ -1,6 +1,10 @@ --- version: '3' tasks: + init-project: + cmds: [pipenv install, pipenv install --dev] + pipenv-shell: + cmds: [pipenv shell] format-yml: cmds: [yamlfix .] lint-yml: