← Back to issue list

Allow changing the charm entrypoint with the `python` and `poetry` plugins

View original Github issue

Metadata

Project
charmcraft
Number
#1994
Type
issue
State
open
Author
carlcsaposs-canonical
Labels
—
Created
Updated
Closed
—

Current evaluation

Python and Poetry plugins do not support custom charm entrypoints; dispatch generation expects src/charm.py. Maintainers acknowledge the limitation and are tracking a clearer warning.

Suggested action: keep open

Reason: The report provides a pinned repository revision and exact packaging reproduction, and current dispatch code confirms that entrypoint discovery defaults to src/charm.py. Maintainer @lengau acknowledged that the missing dispatch behavior is intentional, renamed the issue around custom entrypoint support, and noted that a better warning is needed, so this remains a valid scoped feature request rather than a resolved bug.

Evaluated by: mr-cal-bot

Impact: 52 Quick Win: 24 Complexity: 43 Confidence: 94 Actionability: 82

Issue body

### Bug Description `dispatch` file missing from *.charm file when using poetry plugin ### To Reproduce ``` git clone https://github.com/canonical/mysql-router-k8s-operator cd mysql-router-k8s-operator git checkout 1940ada229f9d873b7b07f6c3af66493c37cb15a charmcraft pack -v mkdir foo cd foo unzip ../mysql-router-k8s_ubuntu-22.04-amd64.charm ls foo ``` dispatch file missing in `foo` ### Environment Ubuntu 22.04 ``` $ snap list Name Version Rev Tracking Publisher Notes charmcraft 3.2.2.post75+gff00a899 5394 3.x/edge canonical✓ classic,held core18 20240920 2846 latest/stable canonical✓ base core20 20240911 2434 latest/stable canonical✓ base core22 20241001 1663 latest/stable canonical✓ base juju 3.5.4 28520 3/stable canonical✓ - lxd 5.0.3-80aeff7 29351 5.0/stable/… canonical✓ - microk8s v1.29.9 7227 1.29-strict/stable canonical✓ - snapd 2.63 21759 latest/stable canonical✓ snapd ``` ### charmcraft.yaml ```yaml # Copyright 2022 Canonical Ltd. # See LICENSE file for licensing details. type: charm bases: - name: ubuntu channel: "22.04" architectures: [amd64] - name: ubuntu channel: "22.04" architectures: [arm64] parts: poetry-deps: plugin: nil build-packages: - curl override-build: | python3 -m pip install --upgrade pip==24.3.1 curl -sSL https://install.python-poetry.org | python3 - --version 1.8.4 ln -sf $HOME/.local/bin/poetry /usr/local/bin/poetry foo: plugin: poetry source: . after: - poetry-deps poetry-with: - charm-libs build-snaps: - rustup build-packages: - libffi-dev - libssl-dev - pkg-config override-build: | rustup default stable craftctl default # # files: # plugin: dump # source: . # build-packages: # - git # override-build: | # # Workaround to add unique identifier (git hash) to charm version while specification # # DA053 - Charm versioning # # (https://docs.google.com/document/d/1Jv1jhWLl8ejK3iJn7Q3VbCIM9GIhp8926bgXpdtx-Sg/edit?pli=1) # # is pending review. # python3 -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}")' # # craftctl default # stage: # # Exclude requirements.txt file during staging # # Workaround for https://github.com/canonical/charmcraft/issues/1389 on charmcraft 2 # - -requirements.txt # prime: # - charm_version # - workload_version # - scripts # charm: # build-snaps: # - rustup # build-packages: # - libffi-dev # - libssl-dev # - pkg-config # override-build: | # rustup default stable # # # Convert subset of poetry.lock to requirements.txt # curl -sSL https://install.python-poetry.org | python3 - # /root/.local/bin/poetry export --only main,charm-libs --output requirements.txt # # craftctl default # stage: # # Exclude charm_version file during staging # - -charm_version # charm-strict-dependencies: true # charm-requirements: [requirements.txt] # charm-entrypoint: src/kubernetes_charm.py ``` ### Relevant log output [charmcraft-20241115-101114.717652.log](https://github.com/user-attachments/files/17774166/charmcraft-20241115-101114.717652.log)

Evaluation history

Date Model Scores Action Summary
stealth/space-bunny-alpha
Impact: 52
Quick Win: 24
Complexity: 43
Confidence: 94
Actionability: 82
keep open Python and Poetry plugins do not support custom charm entrypoints; dispatch generation expects src/charm.py. Maintainers acknowledge the limitation and are tracking a clearer warning.
~deepseek/deepseek-pro-latest
Impact: 40
Quick Win: 14
Complexity: 50
Confidence: 85
Actionability: 70
keep open Feature request to allow custom charm entrypoints with python/poetry plugins; dispatch file currently hardcodes src/charm.py. Maintainer acknowledged and renamed the issue; internal ticket CRAFT-3697 created.
~deepseek/deepseek-pro-latest
Impact: 45
Quick Win: 14
Complexity: 55
Confidence: 85
Actionability: 70
keep open Feature request to allow custom charm entrypoints with python/poetry plugins; dispatch file currently hardcodes src/charm.py. Maintainer acknowledged and renamed the issue; internal ticket CRAFT-3697 created.
qwen/qwen3.6-35b-a3b
Impact: 35
Quick Win: 10
Complexity: 50
Confidence: 65
Actionability: 60
keep open Feature request to allow charm-entrypoint configuration with the poetry plugin; maintainer says current behavior is intentional but a warning should be added.
qwen/qwen3.8-27b
Impact: 50
Quick Win: 22
Staleness: 70
Complexity: 55
Confidence: 72
Support Request: 20
keep open Feature request to support charm-entrypoint with python and poetry plugins (originally reported as missing dispatch file). Maintainer renamed the issue and acknowledged it, but no implementation or further activity since Nov 2024.
qwen/qwen3.6-35b-a3b
Staleness: 85
Complexity: 15
Confidence: 90
Support Request: 95
close not a bug Maintainer confirmed missing dispatch file is intentional behavior when using the poetry plugin, not a bug. Suggested improving error messaging instead. Issue is over a year old with no further activity.
qwen3.6-35b-a3b-mtp-q6
Staleness: 90
Complexity: 20
Confidence: 70
Support Request: 30
close stale Reporter reported missing dispatch file with poetry plugin. Maintainer confirmed behavior is intentional but noted need for better warnings. Title updated to request configurable entrypoints. Inactive for over a year.
qwen3.6-35b-a3b-mtp-q6
Staleness: 85
Complexity: 30
Confidence: 75
Support Request: 10
keep open Feature request to allow configuring charm entrypoints for python and poetry plugins. Maintainer acknowledged the original report as intentional behavior and renamed the issue. Currently inactive and awaiting prioritization.

Update history

No update history recorded yet.

Related issues

Issue Project State Summary Similarity
#1873 Create charmcraft-specific versions of the upstream `python` and `poetry` plugins charmcraft closed Charmcraft-specific Python and Poetry plugins were added by merged PR #1899 (commit 8b748f3e), replacing the experimental work in #1840.
71%