Pack charms with local Python package dependencies
Project description
charmcraftlocal
Pack charms with local Python package dependencies
Installation
Install pipx: https://pipx.pypa.io/stable/installation/
pipx install charmcraftlocal
Usage
At the moment, only charms that manage Python dependencies with Poetry are supported.
Example directory layout
common/
# Local Python package with shared code
pyproject.toml
common/
__init__.py
kubernetes/
charmcraft.yaml
pyproject.toml
poetry.lock
# [...]
machines/
charmcraft.yaml
pyproject.toml
poetry.lock
# [...]
Example common/pyproject.toml
[project]
name = "common"
version = "0.1.0"
requires-python = ">=3.10"
dependencies = [
]
[build-system]
requires = ["poetry-core>=2.0.0,<3.0.0"]
build-backend = "poetry.core.masonry.api"
Step 1: Add local package to charm dependencies
Repeat this step for each charm that depends on the local package.
poetry add ../common --editable
Example pyproject.toml
[tool.poetry.dependencies]
common = {path = "../common", develop = true}
Step 2: Pack charm
ccl pack
How it works
Currently, during charmcraft pack, charmcraft can only access files in the directory that contains charmcraft.yaml.
charmcraftlocal
- searches (the charm's) pyproject.toml for local Python dependencies,
- copies them to the charm directory,
- and calls Poetry to update pyproject.toml and poetry.lock to reference the copied package(s)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file charmcraftlocal-0.1.0.tar.gz.
File metadata
- Download URL: charmcraftlocal-0.1.0.tar.gz
- Upload date:
- Size: 8.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
81fb3f67756122c37f299c1162c836149a56704cf303e7901db4d07dd03d89a2
|
|
| MD5 |
1615dab6a5f00f938c9a73cb45929d01
|
|
| BLAKE2b-256 |
457af472069c22fcef772bccbf3a18c867a3c5ebb57e550055a887eb6947c5a0
|
Provenance
The following attestation bundles were made for charmcraftlocal-0.1.0.tar.gz:
Publisher:
release.yaml on canonical/charmcraftlocal
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
charmcraftlocal-0.1.0.tar.gz -
Subject digest:
81fb3f67756122c37f299c1162c836149a56704cf303e7901db4d07dd03d89a2 - Sigstore transparency entry: 433406838
- Sigstore integration time:
-
Permalink:
canonical/charmcraftlocal@3a13fc3cbf58d9411fb6b5fb300966ffd986c761 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/canonical
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yaml@3a13fc3cbf58d9411fb6b5fb300966ffd986c761 -
Trigger Event:
push
-
Statement type:
File details
Details for the file charmcraftlocal-0.1.0-py3-none-any.whl.
File metadata
- Download URL: charmcraftlocal-0.1.0-py3-none-any.whl
- Upload date:
- Size: 10.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
525dcb93aba288ad069210a8ad1ee6f3a801735afca1dc2cdf633b13b2a7177a
|
|
| MD5 |
26161536bc0f001735f9c26293107233
|
|
| BLAKE2b-256 |
0cf41dc149961afe63336074e6d9006c810f0d0108dc7173a24b316652ce360f
|
Provenance
The following attestation bundles were made for charmcraftlocal-0.1.0-py3-none-any.whl:
Publisher:
release.yaml on canonical/charmcraftlocal
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
charmcraftlocal-0.1.0-py3-none-any.whl -
Subject digest:
525dcb93aba288ad069210a8ad1ee6f3a801735afca1dc2cdf633b13b2a7177a - Sigstore transparency entry: 433406864
- Sigstore integration time:
-
Permalink:
canonical/charmcraftlocal@3a13fc3cbf58d9411fb6b5fb300966ffd986c761 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/canonical
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yaml@3a13fc3cbf58d9411fb6b5fb300966ffd986c761 -
Trigger Event:
push
-
Statement type: