Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: make charmcraft work with snap parallel installs #1950

Merged
merged 3 commits into from
Oct 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,8 @@ dependencies = [
"pyyaml",
"requests",
"requests-toolbelt",
"requests-unixsocket",
"snap-helpers",
"tabulate",
# Needed until requests-unixsocket supports urllib3 v2
# https://github.com/msabramo/requests-unixsocket/pull/69
# When updating, remove the urllib3 constraint from renovate config.
"urllib3<2.0",
]
classifiers = [
"Development Status :: 5 - Production/Stable",
Expand Down
10 changes: 5 additions & 5 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ certifi==2024.8.30
cffi==1.17.1
charset-normalizer==3.3.2
coverage==7.6.1
craft-application==4.2.5
craft-application==4.2.6
craft-archives==2.0.0
craft-cli==2.7.0
craft-grammar==2.0.1
craft-parts==2.1.1
craft-parts==2.1.2
craft-platforms==0.3.1
craft-providers==2.0.4
craft-store==3.0.2
Expand Down Expand Up @@ -71,9 +71,9 @@ pytz==2024.1
pyxdg==0.28
pyyaml==6.0.2
referencing==0.35.1
requests==2.31.0
requests==2.32.3
requests-toolbelt==1.0.0
requests-unixsocket==0.3.0
requests-unixsocket2==0.4.2
responses==0.25.3
rpds-py==0.20.0
ruamel-yaml==0.18.6
Expand All @@ -87,6 +87,6 @@ sortedcontainers==2.4.0
tabulate==0.9.0
tomlkit==0.13.2
typing-extensions==4.12.2
urllib3==1.26.19
urllib3==2.2.3
wadllib==1.3.9
zipp==3.20.2
10 changes: 5 additions & 5 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ boolean-py==4.0
certifi==2024.8.30
cffi==1.17.1
charset-normalizer==3.3.2
craft-application==4.2.5
craft-application==4.2.6
craft-archives==2.0.0
craft-cli==2.7.0
craft-grammar==2.0.1
craft-parts==2.1.1
craft-parts==2.1.2
craft-platforms==0.3.1
craft-providers==2.0.4
craft-store==3.0.2
Expand Down Expand Up @@ -51,9 +51,9 @@ pytz==2024.1
pyxdg==0.28
pyyaml==6.0.2
referencing==0.35.1
requests==2.31.0
requests==2.32.3
requests-toolbelt==1.0.0
requests-unixsocket==0.3.0
requests-unixsocket2==0.4.2
rpds-py==0.20.0
ruamel-yaml==0.18.6
ruamel-yaml-clib==0.2.8
Expand All @@ -63,6 +63,6 @@ six==1.16.0
snap-helpers==0.4.2
tabulate==0.9.0
typing-extensions==4.12.2
urllib3==1.26.19
urllib3==2.2.3
wadllib==1.3.9
zipp==3.20.2
14 changes: 14 additions & 0 deletions tests/spread/smoketests/parallel-install/charmcraft.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
type: charm
name: test-charm
summary: test-charm
description: test-charm

base: [email protected]
platforms:
amd64:
arm64:
riscv64:

parts:
my-part:
plugin: nil
31 changes: 31 additions & 0 deletions tests/spread/smoketests/parallel-install/task.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
summary: pack a charm with parallel-installed charmcraft versions

# Run last since we change snapd settings
priority: -10

prepare: |
snap install yq
if [[ $(snap get system experimental.parallel-instances) != true ]]; then
snap set system experimental.parallel-instances=true
REBOOT
fi
snap install --classic --channel=latest/candidate charmcraft
snap install --dangerous --classic --name=charmcraft_dev /charmcraft/charmcraft_*.snap

restore: |
if [[ $(snap get system experimental.parallel-instances) == true ]]; then
snap remove charmcraft_dev
snap set system experimental.parallel-instances=false
REBOOT
fi
snap install --classic --dangerous /charmcraft/charmcraft_*.snap

execute: |
# Check that the candidate version used the correct version
charmcraft pack
[[ $(unzip -p *.charm manifest.yaml | yq .charmcraft-version) == $(charmcraft --version | cut -f2 -d' ') ]]
rm *.charm

# Try the dev version
charmcraft_dev pack
[[ $(unzip -p *.charm manifest.yaml | yq .charmcraft-version) == $(charmcraft_dev --version | cut -f2 -d' ') ]]
Loading