From f1c539519e5e9158cf20ebddf9f8c695e8784260 Mon Sep 17 00:00:00 2001 From: Valentin Haudiquet Date: Fri, 6 Feb 2026 23:52:26 +0100 Subject: [PATCH] Initial commit --- .gitignore | 10 + .launchpad.yaml | 13 + CONTRIBUTING.md | 35 +++ LICENSE | 202 ++++++++++++++ README.md | 89 ++++++ charmcraft.yaml | 29 ++ pyproject.toml | 77 ++++++ src/charm.py | 70 +++++ src/charmed_server.py | 152 +++++++++++ tests/integration/conftest.py | 47 ++++ tests/integration/test_charm.py | 26 ++ tests/unit/test_charm.py | 29 ++ tox.ini | 80 ++++++ uv.lock | 461 ++++++++++++++++++++++++++++++++ 14 files changed, 1320 insertions(+) create mode 100644 .gitignore create mode 100644 .launchpad.yaml create mode 100644 CONTRIBUTING.md create mode 100644 LICENSE create mode 100644 README.md create mode 100644 charmcraft.yaml create mode 100644 pyproject.toml create mode 100755 src/charm.py create mode 100644 src/charmed_server.py create mode 100644 tests/integration/conftest.py create mode 100644 tests/integration/test_charm.py create mode 100644 tests/unit/test_charm.py create mode 100644 tox.ini create mode 100644 uv.lock diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..a89928f --- /dev/null +++ b/.gitignore @@ -0,0 +1,10 @@ +venv/ +build/ +*.charm +.tox/ +.coverage +__pycache__/ +*.py[cod] +.idea +.vscode/ +src/static/ \ No newline at end of file diff --git a/.launchpad.yaml b/.launchpad.yaml new file mode 100644 index 0000000..a715f5e --- /dev/null +++ b/.launchpad.yaml @@ -0,0 +1,13 @@ +pipeline: + - tox + +jobs: + tox: + series: noble + architectures: amd64 + snaps: + - astral-uv + run: | + uv tool install tox --with tox-uv + export PATH="${HOME}/.local/bin:${PATH}" + tox diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..b8064bd --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,35 @@ +# Contributing + +To make contributions to this charm, you'll need a working +[development setup](https://documentation.ubuntu.com/juju/3.6/howto/manage-your-deployment/#set-up-your-deployment-local-testing-and-development). + +You can create an environment for development with `tox`: + +```shell +tox devenv -e integration +source venv/bin/activate +``` + +## Testing + +This project uses `tox` for managing test environments. There are some pre-configured environments +that can be used for linting and formatting code when you're preparing contributions to the charm: + +```shell +tox run -e format # update your code according to linting rules +tox run -e lint # code style +tox run -e static # static type checking +tox run -e unit # unit tests +tox run -e integration # integration tests +tox # runs 'format', 'lint', 'static', and 'unit' environments +``` + +## Build the charm + +Build the charm in this git repository using: + +```shell +charmcraft pack +``` + +