From 3cd0d1b91c62d2d10d0d0693f1a5f0d60c756307 Mon Sep 17 00:00:00 2001 From: seafoodfry <99568361+seafoodfry@users.noreply.github.com> Date: Wed, 21 Aug 2024 21:14:42 -0400 Subject: [PATCH] Updated contributing documentation regarding md and py linting Since the `./tools/devctr` Python project is a poetry project, it made more sense to actually add instructions that encouraged the use of poetry as opposed to plain ol' python virtual environments. Also, since the poetry project is using an old version of python, `3.10.*`, we added a `.python-version` file so that people could use pyenv - which is the recommended tool to manage python versions by poetry, see https://python-poetry.org/docs/managing-environments/ Signed-off-by: seafoodfry <99568361+seafoodfry@users.noreply.github.com> --- .python-version | 1 + CONTRIBUTING.md | 26 ++++++++++++++++++++++++++ docs/getting-started.md | 20 +++++++++++++++++++- 3 files changed, 46 insertions(+), 1 deletion(-) create mode 100644 .python-version diff --git a/.python-version b/.python-version new file mode 100644 index 00000000000..1445aee866c --- /dev/null +++ b/.python-version @@ -0,0 +1 @@ +3.10.14 diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 312489a7aa8..c83b634fcb6 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -65,6 +65,32 @@ cargo install rusty-hook rusty-hook init ``` +This project also has linters for Python and Markdown. These will be called by +the pre-commit when you modify any Python and Markdown files. In order to make +sure you are setup we recommend you install +[poetry](https://python-poetry.org/docs/) and +[pyenv](https://github.com/pyenv/pyenv?tab=readme-ov-file#installation). + +Poetry is used by this project and pyenv will help you make sure you have a +Python version compatible with the poetry python project we use as part of +`./tools/devctr`. + +Once you have these two installed you can run the following to install the dev +container poetry project: + +``` +poetry -C ./tools/devctr install --no-root +``` + +Then, you can activate the poetry virtual environment by running: + +``` +poetry shell -C ./tools/devctr +``` + +Which you will need to do after modifying python or markdown files so that the +pre-commit can finish successfully. + Your contribution needs to meet the following standards: - Separate each **logical change** into its own commit. diff --git a/docs/getting-started.md b/docs/getting-started.md index 8d9e6420d08..dfbfecf83cf 100644 --- a/docs/getting-started.md +++ b/docs/getting-started.md @@ -48,7 +48,25 @@ distro installed, you can grant Read+Write access with: sudo setfacl -m u:${USER}:rw /dev/kvm ``` -Otherwise, if access is managed via the `kvm` group: +If access is managed via the `kvm` group, check that the KVM group exists: + +```bash +getent group kvm +``` + +and check that `/dev/kvm` is associated with the kvm group: + +```bash +ls -l /dev/kvm +``` + +You can see if your current user is already in the kvm group by running: + +```bash +groups +``` + +Otherwise, add your current user to the group by running: ```bash [ $(stat -c "%G" /dev/kvm) = kvm ] && sudo usermod -aG kvm ${USER} \