diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 6376e7a783..e407e18ec0 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -23,7 +23,7 @@ on: jobs: lint: name: Lint - uses: canonical/data-platform-workflows/.github/workflows/lint.yaml@v21.0.1 + uses: canonical/data-platform-workflows/.github/workflows/lint.yaml@v22.0.0 unit-test: name: Unit test charm @@ -45,7 +45,7 @@ jobs: build: name: Build charm - uses: canonical/data-platform-workflows/.github/workflows/build_charm.yaml@v21.0.1 + uses: canonical/data-platform-workflows/.github/workflows/build_charm.yaml@v22.0.0 with: cache: true @@ -71,7 +71,7 @@ jobs: - lint - unit-test - build - uses: canonical/data-platform-workflows/.github/workflows/integration_test_charm.yaml@v21.0.1 + uses: canonical/data-platform-workflows/.github/workflows/integration_test_charm.yaml@v22.0.0 with: artifact-prefix: ${{ needs.build.outputs.artifact-prefix }} architecture: ${{ matrix.architecture }} diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index f29a1c8791..e9641af9cf 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -53,14 +53,14 @@ jobs: build: name: Build charm - uses: canonical/data-platform-workflows/.github/workflows/build_charm.yaml@v21.0.1 + uses: canonical/data-platform-workflows/.github/workflows/build_charm.yaml@v22.0.0 release: name: Release charm needs: - ci-tests - build - uses: canonical/data-platform-workflows/.github/workflows/release_charm.yaml@v21.0.1 + uses: canonical/data-platform-workflows/.github/workflows/release_charm.yaml@v22.0.0 with: channel: 14/edge artifact-prefix: ${{ needs.build.outputs.artifact-prefix }} diff --git a/.github/workflows/sync_docs.yaml b/.github/workflows/sync_docs.yaml index dcf53ee7c2..b0eebc9a98 100644 --- a/.github/workflows/sync_docs.yaml +++ b/.github/workflows/sync_docs.yaml @@ -10,7 +10,7 @@ on: jobs: sync-docs: name: Sync docs from Discourse - uses: canonical/data-platform-workflows/.github/workflows/sync_docs.yaml@v21.0.1 + uses: canonical/data-platform-workflows/.github/workflows/sync_docs.yaml@v22.0.0 with: reviewers: a-velasco,izmalk permissions: diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index d974f1ce59..30d41cfae8 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -49,7 +49,7 @@ microk8s config > ~/.kube/config 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 d5c215aaea..38ca40857f 100644 --- a/charmcraft.yaml +++ b/charmcraft.yaml @@ -1,4 +1,4 @@ -type: "charm" +type: charm bases: - name: ubuntu channel: "22.04" @@ -8,24 +8,23 @@ bases: architectures: [arm64] parts: 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 - override-build: | - rustup default stable - craftctl default - charm-strict-dependencies: true build-snaps: - - rustup/latest/stable + - rustup build-packages: - libffi-dev - libssl-dev - pkg-config - libpq-dev + 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 + charm-requirements: [requirements.txt] libpq: build-packages: - libpq-dev diff --git a/poetry.lock b/poetry.lock index 5016464f62..ee69b067a7 100644 --- a/poetry.lock +++ b/poetry.lock @@ -31,8 +31,8 @@ pytest = "*" [package.source] type = "git" url = "https://github.com/canonical/data-platform-workflows" -reference = "v21.0.1" -resolved_reference = "06f252ea079edfd055cee236ede28c237467f9b0" +reference = "v22.0.0" +resolved_reference = "da2da4b1e4469b5ed8f9187981fe2d747f8ee129" subdirectory = "python/pytest_plugins/allure_pytest_collection_report" [[package]] @@ -1753,8 +1753,8 @@ develop = false [package.source] type = "git" url = "https://github.com/canonical/data-platform-workflows" -reference = "v21.0.1" -resolved_reference = "06f252ea079edfd055cee236ede28c237467f9b0" +reference = "v22.0.0" +resolved_reference = "da2da4b1e4469b5ed8f9187981fe2d747f8ee129" subdirectory = "python/pytest_plugins/github_secrets" [[package]] @@ -1808,8 +1808,8 @@ pyyaml = "*" [package.source] type = "git" url = "https://github.com/canonical/data-platform-workflows" -reference = "v21.0.1" -resolved_reference = "06f252ea079edfd055cee236ede28c237467f9b0" +reference = "v22.0.0" +resolved_reference = "da2da4b1e4469b5ed8f9187981fe2d747f8ee129" subdirectory = "python/pytest_plugins/pytest_operator_cache" [[package]] @@ -1827,8 +1827,8 @@ pytest = "*" [package.source] type = "git" url = "https://github.com/canonical/data-platform-workflows" -reference = "v21.0.1" -resolved_reference = "06f252ea079edfd055cee236ede28c237467f9b0" +reference = "v22.0.0" +resolved_reference = "da2da4b1e4469b5ed8f9187981fe2d747f8ee129" subdirectory = "python/pytest_plugins/pytest_operator_groups" [[package]] @@ -2501,4 +2501,4 @@ type = ["pytest-mypy"] [metadata] lock-version = "2.0" python-versions = "^3.10" -content-hash = "1f3832953d1ce4999b69d986029a27a42d32ccedf0bbf2716fbf962b8f33f11b" +content-hash = "aeefdd9f6c2f3127d14f7d2955a9f5eb12355cf76c5916f314eb5381b609d17e" diff --git a/pyproject.toml b/pyproject.toml index e191764d5f..0096263b5e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -64,11 +64,11 @@ optional = true [tool.poetry.group.integration.dependencies] lightkube = "^0.15.4" pytest = "^8.3.3" -pytest-github-secrets = {git = "https://github.com/canonical/data-platform-workflows", tag = "v21.0.1", subdirectory = "python/pytest_plugins/github_secrets"} +pytest-github-secrets = {git = "https://github.com/canonical/data-platform-workflows", tag = "v22.0.0", subdirectory = "python/pytest_plugins/github_secrets"} pytest-operator = "^0.36.0" -pytest-operator-cache = {git = "https://github.com/canonical/data-platform-workflows", tag = "v21.0.1", subdirectory = "python/pytest_plugins/pytest_operator_cache"} -pytest-operator-groups = {git = "https://github.com/canonical/data-platform-workflows", tag = "v21.0.1", subdirectory = "python/pytest_plugins/pytest_operator_groups"} -allure-pytest-collection-report = {git = "https://github.com/canonical/data-platform-workflows", tag = "v21.0.1", subdirectory = "python/pytest_plugins/allure_pytest_collection_report"} +pytest-operator-cache = {git = "https://github.com/canonical/data-platform-workflows", tag = "v22.0.0", subdirectory = "python/pytest_plugins/pytest_operator_cache"} +pytest-operator-groups = {git = "https://github.com/canonical/data-platform-workflows", tag = "v22.0.0", subdirectory = "python/pytest_plugins/pytest_operator_groups"} +allure-pytest-collection-report = {git = "https://github.com/canonical/data-platform-workflows", tag = "v22.0.0", subdirectory = "python/pytest_plugins/allure_pytest_collection_report"} # renovate caret doesn't work: https://github.com/renovatebot/renovate/issues/26940 juju = "<=3.5.2.0" psycopg2-binary = "^2.9.9" diff --git a/tox.ini b/tox.ini index 5ea93b8562..caa8806442 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 = @@ -81,12 +63,7 @@ pass_env = CI GITHUB_OUTPUT SECRETS_FROM_GITHUB -allowlist_externals = - {[testenv:build-wrapper]allowlist_externals} commands_pre = poetry install --only integration --no-root - {[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}