chore: add dev workshop - #6263
Conversation
- install-branch: Install packages from git branches or URLs Supports both short names (craft-parts) and full URLs Defaults to canonical org for short names - lock: Run uv lock with custom arguments and update setup Automatically runs make setup after locking dependencies Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
medubelko
left a comment
There was a problem hiding this comment.
Can you include a description and the basic usage in docs/contribute/development.rst? You can mark it with a WIP admonition (!).
There was a problem hiding this comment.
| all tools and dependencies pre-installed. It's an alternative to the local | ||
| environment described in the previous section. | ||
|
|
||
| When the workshop starts, it automatically runs ``make setup`` inside the |
There was a problem hiding this comment.
How does the user start it?
There was a problem hiding this comment.
Added a bit more, and I've ended this section with a link to the Workshop tutorial.
|
|
||
| Two additional helpers support dependency work. | ||
|
|
||
| ``lock`` runs ``uv lock`` with any arguments you pass, then re-runs |
There was a problem hiding this comment.
| ``lock`` runs ``uv lock`` with any arguments you pass, then re-runs | |
| The ``lock`` helper runs ``uv lock`` with any arguments you pass, then re-runs |
There was a problem hiding this comment.
In the clear light of day I'm changing these to "actions" (including replacing it above).
| lint: make lint | ||
| format: make format |
There was a problem hiding this comment.
My puter 'splodes whenever I try to run either of these:
❯ workshop run -- format
success=true
ruff check --fix snapcraft tests || success=false
ruff format snapcraft tests
$success || exit 1
error: Failed to initialize cache at /var/lib/snapd/void/.ruff_cache: Permission denied (os error 13)
E902 No such file or directory (os error 2)
--> snapcraft:1:1
E902 No such file or directory (os error 2)
--> tests:1:1
Found 2 errors.
error: Failed to initialize cache at /var/lib/snapd/void/.ruff_cache: Permission denied (os error 13)
error: Failed to format snapcraft: No such file or directory (os error 2)
error: Failed to format tests: No such file or directory (os error 2)
make: *** [common.mk:107: format-ruff] Error 2
❯ workshop run -- lint
ruff check snapcraft tests
ruff format --diff snapcraft tests
error: Failed to initialize cache at /var/lib/snapd/void/.ruff_cache: Permission denied (os error 13)
E902 No such file or directory (os error 2)
--> snapcraft:1:1
E902 No such file or directory (os error 2)
--> tests:1:1
Found 2 errors.
make: *** [common.mk:129: lint-ruff] Error 1
mr-cal
left a comment
There was a problem hiding this comment.
Thanks, it works great!
Unless you use worktrees, in which case it doesn't work!! 😠 (worktree bug incoming)
| With the `Workshop Snap <https://snapcraft.io/workshop>`__ installed, start the | ||
| development environment by running ``workshop launch dev`` from within the Snapcraft | ||
| directory. When the workshop starts, it automatically runs ``make setup`` inside the | ||
| container. From there, use the pre-configured actions to carry out common | ||
| development tasks: |
There was a problem hiding this comment.
I think the inline command is easy to skim over when the rest of the commands are code-blocked:
| With the `Workshop Snap <https://snapcraft.io/workshop>`__ installed, start the | |
| development environment by running ``workshop launch dev`` from within the Snapcraft | |
| directory. When the workshop starts, it automatically runs ``make setup`` inside the | |
| container. From there, use the pre-configured actions to carry out common | |
| development tasks: | |
| With the `Workshop Snap <https://snapcraft.io/workshop>`__ installed, start the | |
| development environment from within the Snapcraft directory: | |
| .. code-block:: bash | |
| workshop launch dev | |
| When the workshop starts, it automatically runs ``make setup`` inside the | |
| container. From there, use the pre-configured actions to carry out common | |
| development tasks: |
This adds a new
devworkshop for developing snapcraft. Mostly this just uses Workshop to expose the major parts of the Makefile nicely (and of course to set up your workshop), but it also adds two new workshop actions for the dev environment:install-branch: Install packages from git branches or URLs
craft-parts(defaults to canonical org)workshop run -- install-branch craft-parts mainlock: Run uv lock with custom arguments and update setup
make setupafter locking dependenciesworkshop run -- lockorworkshop run -- lock --refreshThese actions improve the dev workflow by making dependency management and testing against branches easier.