diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index f53177389..a67026268 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -50,7 +50,7 @@ tox # runs 'lint' and 'unit' environments Build the charm in this git repository using: ```shell -tox run -e build-dev +charmcraftcache pack ``` ### Deploy diff --git a/charmcraft.yaml b/charmcraft.yaml index ee6ac68fa..76151167e 100644 --- a/charmcraft.yaml +++ b/charmcraft.yaml @@ -16,17 +16,18 @@ parts: prime: - scripts charm: - override-pull: | - craftctl default - if [[ ! -f requirements.txt ]] - then - echo 'ERROR: Use "tox run -e build-dev" instead of calling "charmcraft pack" directly' >&2 - exit 1 - fi - charm-strict-dependencies: true + build-snaps: + - rustup build-packages: - libffi-dev - libssl-dev - pkg-config - - rustc - - cargo + 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 + charm-strict-dependencies: true diff --git a/tox.ini b/tox.ini index bfc07aa72..e0e390d6c 100644 --- a/tox.ini +++ b/tox.ini @@ -18,24 +18,6 @@ set_env = allowlist_externals = poetry -[testenv:build-{production,dev,wrapper}] -# Wrap `charmcraft pack` -pass_env = - CI - GH_TOKEN -allowlist_externals = - {[testenv]allowlist_externals} - charmcraft - charmcraftcache - mv -commands_pre = - poetry export --only main,charm-libs --output requirements.txt -commands = - build-production: charmcraft pack {posargs} - build-dev: charmcraftcache pack {posargs} -commands_post = - mv requirements.txt requirements-last-build.txt - [testenv:format] description = Apply coding style standards to code commands_pre = @@ -78,12 +60,7 @@ pass_env = CI GITHUB_OUTPUT SECRETS_FROM_GITHUB -allowlist_externals = - {[testenv:build-wrapper]allowlist_externals} commands_pre = poetry install --only integration - {[testenv:build-wrapper]commands_pre} commands = poetry run pytest -v --tb native --log-cli-level=INFO -s --ignore={[vars]tests_path}/unit/ {posargs} -commands_post = - {[testenv:build-wrapper]commands_post}