Skip to content

Commit

Permalink
fix: ensure flask-framework extension gets a default rust version (#1751
Browse files Browse the repository at this point in the history
)

Co-authored-by: Alex Lowe <[email protected]>
  • Loading branch information
jdkandersson and lengau authored Jul 23, 2024
1 parent 5415dcb commit 40beeef
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 2 deletions.
1 change: 1 addition & 0 deletions charmcraft/extensions/gunicorn.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,7 @@ def _get_root_snippet(self) -> dict[str, Any]:
"plugin": "charm",
"source": ".",
"build-snaps": ["rustup"], # Needed to build pydantic.
"override-build": "rustup default stable\ncraftctl default",
}
},
}
Expand Down
17 changes: 15 additions & 2 deletions tests/extensions/test_gunicorn.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,12 @@ def flask_input_yaml_fixture():
"options": {**FlaskFramework.options, **FlaskFramework._WEBSERVER_OPTIONS}
},
"parts": {
"charm": {"plugin": "charm", "source": ".", "build-snaps": ["rustup"]},
"charm": {
"plugin": "charm",
"source": ".",
"build-snaps": ["rustup"],
"override-build": "rustup default stable\ncraftctl default",
}
},
"peers": {"secret-storage": {"interface": "secret-storage"}},
"provides": {
Expand Down Expand Up @@ -120,7 +125,14 @@ def flask_input_yaml_fixture():
"config": {
"options": {**DjangoFramework.options, **DjangoFramework._WEBSERVER_OPTIONS}
},
"parts": {"charm": {"plugin": "charm", "source": ".", "build-snaps": ["rustup"]}},
"parts": {
"charm": {
"plugin": "charm",
"source": ".",
"build-snaps": ["rustup"],
"override-build": "rustup default stable\ncraftctl default",
}
},
"peers": {"secret-storage": {"interface": "secret-storage"}},
"provides": {
"metrics-endpoint": {"interface": "prometheus_scrape"},
Expand Down Expand Up @@ -258,4 +270,5 @@ def test_handle_charm_part(flask_input_yaml, tmp_path):
"plugin": "charm",
"source": ".",
"build-snaps": ["rustup"],
"override-build": "rustup default stable\ncraftctl default",
}
6 changes: 6 additions & 0 deletions tests/spread/commands/init-flask-framework/task.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@ systems:
- ubuntu-22.04-64

execute: |
# Required for fetch-libs to succeed since the libraries are not available on
# the staging environment
unset CHARMCRAFT_STORE_API_URL
unset CHARMCRAFT_UPLOAD_URL
unset CHARMCRAFT_REGISTRY_URL
mkdir -p test-init
cd test-init
charmcraft init --profile flask-framework
Expand Down

0 comments on commit 40beeef

Please sign in to comment.