Skip to content

Commit

Permalink
Fix CI (#129)
Browse files Browse the repository at this point in the history
* update linter

* add rustc and cargo

* add pydantic-core
  • Loading branch information
michaeldmitry authored Sep 13, 2024
1 parent 636d965 commit 280bc1e
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 13 deletions.
2 changes: 1 addition & 1 deletion charm/charmcraft.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@ bases:
channel: "20.04"
parts:
charm:
charm-binary-python-packages: [cryptography, jsonschema]
charm-binary-python-packages: [cryptography, jsonschema, pydantic-core]
build-packages:
- git
13 changes: 4 additions & 9 deletions charm/src/charm.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,23 +14,18 @@
from typing import Optional, cast
from urllib.parse import urlparse

from charms.catalogue_k8s.v1.catalogue import (
CatalogueItemsChangedEvent,
CatalogueProvider,
)
from charms.catalogue_k8s.v1.catalogue import CatalogueItemsChangedEvent, CatalogueProvider
from charms.observability_libs.v1.cert_handler import CertHandler
from charms.tempo_k8s.v1.charm_tracing import trace_charm
from charms.tempo_k8s.v2.tracing import TracingEndpointRequirer
from charms.traefik_k8s.v2.ingress import (
IngressPerAppReadyEvent,
IngressPerAppRequirer,
)
from nginx_config import CA_CERT_PATH, CERT_PATH, KEY_PATH, NGINX_CONFIG_PATH, NginxConfigBuilder
from charms.traefik_k8s.v2.ingress import IngressPerAppReadyEvent, IngressPerAppRequirer
from ops.charm import ActionEvent, CharmBase
from ops.main import main
from ops.model import ActiveStatus, BlockedStatus, WaitingStatus
from ops.pebble import ChangeError, Error, Layer, PathError, ProtocolError

from nginx_config import CA_CERT_PATH, CERT_PATH, KEY_PATH, NGINX_CONFIG_PATH, NginxConfigBuilder

logger = logging.getLogger(__name__)

ROOT_PATH = "/web"
Expand Down
3 changes: 2 additions & 1 deletion charm/tests/unit/test_charm.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,13 @@
from unittest.mock import Mock, patch
from urllib.parse import urlparse

from charm import CatalogueCharm
from charms.catalogue_k8s.v1.catalogue import DEFAULT_RELATION_NAME
from ops.charm import ActionEvent
from ops.model import ActiveStatus
from ops.testing import Harness

from charm import CatalogueCharm

CONTAINER_NAME = "catalogue"


Expand Down
6 changes: 4 additions & 2 deletions charm/tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,11 @@ description = Apply coding style standards to code
deps =
black
ruff
isort
commands =
ruff --fix {[vars]all_path}
isort {[vars]all_path}
black {[vars]all_path}
ruff check {[vars]all_path} --fix

[testenv:lint]
description = Check code against coding style standards
Expand All @@ -46,7 +48,7 @@ commands =
codespell {[vars]lib_path}
codespell . --skip .git --skip .tox --skip build --skip lib --skip venv --skip .mypy_cache --skip nginx_config.py --skip tox.ini
codespell src/nginx_config.py -L anull
ruff {[vars]all_path}
ruff check {[vars]all_path}
black --check --diff {[vars]all_path}

[testenv:static-{charm,lib}]
Expand Down

0 comments on commit 280bc1e

Please sign in to comment.