diff --git a/.github/workflows/integration_test.yaml b/.github/workflows/integration_test.yaml index 8e4034b..60c34dd 100644 --- a/.github/workflows/integration_test.yaml +++ b/.github/workflows/integration_test.yaml @@ -8,9 +8,6 @@ jobs: uses: canonical/operator-workflows/.github/workflows/integration_test.yaml@main secrets: inherit with: - chaos-app-label: app.kubernetes.io/name=indico - chaos-enabled: false - chaos-experiments: pod-delete load-test-enabled: false load-test-run-args: "-e LOAD_TEST_HOST=localhost" zap-before-command: "curl -H \"Host: indico.local\" http://localhost/bootstrap --data-raw 'csrf_token=00000000-0000-0000-0000-000000000000&first_name=admin&last_name=admin&email=admin%40admin.com&username=admin&password=lunarlobster&confirm_password=lunarlobster&affiliation=Canonical'" diff --git a/pyproject.toml b/pyproject.toml index 0ed8d68..0fce3f3 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -34,10 +34,16 @@ line_length = 99 profile = "black" [tool.mypy] -ignore_missing_imports = true +check_untyped_defs = true +disallow_untyped_defs = true explicit_package_bases = true +ignore_missing_imports = true namespace_packages = true +[[tool.mypy.overrides]] +disallow_untyped_defs = false +module = "tests.*" + [tool.pylint] disable = "wrong-import-order" diff --git a/src/charm.py b/src/charm.py index 46227b1..e9b21ed 100755 --- a/src/charm.py +++ b/src/charm.py @@ -14,8 +14,10 @@ """ import logging +import typing import ops +from ops import pebble # Log messages can be retrieved using juju debug-log logger = logging.getLogger(__name__) @@ -26,7 +28,7 @@ class IsCharmsTemplateCharm(ops.CharmBase): """Charm the service.""" - def __init__(self, *args): + def __init__(self, *args: typing.Any): """Construct. Args: @@ -36,7 +38,7 @@ def __init__(self, *args): self.framework.observe(self.on.httpbin_pebble_ready, self._on_httpbin_pebble_ready) self.framework.observe(self.on.config_changed, self._on_config_changed) - def _on_httpbin_pebble_ready(self, event: ops.PebbleReadyEvent): + def _on_httpbin_pebble_ready(self, event: ops.PebbleReadyEvent) -> None: """Define and start a workload using the Pebble API. Change this example to suit your needs. You'll need to specify the right entrypoint and @@ -57,7 +59,7 @@ def _on_httpbin_pebble_ready(self, event: ops.PebbleReadyEvent): # https://juju.is/docs/sdk/constructs#heading--statuses self.unit.status = ops.ActiveStatus() - def _on_config_changed(self, event: ops.ConfigChangedEvent): + def _on_config_changed(self, event: ops.ConfigChangedEvent) -> None: """Handle changed configuration. Change this example to suit your needs. If you don't need to handle config, you can remove @@ -92,7 +94,7 @@ def _on_config_changed(self, event: ops.ConfigChangedEvent): self.unit.status = ops.BlockedStatus("invalid log level: '{log_level}'") @property - def _pebble_layer(self): + def _pebble_layer(self) -> pebble.LayerDict: """Return a dictionary representing a Pebble layer.""" return { "summary": "httpbin layer",