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

build: use the Charmcraft poetry plugin #652

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all 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
2 changes: 2 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ jobs:
uses: canonical/data-platform-workflows/.github/workflows/[email protected]
with:
cache: true
# Needed for the poetry plugin
charmcraft-snap-channel: latest/edge

integration-test:
strategy:
Expand Down
24 changes: 17 additions & 7 deletions charmcraft.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ bases:
channel: "22.04"
architectures: [arm64]
parts:
charm:
rust-deps:
plugin: nil
build-snaps:
- rustup
build-packages:
Expand All @@ -20,14 +21,23 @@ parts:
- libpq-dev
override-build: |
rustup default stable

# Convert subset of poetry.lock to requirements.txt
poetry-deps:
plugin: nil
build-packages:
- curl
build-environment:
- POETRY_VERSION: "1.8.0"
override-build: |
curl -sSL https://install.python-poetry.org | python3 -
/root/.local/bin/poetry export --only main,charm-libs --output requirements.txt
ln -sf $HOME/.local/bin/poetry /usr/local/bin/poetry

craftctl default
charm-strict-dependencies: true
charm-requirements: [requirements.txt]
/usr/bin/python3 -m pip install pip==24.2
charm:
after: [rust-deps, poetry-deps]
plugin: poetry
source: .
poetry-with:
- charm-libs
libpq:
build-packages:
- libpq-dev
Expand Down
Loading