Setup

Dependencies

This project has the following system level dependencies:

Python dependencies are listed in pyproject.toml.

Install

An overview of software repos where gallia is available is provided by repology.org.

Docker

Docker images are published via the Github Container registry.

Arch Linux

$ paru -S gallia

NixOS

$ nix shell nixpgks#gallia

For persistance add gallia to your environment.systemPackages, or when you use home-manager to home.packages.

Manual

$ pip install gallia

Note

pip installs executables to ~/.local/bin which conforms to XDG. Make sure that ~/.local/bin is included in your $PATH.

Development

The poetry build system is used to manage dependencies.

Clone repository

$ git clone https://github.com/Fraunhofer-AISEC/gallia.git

Environment

Poetry will create a unique virtual python environment with all the required dependencies. All poetry commands must be invoked within the gallia repository.

$ poetry install

More poetry commands are documented upstream.

shell

The created venv can be enabled via poetry with the shell command. A new shell will be spawned with the enabled environment.

$ poetry shell

run

Run a single command inside the venv without changing the shell environment:

$ poetry run gallia

Development with Plugins

If you want to develop gallia and plugins at the same time, then you need to add gallia as a development dependency to your plugin package. Use your plugin repo for poetry install and poetry shell.

This snippet in pyproject.toml is sufficiant to add a local, editable checkout to your repo:

[tool.poetry.dependencies]
gallia = { path = "/path/to/local/gallia", develop = true }

Shell Completion

bash

# register-python-argcomplete gallia > /etc/bash_completion.d/gallia

fish

$ mkdir -p ~/.config/fish/completions
$ register-python-argcomplete --shell fish gallia > ~/.config/fish/completions/gallia.fish

IDE Integration

Pycharm

pycharm offers native support for the poetry build system. The src folder in the gallia repository needs to be configured as Sources Root in pycharm.

LSP

Most editors (e.g. neovim) support the Language Server Protocol. The required tools are listed as development dependencies in pyproject.toml and are installed automatically via poetry. Please refer to the documentation of your text editor of choice for configuring LSP support.