Skip to content

Commit

Permalink
Remove build wrapper
Browse files Browse the repository at this point in the history
  • Loading branch information
carlcsaposs-canonical committed Sep 25, 2024
1 parent 3029a20 commit 48406a9
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 34 deletions.
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
21 changes: 11 additions & 10 deletions charmcraft.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
23 changes: 0 additions & 23 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -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 =
Expand Down Expand Up @@ -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}

0 comments on commit 48406a9

Please sign in to comment.