Skip to content

Commit

Permalink
Change: Update README regarding installation and updates (#448)
Browse files Browse the repository at this point in the history
For Python devs familiar with poetry these steps are mostly obvious. But
this is not the case for new or outside contributors.

---------

Co-authored-by: Joseph <[email protected]>
  • Loading branch information
bjoernricks and syspect-sec authored Feb 9, 2024
1 parent 4a0e973 commit 4c79185
Showing 1 changed file with 41 additions and 8 deletions.
49 changes: 41 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,26 +9,41 @@ https://greenbone.github.io/docs/

For a manual build locally Python >= 3.9 and [poetry] is required.

## Install Dependencies
## Install Poetry

To install poetry it is recommended to use [pipx]. pipx can be installed with
the following command on Debian based systems:

```sh
sudo apt install pipx
```

Install poetry using pipx

To install poetry it is recommended to use [pipx]
```sh
python3 -m pipx install poetry
```

To install the project dependencies via [poetry] run
## Install and Upgrade Dependencies

When building the docs you should ensure that all the dependencies are installed
and up to date. To install for the first time or to update the project
dependencies via [poetry] run:

```sh
poetry install
poetry install --no-root
```

You should run this command once a week to install the latest dependencies.

## Manual Build

After installing [poetry] and the project's dependencies, the docs can be build with
After installing [poetry] and the project's dependencies, the docs can be built with:
```sh
poetry run make html
```

To open the generated HTML docs with Firefox you can run
To open the generated HTML docs with Firefox you can run:

```sh
firefox _build/html/index.html
Expand All @@ -37,17 +52,35 @@ firefox _build/html/index.html
## Auto Rebuild

Alternatively it is possible to start a local HTTP server that automatically
rebuilds the docs on every file change
rebuilds the docs on every file change:

```sh
poetry run make livehtml
```

To open the served docs with Firefox you can run
To open the served docs with Firefox you can run:

```sh
firefox http://127.0.0.1:8000
```

## Starting From Scratch

If something is wrong with your dependencies or you just want to re-start from
a clean environment you need to remove the [virtual environment](https://docs.python.org/3/library/venv.html).
First of all ensure that poetry's virtual environment is placed within the
project:

```sh
poetry config virtualenvs.in-project true
```

Afterwards the virtual environment including all installed dependencies can be
deleted:

```sh
rm -rf .venv
```

[poetry]: https://python-poetry.org/
[pipx]: https://pipx.pypa.io/stable/

0 comments on commit 4c79185

Please sign in to comment.