Conversation
- Set UV_CACHE_DIR in UV plugin's build environment to enable caching of wheels built from source - Add test to verify UV_CACHE_DIR is properly configured - This fixes the issue where wheels built with no-binary=true were not cached to the LXC host Co-authored-by: lengau <4305943+lengau@users.noreply.github.com>
|
@copilot write a spread test that checks this by using two separate |
|
@copilot write a spread test that checks this by using two separate uv based charms. |
- Create two test charms (charm1 and charm2) with UV plugin - Both charms use no-binary option to force building from source - Test verifies that wheels built by first charm are cached and reused by second charm - Checks cache directory structure and validates cache reuse by monitoring size Co-authored-by: lengau <4305943+lengau@users.noreply.github.com>
Created spread test at |
Increase threshold from 10% to 25% to avoid flaky tests due to filesystem metadata overhead and variations Co-authored-by: lengau <4305943+lengau@users.noreply.github.com>
|
Type checking with Command output |
1 similar comment
|
Type checking with Command output |
|
Type checking with Command output |
|
@copilot fix the linting issues |
|
@copilot fix the linting issues |
- Remove extra blank line in test_uv.py - Fix trailing whitespace in test_uv.py and task.yaml - Reformat long assertion message to multiple lines Co-authored-by: lengau <4305943+lengau@users.noreply.github.com>
|
Type checking with Command output |
|
@copilot the spread tests are failing. https://github.com/canonical/charmcraft/actions/runs/19983543607/job/57318936840?pr=2501#step:5:1501 |
- Move charm.py files to src/ directory (required charm structure) - Make charm.py files executable - Remove old hello.py files from root directory Co-authored-by: lengau <4305943+lengau@users.noreply.github.com>
Fixed the spread test structure. The charms were missing the required |
|
Type checking with Command output |
1 similar comment
|
Type checking with Command output |
Description
Fixes an issue where the UV plugin doesn't cache wheels built from source when
no-binary = trueis set in pyproject.toml. Wheels built during charm packing were not being saved to charmcraft's cache on the LXC host, causing them to be rebuilt on every pack operation.Changes Made
UV_CACHE_DIRenvironment variable in the UV plugin's build environment to point to the part's cache directory (charmcraft/parts/plugins/_uv.py)test_uv_cache_dir_setto verify UV_CACHE_DIR is properly configuredtest_get_build_environmentto check for UV_CACHE_DIR presencetests/spread/smoketests/uv-cache/with two separate UV-based charms to verify caching works correctlysrc/directory and making them executableTesting
make lint && make test.Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.