From c05acbe1b9b9e325363de69b3145a222bf9d89a1 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jonas=20H=C3=B6ppner?= <jonas.hoeppner@garz-fricke.com>
Date: Fri, 24 May 2024 06:31:52 +0000
Subject: [PATCH] Add scripts to setup a virtual python environment

Use:
```
cd script
source setup_venv.sh
```
to change to the venv.
---
 README.md                | 17 +++++++++++++++++
 scripts/requirements.txt | 12 ++++++++++++
 scripts/setup_venv.sh    |  5 +++++
 3 files changed, 34 insertions(+)
 create mode 100644 scripts/requirements.txt
 create mode 100755 scripts/setup_venv.sh

diff --git a/README.md b/README.md
index 0e1a3715..076ca7b9 100644
--- a/README.md
+++ b/README.md
@@ -9,6 +9,23 @@ be included into all relevant Yocto repositories as a [git submodule][1].
 [1]: https://git-scm.com/book/en/v2/Git-Tools-Submodules
 
 
+<!----------------------------------------------------------------------------->
+## Python development
+<!----------------------------------------------------------------------------->
+
+The `scripts` subfolder contains the implementation of the task executed from
+the CI. In the CI environment docker containers from the ci-images repository
+are used. They contain the correct python version and needed packages.
+For local execution of the scripts a virtual python environment may be setup
+using the following command:
+
+```
+cd scripts
+source setup_venv.sh
+```
+*Note:* Currently the requirements.txt and the Dockerfile for the containers
+need to be synced manually.
+
 <!----------------------------------------------------------------------------->
 ## The GitBot user
 <!----------------------------------------------------------------------------->
diff --git a/scripts/requirements.txt b/scripts/requirements.txt
new file mode 100644
index 00000000..d78c90ea
--- /dev/null
+++ b/scripts/requirements.txt
@@ -0,0 +1,12 @@
+black==23.1.0
+furl==2.1.3
+gitpython==3.1.30
+jinja2==3.1.2
+junitparser==2.8.0
+lxml==4.9.2
+markdown2==2.4.7
+pylint==2.16.1
+python-gitlab==3.13.0
+ruamel.yaml==0.17.21
+Flask==2.3.2
+
diff --git a/scripts/setup_venv.sh b/scripts/setup_venv.sh
new file mode 100755
index 00000000..ece390f9
--- /dev/null
+++ b/scripts/setup_venv.sh
@@ -0,0 +1,5 @@
+#!/bin/sh -x
+
+python3.10 -m venv venv
+. ./venv/bin/activate
+pip install -r requirements.txt
-- 
GitLab