Skip to content
Open
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
7 changes: 4 additions & 3 deletions interfaces/tls-certificates/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -80,10 +80,11 @@ extends = "../../pyproject.toml"
include = ["src", "tests", "interface"]
pythonVersion = "3.10" # check no python > 3.10 features are used
ignore = [
"tests/integration/charms/*/published/src/charmlibs",
"tests/integration/charms/*/library/src/charmlibs",
# symlink sources; the charm code is checked via the dereferenced copies in each charm's src/
"tests/integration/charms/common",
# imports the Charmhub-hosted lib, which is only present in the packed charm
"tests/integration/charms/requirer/fetch_lib_charm.py",
"tests/integration/charms/requirer/fetch-lib-*",
"tests/integration/charms/fetch-lib-*",
]

[tool.charmlibs.functional]
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Placeholder README for the library under test

This directory is a local copy of the library under test. Test charms depend on it by creating a symlink to it and pointing their `tool.uv.sources` there.

We need this local copy rather than just symlinking to the parent library directory so that when we `cp --recursive --dereference` the test charm to prepare it for packing, the library symlink is not recursive.

- `pyproject.toml` and `src/` are symlinks to the real library at the package root so the charm always builds against the current source.
- `README.md` is this placeholder. A readme is required because the library decalares `readme = "README.md", and hatchling fails the build if that file is missing.
Comment on lines +1 to +8

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The placeholder readme.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# empty file to satisfy extends in */[local-]library/pyproject.toml

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

10 changes: 5 additions & 5 deletions interfaces/tls-certificates/tests/integration/pack.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env bash
# This script is executed in this directory via `just pack-k8s` or `just pack-machine`.
# Extra args are passed to this script, e.g. `just pack-k8s foo` -> $1 is 'foo'.
# Extra args are passed to this script, e.g. `just pack-k8s <package> foo` -> $1 is 'foo'.
# In CI, the `just pack-<substrate>` commands are invoked:
# - If this file exists and `just integration-<substrate>` would execute any tests
# - Before running integration tests
Expand All @@ -9,8 +9,8 @@
# Environment variables:
# $CHARMLIBS_SUBSTRATE will have the value 'k8s' or 'machine' (set by pack-k8s or pack-machine)
# In CI, $CHARMLIBS_TAG is set based on pyproject.toml:tool.charmlibs.integration.tags
# For local testing, set $CHARMLIBS_TAG directly or use the tag variable. For example:
# just tag=24.04 pack-k8s some extra args
# For local testing, set $CHARMLIBS_TAG directly or use the --tag option. For example:
# just pack-k8s --tag=24.04 <package>
set -xueo pipefail

TMP_DIR=".tmp" # clean temporary directory where charms will be packed
Expand All @@ -26,7 +26,7 @@ for charm in 'provider' 'requirer'; do

: copy charm files to temporary directory for packing, dereferencing symlinks
rm -rf "$charm_tmp_dir"
cp --recursive --dereference "charms/$charm/$variant" "$charm_tmp_dir"
cp --recursive --dereference "charms/$variant-$charm-charm" "$charm_tmp_dir"

: pack charm
cd "$charm_tmp_dir"
Expand All @@ -48,7 +48,7 @@ for variant_and_lib in 'fetch-lib-latest=4' 'fetch-lib-pre-fix=4.26'; do
charm_tmp_dir="$TMP_DIR/requirer-$variant"

rm -rf "$charm_tmp_dir"
cp --recursive --dereference "charms/requirer/$variant" "$charm_tmp_dir"
cp --recursive --dereference "charms/$variant-requirer-charm" "$charm_tmp_dir"

: declare the Charmhub lib at the pinned version, then fetch and pack
printf '\ncharm-libs:\n - lib: tls_certificates_interface.tls_certificates\n version: "%s"\n' \
Expand Down
Loading