← Back to issue list

feat(profiles): bound dependencies, remove uv.lock files, improve init output

View original Github issue

Metadata

Project
charmcraft
Number
#2754
Type
pull request
State
merged
Author
dwilding
Labels
Created
Updated
Closed

Current evaluation

Merged after reviewer approval. Bounded dependencies for kubernetes and machine profiles, removed uv.lock from templates, improved charmcraft init output to match requested profiles, and updated documentation. Fixes #2749.

Suggested action:

No scores available.

Issue body

This PR makes several changes related to profiles. Fixes #2749. --- 1. For the `kubernetes` and `machine` profiles, bound all dependencies so that (on user update) they stay within the same major version. The minimum version of each dependency is the latest tested major.minor version. See: - `charmcraft/templates/init-kubernetes/pyproject.toml.j2` - `charmcraft/templates/init-machine/pyproject.toml.j2` --- 2. Remove `uv.lock` from the `kubernetes` and `machine` profiles. After internal discussion, we feel it makes more sense for the user to lock and ensure they have up-to-date dependencies, rather than us continually bumping the template lockfiles. After making this change, I updated the Spread tests as thoroughly as I could. --- 3. Make the output of `charmcraft init` better match the requested profile: - The summary of created files is now correct for each type of profile. E.g., for `flask-framework` the summary lists `requirements.txt`; for `test-kubernetes` the summary only lists Spread-related files. - For profiles that use uv to manage dependencies, include a message that explains about running `uv lock`. This applies to `kubernetes`, `machine`, and the upcoming 26.04 12-factor profiles. It doesn't apply to the existing 12-factor profiles. **Example for `kubernetes`** ```text $ charmcraft init Created project files for your charm: charmcraft.yaml pyproject.toml README.md src/charm.py src/myapp.py ... To manage your charm's dependencies, use uv. To migrate from the Charm plugin to the uv plugin, see: https://canonical.com/juju/docs/charmcraft/stable/howto/migrate-plugins/charm-to-uv/ Next steps: 1. Run 'uv lock' 2. Edit charmcraft.yaml and pyproject.toml to provide metadata, then commit (including uv.lock) 3. Write your charm code and tests ``` **Example for `flask-framework`** ```text $ charmcraft init --profile flask-framework Created project files for your charm: charmcraft.yaml pyproject.toml requirements.txt src/charm.py ... ``` --- 4. Updated `init` examples in the documentation: - [Manage charms > Initialise a charm](https://canonical-charmcraft--2754.com.readthedocs.build/2754/howto/manage-charms/#initialise-a-charm) (expand "Example session") - [Manage extensions > View details about the extension in use](https://canonical.com/juju/docs/charmcraft/4.3/howto/manage-extensions/#view-details-about-the-extension-in-use) (expand "Example") --- 5. Updated file reference docs to present uv-managed charms as the default, which will automatically cover the 26.04 12-factor profiles when they are released. The existing 12-factor profiles are called out as an exception. - [`pyproject.toml` file](https://canonical-charmcraft--2754.com.readthedocs.build/2754/reference/files/pyproject-toml-file/) - [`requirements.txt` file](https://canonical-charmcraft--2754.com.readthedocs.build/2754/reference/files/requirements-txt-file/) - [`tox.ini` file](https://canonical-charmcraft--2754.com.readthedocs.build/2754/reference/files/tox-ini-file/) - [`uv.lock` file](https://canonical-charmcraft--2754.com.readthedocs.build/2754/reference/files/uv-lock-file/) I also updated the `init` command help. See `charmcraft/application/commands/init.py`. For info about the upcoming 26.04 12-factor profiles, see #2742. --- - [x] I've followed the [contribution guidelines](https://github.com/canonical/charmcraft/blob/main/CONTRIBUTING.md). - [x] I've signed the [CLA](http://www.ubuntu.com/legal/contributors/). - [x] I've successfully run `make lint && make test`. - [x] I've added or updated any relevant documentation. - [ ] In documents I changed, I [added a meta description](https://canonical-starflow.readthedocs-hosted.com/how-to/add-a-page-meta-description/) if one was missing. - [ ] I've updated the relevant release notes.

Evaluation history

