From 3029a2043f1c4a8cfd9742f4095b744f9b27f667 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 25 Sep 2024 01:35:18 +0000 Subject: [PATCH 1/4] Update data-platform-workflows to v22 --- .github/workflows/ci.yaml | 6 +++--- .github/workflows/release.yaml | 4 ++-- .github/workflows/sync_docs.yaml | 2 +- poetry.lock | 23 ++++++++++++----------- pyproject.toml | 10 +++++----- 5 files changed, 23 insertions(+), 22 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index f3797952b..d7a438856 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -16,7 +16,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 @@ -56,7 +56,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 @@ -88,7 +88,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 658086613..fca175b04 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -36,7 +36,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 release: name: Release charm @@ -44,7 +44,7 @@ jobs: - lib-check - 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: 8.0/edge artifact-prefix: ${{ needs.build.outputs.artifact-prefix }} diff --git a/.github/workflows/sync_docs.yaml b/.github/workflows/sync_docs.yaml index a75fbee87..dc37da16c 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 permissions: diff --git a/poetry.lock b/poetry.lock index 5b545d0fd..7172cbbf4 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]] @@ -1629,8 +1629,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]] @@ -1649,8 +1649,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/microceph" [[package]] @@ -1704,8 +1704,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]] @@ -1723,8 +1723,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]] @@ -1777,6 +1777,7 @@ files = [ {file = "PyYAML-6.0.1-cp311-cp311-win_amd64.whl", hash = "sha256:bf07ee2fef7014951eeb99f56f39c9bb4af143d8aa3c21b1677805985307da34"}, {file = "PyYAML-6.0.1-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:855fb52b0dc35af121542a76b9a84f8d1cd886ea97c84703eaa6d88e37a2ad28"}, {file = "PyYAML-6.0.1-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:40df9b996c2b73138957fe23a16a4f0ba614f4c0efce1e9406a184b6d07fa3a9"}, + {file = "PyYAML-6.0.1-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:a08c6f0fe150303c1c6b71ebcd7213c2858041a7e01975da3a99aed1e7a378ef"}, {file = "PyYAML-6.0.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:6c22bec3fbe2524cde73d7ada88f6566758a8f7227bfbf93a408a9d86bcc12a0"}, {file = "PyYAML-6.0.1-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:8d4e9c88387b0f5c7d5f281e55304de64cf7f9c0021a3525bd3b1c542da3b0e4"}, {file = "PyYAML-6.0.1-cp312-cp312-win32.whl", hash = "sha256:d483d2cdf104e7c9fa60c544d92981f12ad66a457afae824d146093b8c294c54"}, @@ -2383,4 +2384,4 @@ test = ["big-O", "importlib-resources", "jaraco.functools", "jaraco.itertools", [metadata] lock-version = "2.0" python-versions = "^3.10" -content-hash = "4e15707ef6a14da7f861bde89a613729dde0a11cd177e6279b795ed3c468c716" +content-hash = "03c3d9e6a8f2bac08397006f2a2622bb03b3412e12ed88c98e1cebb4d6562580" diff --git a/pyproject.toml b/pyproject.toml index cd2c435f6..94fcf859c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -50,11 +50,11 @@ parameterized = "^0.9.0" [tool.poetry.group.integration.dependencies] pytest = "^7.4.0" -pytest-github-secrets = {git = "https://github.com/canonical/data-platform-workflows", tag = "v21.0.1", subdirectory = "python/pytest_plugins/github_secrets"} -pytest-microceph = {git = "https://github.com/canonical/data-platform-workflows", tag = "v21.0.1", subdirectory = "python/pytest_plugins/microceph"} +pytest-github-secrets = {git = "https://github.com/canonical/data-platform-workflows", tag = "v22.0.0", subdirectory = "python/pytest_plugins/github_secrets"} +pytest-microceph = {git = "https://github.com/canonical/data-platform-workflows", tag = "v22.0.0", subdirectory = "python/pytest_plugins/microceph"} pytest-operator = "^0.28.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"} +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"} juju = "^3.5.2.0" ops = "^2.15.0" mysql-connector-python = "~8.0.33" @@ -65,7 +65,7 @@ urllib3 = "^1.26.16" lightkube = "^0.14.0" kubernetes = "^27.2.0" allure-pytest = "^2.13.2" -allure-pytest-collection-report = {git = "https://github.com/canonical/data-platform-workflows", tag = "v21.0.1", subdirectory = "python/pytest_plugins/allure_pytest_collection_report"} +allure-pytest-collection-report = {git = "https://github.com/canonical/data-platform-workflows", tag = "v22.0.0", subdirectory = "python/pytest_plugins/allure_pytest_collection_report"} pytest-asyncio = "^0.21.1" [tool.coverage.run] From 48406a975d0a2d0c23669eec81a1852f90377c71 Mon Sep 17 00:00:00 2001 From: Carl Csaposs Date: Wed, 25 Sep 2024 11:11:14 +0200 Subject: [PATCH 2/4] Remove build wrapper --- CONTRIBUTING.md | 2 +- charmcraft.yaml | 21 +++++++++++---------- tox.ini | 23 ----------------------- 3 files changed, 12 insertions(+), 34 deletions(-) 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} From 3229f3d29a01e4f5a58db2bd5eac06099a3b4e66 Mon Sep 17 00:00:00 2001 From: Carl Csaposs Date: Wed, 25 Sep 2024 11:23:50 +0200 Subject: [PATCH 3/4] fix stage --- charmcraft.yaml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/charmcraft.yaml b/charmcraft.yaml index 76151167e..a75582840 100644 --- a/charmcraft.yaml +++ b/charmcraft.yaml @@ -13,6 +13,10 @@ parts: files: plugin: dump source: . + stage: + # Exclude requirements.txt file during staging + # Workaround for https://github.com/canonical/charmcraft/issues/1389 on charmcraft 2 + - -requirements.txt prime: - scripts charm: From 1f38d2108c9670f8966b66989405eba886cf2443 Mon Sep 17 00:00:00 2001 From: Carl Csaposs Date: Wed, 25 Sep 2024 11:58:18 +0200 Subject: [PATCH 4/4] fix pack --- charmcraft.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/charmcraft.yaml b/charmcraft.yaml index a75582840..ca65f23ce 100644 --- a/charmcraft.yaml +++ b/charmcraft.yaml @@ -35,3 +35,4 @@ parts: craftctl default charm-strict-dependencies: true + charm-requirements: [requirements.txt]