Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update CONTRIBUTING.md to represent the recent build dependencies #408

Merged
merged 5 commits into from
Apr 18, 2024
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 39 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,49 @@ tox # runs 'lint' and 'unit' environments

## Build charm

Build the charm in this git repository using:
The build environment assumes that there are preinstalled on the system:
* [tox](https://tox.wiki/)
* [poetry](https://python-poetry.org/)
* [charmcraft](https://snapcraft.io/charmcraft)
* [charmcraftcache](https://pypi.org/project/charmcraftcache/)
taurus-forever marked this conversation as resolved.
Show resolved Hide resolved
* [pipx](https://python.land/virtual-environments/pipx)
taurus-forever marked this conversation as resolved.
Show resolved Hide resolved
* [libpq-dev](https://pypi.org/project/libpq-dev/)
taurus-forever marked this conversation as resolved.
Show resolved Hide resolved

To build the charm it is also necessary at least 5GB if free disk space and
taurus-forever marked this conversation as resolved.
Show resolved Hide resolved
it is recommended to provide 4+ CPU cores and 8GB+ RAM for a decent build speed.

To install all above build dependencies (assuming you are on Ubuntu 22.04 LTS):

```shell
tox run -e build-dev
sudo snap install charmcraft --classic

sudo snap install lxd # should be pre-installed on 22.04
lxd init --auto # init LXD (if never used earlier)

sudo apt update && sudo apt install --yes libpq-dev pipx
taurus-forever marked this conversation as resolved.
Show resolved Hide resolved

pipx install poetry
pipx install charmcraftcache
pipx ensurepath
```

Ensure local pip binaries are in your $PATH (otherwise re-login to your shell):
```shell
charmcraftcache --help
```

Make sure the install tox version is 4+ (using `tox --version`), if missing OR
the previos version installed as debian package (topical for Ubuntu 22.04 LTS):
purge it and install from pip:
```shell
sudo apt purge tox && pipx install tox && tox --version
taurus-forever marked this conversation as resolved.
Show resolved Hide resolved
```

The tox build environment assumes that there is a preinstalled [poetry](https://python-poetry.org/) on the system.
Build the charm (inside this Git repository):

```shell
tox run -e build-dev
```

### Deploy

Expand Down
Loading