Date Model Scores Action Summary
qwen/qwen3.6-35b-a3b Merged after reviewer approval. Bounded dependencies for kubernetes and machine profiles, removed uv.lock from templates, improved charmcraft init output to match requested profiles, and updated documentation. Fixes #2749.
qwen/qwen3.6-35b-a3b
Staleness: 5
Complexity: 30
Confidence: 90
needs review Binds dependencies, removes uv.lock from templates, and improves charmcraft init output and docs. Approved by 3 reviewers with 4 unresolved comments. CI pending.
qwen/qwen3.6-35b-a3b
Staleness: 5
Complexity: 45
Confidence: 90
needs review Binds dependencies in kubernetes/machine profiles, removes uv.lock from templates, improves init output, and updates docs. Currently has 3 approvals, recent author activity, and is marked ready to merge pending final maintainer review.
qwen/qwen3.6-35b-a3b
Staleness: 15
Complexity: 45
Confidence: 90
needs review Binds dependencies, removes uv.lock from templates, and improves charmcraft init output and docs. Currently approved by 3 reviewers with 4 unresolved comments, CI failing on snap-build and min dependencies, awaiting final maintainer review.
qwen/qwen3.6-35b-a3b
Staleness: 15
Complexity: 35
Confidence: 90
needs review Binds dependencies, removes uv.lock from kubernetes/machine profiles, improves init output, and updates docs. Currently awaiting maintainer review after contributor addressed feedback and re-requested it.
qwen/qwen3.6-35b-a3b
Staleness: 10
Complexity: 35
Confidence: 85
needs review Binds dependencies, removes uv.lock from templates, and improves init output for profiles. Fixes #2749. Holds three approvals, four unresolved comments, and recent author updates. CI shows some expected failures.
qwen/qwen3.6-35b-a3b
Staleness: 5
Complexity: 40
Confidence: 90
needs review Binds dependencies for kubernetes/machine profiles, removes uv.lock templates, and improves charmcraft init output. Currently has 3 approvals but 6 unresolved review comments and failing CI. Author addressed feedback and requested re-review.
qwen/qwen3.6-35b-a3b
Staleness: 40
Complexity: 45
Confidence: 85
keep open Binds dependencies, removes uv.lock from templates, and improves init output for profiles. Currently approved by 3 reviewers with 6 unresolved comments, pending CI checks, and awaiting author return from break.
qwen/qwen3.6-35b-a3b
Staleness: 20
Complexity: 40
Confidence: 85
keep open Binds dependencies and removes uv.lock from kubernetes/machine templates, improves init output and docs. Currently approved by 3 reviewers but has 20 unresolved comments and pending CI; author paused to address feedback until Aug 10.
qwen/qwen3.6-35b-a3b
Staleness: 40
Complexity: 40
Confidence: 80
needs review Binds dependencies, removes uv.lock files, and improves init output and docs for profiles. Currently paused by author until Aug 10, awaiting review feedback and CI fixes.
qwen/qwen3.6-35b-a3b
Staleness: 25
Complexity: 40
Confidence: 85
keep open Binds dependencies, removes uv.lock from templates, and improves charmcraft init output/docs. Approved by 3 reviewers but has 20 unresolved comments and failing CI. Author paused until Aug 10.
qwen3.6-35b-a3b-mtp-q6
Staleness: 15
Complexity: 45
Confidence: 90
keep open Updates charmcraft init profiles to bound dependencies, remove template uv.lock files, and improve CLI output. Approved by 3 reviewers but paused by author until Aug 17 to address 23 unresolved comments.
qwen3.6-35b-a3b-mtp-q6
Staleness: 45
Complexity: 40
Confidence: 80
keep open Binds dependencies and removes uv.lock from kubernetes and machine profiles, improves init output, and updates documentation. Approved by three reviewers but has 23 unresolved comments and failing snap-build CI. Author paused work until Aug 17.
qwen/qwen3.6-35b-a3b
Staleness: 5
Complexity: 45
Confidence: 85
needs review Binds dependencies, removes uv.lock from templates, improves init output, and updates docs. Currently approved but blocked by 24 unresolved review comments and failing CI checks while the author pauses for a break.
qwen/qwen3.6-35b-a3b
Staleness: 15
Complexity: 40
Confidence: 90
needs review Binds dependencies for kubernetes/machine profiles, removes uv.lock templates, and improves charmcraft init output. Approved by 2 reviewers with 12 unresolved comments. CI passing, some checks pending.
qwen3.6-35b-a3b-mtp-q6
Staleness: 10
Complexity: 45
Confidence: 85
keep open Binds dependency versions in pyproject.toml.j2 and disables uv.lock generation. Currently a work in progress blocked on upstream PRs #2742 and #2748, awaiting doc updates and maintainer review.

Update history

Date Change
updated
updated
updated
updated
updated
updated
updated
updated
updated
updated
updated
updated
updated
updated
updated
updated
updated
updated
updated
updated
updated
updated
updated
updated
updated
updated

Related issues

Issue Project State Summary Similarity
#2312 feat(templates): use uv for testing and packing kubernetes and machine charms charmcraft merged Merged. Updated charmcraft init templates for kubernetes and machine profiles to use uv for testing and packing. Replaced requirements.txt with pyproject.toml, added a managed uv.lock template, updated documentation, and bumped the minimum ops version to 3.0.
76%
#2749 Remove uv.lock from `kubernetes` and `machine` profiles charmcraft closed Merged changes to remove uv.lock from kubernetes and machine profiles during charm initialization. Updated init output to guide developers in running uv lock manually.
73%
#2401 feat(test): add testing profiles for init command charmcraft merged Merged. Adds test-machine and test-kubernetes profiles to the init command for charmcraft test. Fixes #2365. Approved by three reviewers despite failing CI checks. Future updates will integrate jubilant and expand profiles.
73%
#859 Added a kubernetes profile to init command (CRAFT-1318). charmcraft merged Merged. Added a Kubernetes profile to the init command and fixed the simple template. Approved by two reviewers, the change modified 17 files (+196/-21 lines), resolving CRAFT-1318.
72%
#2311 docs(templates): list all 12-factor profiles in init help charmcraft merged Merged PR updates charmcraft help init to list all 12-factor profiles. Incorporated reviewer feedback to add Kubernetes to extension descriptions. Approved by three reviewers and merged after CI checks passed.
71%