← Back to issue list

Charmcraft 3 does not install dependencies.

View original Github issue

Metadata

Project
charmcraft
Number
#1797
Type
issue
State
closed
Author
dstathis
Labels
Created
Updated
Closed

Current evaluation

Closed as intended behavior. charm-strict-dependencies requires the requirements file to explicitly list all packages. The previous implicit installation was a bug. See issue #1473.

Suggested action:

No scores available.

Issue body

### Bug Description When packing with charmcraft 3.x, I don't seem to have any python libraries available to my charm. ### To Reproduce Pack a charm and deploy it. ### Environment Charmcraft: 3.1.1 Juju: 3.5.3-genericlinux-amd64 ### charmcraft.yaml ```shell # Copyright 2021 Canonical Ltd. # See LICENSE file for licensing details. type: charm bases: - build-on: - name: "ubuntu" channel: "22.04" architectures: ["arm64"] run-on: - name: "ubuntu" channel: "22.04" architectures: ["arm64"] - build-on: - name: "ubuntu" channel: "20.04" architectures: ["arm64"] run-on: - name: "ubuntu" channel: "20.04" architectures: ["arm64"] - build-on: - name: "ubuntu" channel: "22.04" architectures: ["amd64"] run-on: - name: "ubuntu" channel: "22.04" architectures: ["amd64"] - build-on: - name: "ubuntu" channel: "20.04" architectures: ["amd64"] run-on: - name: "ubuntu" channel: "20.04" architectures: ["amd64"] parts: charm: charm-strict-dependencies: true build-packages: - git # The following are needed for tls-certificates-interface - build-essential - python3-dev - libffi-dev - libssl-dev - pkg-config - rustc - cargo cos-tool: plugin: dump source: . build-packages: - curl override-pull: | curl -L -O https://github.com/canonical/cos-tool/releases/latest/download/cos-tool-${CRAFT_TARGET_ARCH} chmod +x cos-tool-* ``` ### Relevant log output ```shell unit-agent-17: 10:30:39 WARNING unit.agent/17.install Traceback (most recent call last): unit-agent-17: 10:30:39 WARNING unit.agent/17.install File "/var/lib/juju/agents/unit-agent-17/charm/./src/charm.py", line 16, in <module> unit-agent-17: 10:30:39 WARNING unit.agent/17.install from charms.grafana_agent.v0.cos_agent import COSAgentRequirer unit-agent-17: 10:30:39 WARNING unit.agent/17.install File "/var/lib/juju/agents/unit-agent-17/charm/lib/charms/grafana_agent/v0/cos_agent.py", line 217, in <module> unit-agent-17: 10:30:39 WARNING unit.agent/17.install from cosl import GrafanaDashboard, JujuTopology unit-agent-17: 10:30:39 WARNING unit.agent/17.install File "/var/lib/juju/agents/unit-agent-17/charm/venv/cosl/__init__.py", line 8, in <module> unit-agent-17: 10:30:39 WARNING unit.agent/17.install from .juju_topology import JujuTopology unit-agent-17: 10:30:39 WARNING unit.agent/17.install File "/var/lib/juju/agents/unit-agent-17/charm/venv/cosl/juju_topology.py", line 74, in <module> unit-agent-17: 10:30:39 WARNING unit.agent/17.install from ops.charm import CharmBase unit-agent-17: 10:30:39 WARNING unit.agent/17.install File "/var/lib/juju/agents/unit-agent-17/charm/venv/ops/__init__.py", line 178, in <module> unit-agent-17: 10:30:39 WARNING unit.agent/17.install from . import pebble # type: ignore unit-agent-17: 10:30:39 WARNING unit.agent/17.install File "/var/lib/juju/agents/unit-agent-17/charm/venv/ops/pebble.py", line 68, in <module> unit-agent-17: 10:30:39 WARNING unit.agent/17.install import websocket # type: ignore unit-agent-17: 10:30:39 WARNING unit.agent/17.install ModuleNotFoundError: No module named 'websocket' unit-agent-17: 10:30:39 ERROR juju.worker.uniter.operation hook "install" (via hook dispatching script: dispatch) failed: exit status 1 ```

Evaluation history

Date Model Scores Action Summary
qwen3.6-35b-a3b-mtp-q6 Closed as intended behavior. charm-strict-dependencies requires the requirements file to explicitly list all packages. The previous implicit installation was a bug. See issue #1473.
qwen/qwen3.6-35b-a3b Closed as intended behavior. The charm-strict-dependencies flag requires all Python packages to be explicitly listed in the requirements file, replacing version 2.7's implicit resolution. See issue #1473.
qwen/qwen3.6-35b-a3b Closed as intended behavior. The charm-strict-dependencies flag requires the requirements file to explicitly list all Python packages. Automatic dependency bundling was removed in version 2.7. Refer to issue #1473 for details.
qwen3.6-35b-a3b-mtp-q6 Closed as intended behavior. The charm-strict-dependencies flag requires the requirements file to explicitly list all dependencies. This differs from version 2.7 and was documented in issue 1473.
qwen3.6-35b-a3b-mtp-q6 Closed as intended behavior. Charmcraft 3 requires a complete requirements file when charm-strict-dependencies is enabled. The previous behavior was a bug fixed in v3, as noted in issue #1473.

Update history

No update history recorded yet.

Related issues

Issue Project State Summary Similarity
#1389 'charm-strict-dependencies' requires at least one requirements file. in field 'parts.charm.charm-strict-dependencies' charmcraft closed Closed without a confirmed fix. Maintainer referenced PR #1808 and suggested a workaround, but the author confirmed the validation error persists in v2.7.3. The issue remains unresolved.
71%
#1753 Document strict dependencies in the charm plugin charmcraft closed Documentation request for charm-strict-dependencies was closed without resolution. An automated comment indicates it was synced to internal Jira ticket CRAFT-3260, suggesting the task was abandoned or superseded by internal tracking.
70%