Skip to content

Commit 792434c

Browse files
Enable poetry hashes & charmcraft strict dependencies (#179)
charmcraft strict dependencies prevents PYDEPS from overriding pinned dependencies (and requires that we manage PYDEPS dependencies with poetry)
1 parent e7c9523 commit 792434c

File tree

4 files changed

+6
-2
lines changed

4 files changed

+6
-2
lines changed

.github/workflows/ci.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,8 @@ jobs:
4545
build:
4646
name: Build charm
4747
uses: canonical/data-platform-workflows/.github/workflows/[email protected]
48+
with:
49+
charmcraft-snap-channel: beta
4850
permissions:
4951
actions: write # Needed to manage GitHub Actions cache
5052

.github/workflows/release.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ jobs:
3333
build:
3434
name: Build charm
3535
uses: canonical/data-platform-workflows/.github/workflows/[email protected]
36+
with:
37+
charmcraft-snap-channel: beta
3638

3739
release:
3840
name: Release charm

charmcraft.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ parts:
1818
echo 'ERROR: Use "tox run -e build" instead of calling "charmcraft pack" directly' >&2
1919
exit 1
2020
fi
21+
charm-strict-dependencies: true
2122
charm-entrypoint: src/kubernetes_charm.py
2223
prime:
2324
- charm_version

tox.ini

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,7 @@ commands_pre =
3434
# is pending review.
3535
python -c 'import pathlib; import shutil; import subprocess; git_hash=subprocess.run(["git", "describe", "--always", "--dirty"], capture_output=True, check=True, encoding="utf-8").stdout; file = pathlib.Path("charm_version"); shutil.copy(file, pathlib.Path("charm_version.backup")); version = file.read_text().strip(); file.write_text(f"{version}+{git_hash}")'
3636

37-
# `--without-hashes` workaround for https://github.com/canonical/charmcraft/issues/1179
38-
poetry export --only main,charm-libs --output requirements.txt --without-hashes
37+
poetry export --only main,charm-libs --output requirements.txt
3938
commands =
4039
build: charmcraft pack {posargs}
4140
commands_post =

0 commit comments

Comments
 (0)