From effea441e86c25aa875ec524b88ff21d91d25b21 Mon Sep 17 00:00:00 2001 From: Daniela Plascencia Date: Thu, 27 Jul 2023 12:18:32 +0200 Subject: [PATCH] ci, build: update CI, libraries, python dependencies, and format (#140) This commit updates the CI with standard CI configuration (juju, actions, deps) that is shared across multiple repositories. All python dependencies are also updated to their latest working versions. This PR also includes library updates. Finally, some formatting was applied on non-compliant files (copyright, style). This change also contains a fix for #147, an issue caused by a missing toolchain in the charm that allows building certain python packages. For more information, please refer to canonical/bundle-kubeflow#648. Fixes #141 Fixes #147 Part of canonical/bundle-kubeflow#648 * test: Fix assertion fails in unit tests Fix assertion errors raised in unit tests caused by updating ops from 1.5 to 2+. Due to this change, we now have to take an extra step to enable container connectivity when not using `begin_with_initial_hooks`. Closes #141 Signed-off-by: Phoevos Kalemkeris --------- Signed-off-by: Phoevos Kalemkeris Co-authored-by: Phoevos Kalemkeris --- charmcraft.yaml | 5 +- config.yaml | 2 +- .../v1/kubernetes_service_patch.py | 8 +- metadata.yaml | 2 +- pyproject.toml | 2 +- requirements-fmt.txt | 18 +- requirements-integration.in | 13 +- requirements-integration.txt | 206 ++++++++---------- requirements-lint.in | 3 +- requirements-lint.txt | 55 ++--- requirements-unit.in | 21 +- requirements-unit.txt | 157 +++++-------- requirements.in | 6 +- requirements.txt | 47 ++-- src/charm.py | 2 +- .../charmcraft.yaml | 2 +- .../config.yaml | 2 +- .../metadata.yaml | 2 +- tests/integration/test_charm.py | 3 +- tests/unit/test_operator.py | 8 +- tox.ini | 2 +- 21 files changed, 262 insertions(+), 304 deletions(-) diff --git a/charmcraft.yaml b/charmcraft.yaml index f61db67b..5ec90a4e 100644 --- a/charmcraft.yaml +++ b/charmcraft.yaml @@ -1,4 +1,4 @@ -# Copyright 2021 Canonical Ltd. +# Copyright 2023 Canonical Ltd. # See LICENSE file for licensing details. type: charm @@ -13,5 +13,4 @@ parts: charm: prime: - files/*yaml - # do not use these versions due to pypa/setuptools_scm#713 - charm-python-packages: [ setuptools!=62.2.0, pip!=22.1 ] + charm-python-packages: [setuptools, pip] diff --git a/config.yaml b/config.yaml index 355b07af..37e32ff7 100644 --- a/config.yaml +++ b/config.yaml @@ -1,4 +1,4 @@ -# Copyright 2021 Canonical Ltd. +# Copyright 2023 Canonical Ltd. # See LICENSE file for licensing details. options: diff --git a/lib/charms/observability_libs/v1/kubernetes_service_patch.py b/lib/charms/observability_libs/v1/kubernetes_service_patch.py index b4587956..64dd13ce 100644 --- a/lib/charms/observability_libs/v1/kubernetes_service_patch.py +++ b/lib/charms/observability_libs/v1/kubernetes_service_patch.py @@ -146,7 +146,7 @@ def setUp(self, *unused): # Increment this PATCH version before using `charmcraft publish-lib` or reset # to 0 if you are raising the major API version -LIBPATCH = 5 +LIBPATCH = 7 ServiceType = Literal["ClusterIP", "LoadBalancer"] @@ -201,6 +201,7 @@ def __init__( # Ensure this patch is applied during the 'install' and 'upgrade-charm' events self.framework.observe(charm.on.install, self._patch) self.framework.observe(charm.on.upgrade_charm, self._patch) + self.framework.observe(charm.on.update_status, self._patch) # apply user defined events if refresh_event: @@ -309,9 +310,8 @@ def _is_patched(self, client: Client) -> bool: except ApiError as e: if e.status.code == 404 and self.service_name != self._app: return False - else: - logger.error("Kubernetes service get failed: %s", str(e)) - raise + logger.error("Kubernetes service get failed: %s", str(e)) + raise # Construct a list of expected ports, should the patch be applied expected_ports = [(p.port, p.targetPort) for p in self.service.spec.ports] diff --git a/metadata.yaml b/metadata.yaml index 1879533b..ad40322d 100755 --- a/metadata.yaml +++ b/metadata.yaml @@ -1,4 +1,4 @@ -# Copyright 2021 Canonical Ltd. +# Copyright 2023 Canonical Ltd. # See LICENSE file for licensing details. name: kubeflow-dashboard summary: Kubeflow Central Dashboard diff --git a/pyproject.toml b/pyproject.toml index 4dfb1022..de8987a1 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,4 +1,4 @@ -# Copyright 2022 Canonical Ltd. +# Copyright 2023 Canonical Ltd. # See LICENSE file for licensing details. # Testing tools configuration diff --git a/requirements-fmt.txt b/requirements-fmt.txt index 53094cd1..6e09e6ba 100644 --- a/requirements-fmt.txt +++ b/requirements-fmt.txt @@ -2,21 +2,23 @@ # This file is autogenerated by pip-compile with Python 3.8 # by the following command: # -# pip-compile --resolver=backtracking ./requirements-fmt.in +# pip-compile ./requirements-fmt.in # -black==22.10.0 +black==23.7.0 # via -r ./requirements-fmt.in -click==8.1.3 +click==8.1.6 # via black -isort==5.10.1 +isort==5.12.0 # via -r ./requirements-fmt.in -mypy-extensions==0.4.3 +mypy-extensions==1.0.0 # via black -pathspec==0.10.2 +packaging==23.1 # via black -platformdirs==2.5.4 +pathspec==0.11.1 + # via black +platformdirs==3.9.1 # via black tomli==2.0.1 # via black -typing-extensions==4.4.0 +typing-extensions==4.7.1 # via black diff --git a/requirements-integration.in b/requirements-integration.in index b046ca95..2976028f 100644 --- a/requirements-integration.in +++ b/requirements-integration.in @@ -1,5 +1,14 @@ -juju<3.1 +# Pinning to <3.0 to ensure compatibility with the 2.9 controller version +# Note: 3.0 is not being maintained anymore +juju<3.0 +lightkube +ops +pytest +pytest-asyncio pytest-operator +pyyaml selenium selenium-wire --r requirements.txt +# This is needed only for this charm as the integration test files in +# test/integration/ have imports from the charm code in src/charm.py +-r requirements.in diff --git a/requirements-integration.txt b/requirements-integration.txt index 2808b037..2d640cec 100644 --- a/requirements-integration.txt +++ b/requirements-integration.txt @@ -4,36 +4,27 @@ # # pip-compile ./requirements-integration.in # -anyio==3.6.2 - # via - # -r ./requirements.txt - # httpcore -appnope==0.1.3 - # via ipython +anyio==3.7.1 + # via httpcore asttokens==2.2.1 # via stack-data -async-generator==1.10 - # via trio -attrs==22.2.0 +attrs==23.1.0 # via - # -r ./requirements.txt # jsonschema # outcome - # pytest # trio backcall==0.2.0 # via ipython bcrypt==4.0.1 # via paramiko -blinker==1.5 +blinker==1.6.2 # via selenium-wire brotli==1.0.9 # via selenium-wire -cachetools==5.3.0 +cachetools==5.3.1 # via google-auth -certifi==2022.12.7 +certifi==2023.7.22 # via - # -r ./requirements.txt # httpcore # httpx # kubernetes @@ -44,13 +35,11 @@ cffi==1.15.1 # via # cryptography # pynacl -charmed-kubeflow-chisme==0.0.8 - # via -r ./requirements.txt -charset-normalizer==3.1.0 - # via - # -r ./requirements.txt - # requests -cryptography==39.0.2 +charmed-kubeflow-chisme==0.0.11 + # via -r ./requirements.in +charset-normalizer==3.2.0 + # via requests +cryptography==41.0.2 # via # paramiko # pyopenssl @@ -59,68 +48,56 @@ decorator==5.1.1 # ipdb # ipython deepdiff==6.2.1 + # via charmed-kubeflow-chisme +exceptiongroup==1.1.2 # via - # -r ./requirements.txt - # charmed-kubeflow-chisme -exceptiongroup==1.1.1 - # via + # anyio # pytest # trio # trio-websocket executing==1.2.0 # via stack-data -google-auth==2.16.2 +google-auth==2.17.3 # via kubernetes h11==0.14.0 # via - # -r ./requirements.txt # httpcore # wsproto h2==4.1.0 # via selenium-wire hpack==4.0.0 # via h2 -httpcore==0.16.3 - # via - # -r ./requirements.txt - # httpx -httpx==0.23.3 - # via - # -r ./requirements.txt - # lightkube +httpcore==0.17.3 + # via httpx +httpx==0.24.1 + # via lightkube hyperframe==6.0.1 # via # h2 # selenium-wire idna==3.4 # via - # -r ./requirements.txt # anyio + # httpx # requests - # rfc3986 # trio -importlib-resources==5.12.0 - # via - # -r ./requirements.txt - # jsonschema +importlib-resources==6.0.0 + # via jsonschema iniconfig==2.0.0 # via pytest ipdb==0.13.13 # via pytest-operator -ipython==8.11.0 +ipython==8.12.2 # via ipdb jedi==0.18.2 # via ipython jinja2==3.1.2 # via - # -r ./requirements.txt # charmed-kubeflow-chisme # pytest-operator jsonschema==4.17.3 - # via - # -r ./requirements.txt - # serialized-data-interface -juju==3.0.4 + # via serialized-data-interface +juju==2.9.44.0 # via # -r ./requirements-integration.in # pytest-operator @@ -128,42 +105,40 @@ jujubundlelib==0.5.7 # via theblues kaitaistruct==0.10 # via selenium-wire -kubernetes==26.1.0 +kubernetes==27.2.0 # via juju -lightkube==0.12.0 +lightkube==0.14.0 # via - # -r ./requirements.txt + # -r ./requirements-integration.in + # -r ./requirements.in # charmed-kubeflow-chisme -lightkube-models==1.26.0.4 - # via - # -r ./requirements.txt - # lightkube +lightkube-models==1.27.1.4 + # via lightkube macaroonbakery==1.3.1 # via # juju # theblues -markupsafe==2.1.2 - # via - # -r ./requirements.txt - # jinja2 +markupsafe==2.1.3 + # via jinja2 matplotlib-inline==0.1.6 # via ipython mypy-extensions==1.0.0 # via typing-inspect oauthlib==3.2.2 - # via requests-oauthlib -ops==1.5.4 # via - # -r ./requirements.txt + # kubernetes + # requests-oauthlib +ops==2.4.1 + # via + # -r ./requirements-integration.in + # -r ./requirements.in # charmed-kubeflow-chisme # serialized-data-interface ordered-set==4.1.0 - # via - # -r ./requirements.txt - # deepdiff + # via deepdiff outcome==1.2.0 # via trio -packaging==23.0 +packaging==23.1 # via pytest paramiko==2.12.0 # via juju @@ -174,12 +149,10 @@ pexpect==4.8.0 pickleshare==0.7.5 # via ipython pkgutil-resolve-name==1.3.10 - # via - # -r ./requirements.txt - # jsonschema -pluggy==1.0.0 + # via jsonschema +pluggy==1.2.0 # via pytest -prompt-toolkit==3.0.38 +prompt-toolkit==3.0.39 # via ipython protobuf==3.20.3 # via macaroonbakery @@ -187,17 +160,17 @@ ptyprocess==0.7.0 # via pexpect pure-eval==0.2.2 # via stack-data -pyasn1==0.4.8 +pyasn1==0.5.0 # via # juju # pyasn1-modules # rsa # selenium-wire -pyasn1-modules==0.2.8 +pyasn1-modules==0.3.0 # via google-auth pycparser==2.21 # via cffi -pygments==2.14.0 +pygments==2.15.1 # via ipython pymacaroons==0.13.0 # via macaroonbakery @@ -206,37 +179,39 @@ pynacl==1.5.0 # macaroonbakery # paramiko # pymacaroons -pyopenssl==23.0.0 +pyopenssl==23.2.0 # via selenium-wire -pyparsing==3.0.9 +pyparsing==3.1.0 # via selenium-wire pyrfc3339==1.1 # via # juju # macaroonbakery pyrsistent==0.19.3 - # via - # -r ./requirements.txt - # jsonschema + # via jsonschema pysocks==1.7.1 # via # selenium-wire # urllib3 -pytest==7.2.2 +pytest==7.4.0 # via + # -r ./requirements-integration.in # pytest-asyncio # pytest-operator -pytest-asyncio==0.21.0 - # via pytest-operator -pytest-operator==0.26.0 +pytest-asyncio==0.21.1 + # via + # -r ./requirements-integration.in + # pytest-operator +pytest-operator==0.28.0 # via -r ./requirements-integration.in python-dateutil==2.8.2 # via kubernetes -pytz==2022.7.1 +pytz==2023.3 # via pyrfc3339 -pyyaml==6.0 +pyyaml==6.0.1 # via - # -r ./requirements.txt + # -r ./requirements-integration.in + # -r ./requirements.in # juju # jujubundlelib # kubernetes @@ -244,9 +219,8 @@ pyyaml==6.0 # ops # pytest-operator # serialized-data-interface -requests==2.28.2 +requests==2.31.0 # via - # -r ./requirements.txt # kubernetes # macaroonbakery # requests-oauthlib @@ -254,30 +228,23 @@ requests==2.28.2 # theblues requests-oauthlib==1.3.1 # via kubernetes -rfc3986[idna2008]==1.5.0 - # via - # -r ./requirements.txt - # httpx rsa==4.9 # via google-auth -ruamel-yaml==0.17.21 - # via - # -r ./requirements.txt - # charmed-kubeflow-chisme +ruamel-yaml==0.17.32 + # via charmed-kubeflow-chisme ruamel-yaml-clib==0.2.7 - # via - # -r ./requirements.txt - # ruamel-yaml -selenium==4.8.2 + # via ruamel-yaml +selenium==4.10.0 # via # -r ./requirements-integration.in # selenium-wire selenium-wire==5.1.0 # via -r ./requirements-integration.in -serialized-data-interface==0.6.0 - # via -r ./requirements.txt +serialized-data-interface==0.7.0 + # via -r ./requirements.in six==1.16.0 # via + # asttokens # google-auth # kubernetes # macaroonbakery @@ -286,7 +253,6 @@ six==1.16.0 # python-dateutil sniffio==1.3.0 # via - # -r ./requirements.txt # anyio # httpcore # httpx @@ -295,6 +261,8 @@ sortedcontainers==2.4.0 # via trio stack-data==0.6.2 # via ipython +tenacity==8.2.2 + # via charmed-kubeflow-chisme theblues==0.5.2 # via juju tomli==2.0.1 @@ -307,38 +275,36 @@ traitlets==5.9.0 # via # ipython # matplotlib-inline -trio==0.22.0 +trio==0.22.2 # via # selenium # trio-websocket -trio-websocket==0.10.2 +trio-websocket==0.10.3 # via selenium -typing-extensions==4.5.0 - # via typing-inspect -typing-inspect==0.8.0 +typing-extensions==4.7.1 + # via + # ipython + # typing-inspect +typing-inspect==0.9.0 # via juju -urllib3[socks]==1.26.15 +urllib3[socks]==2.0.4 # via - # -r ./requirements.txt # kubernetes # requests # selenium wcwidth==0.2.6 # via prompt-toolkit -websocket-client==1.5.1 - # via kubernetes +websocket-client==1.6.1 + # via + # kubernetes + # ops websockets==7.0 # via juju wsproto==1.2.0 # via # selenium-wire # trio-websocket -zipp==3.15.0 - # via - # -r ./requirements.txt - # importlib-resources -zstandard==0.20.0 +zipp==3.16.2 + # via importlib-resources +zstandard==0.21.0 # via selenium-wire - -# The following packages are considered to be unsafe in a requirements file: -# setuptools diff --git a/requirements-lint.in b/requirements-lint.in index 87f005ea..07a4a51c 100644 --- a/requirements-lint.in +++ b/requirements-lint.in @@ -1,7 +1,8 @@ +black codespell flake8 flake8-builtins flake8-copyright +isort pep8-naming pyproject-flake8 --r requirements-fmt.txt diff --git a/requirements-lint.txt b/requirements-lint.txt index cda28ffe..d1814e06 100644 --- a/requirements-lint.txt +++ b/requirements-lint.txt @@ -2,59 +2,50 @@ # This file is autogenerated by pip-compile with Python 3.8 # by the following command: # -# pip-compile --resolver=backtracking requirements-lint.in +# pip-compile ./requirements-lint.in # -black==22.10.0 - # via -r requirements-fmt.txt -click==8.1.3 - # via - # -r requirements-fmt.txt - # black +black==23.7.0 + # via -r ./requirements-lint.in +click==8.1.6 + # via black codespell==2.2.5 - # via -r requirements-lint.in + # via -r ./requirements-lint.in flake8==6.0.0 # via - # -r requirements-lint.in + # -r ./requirements-lint.in # flake8-builtins # pep8-naming # pyproject-flake8 flake8-builtins==2.1.0 - # via -r requirements-lint.in + # via -r ./requirements-lint.in flake8-copyright==0.2.4 - # via -r requirements-lint.in -isort==5.10.1 - # via -r requirements-fmt.txt + # via -r ./requirements-lint.in +isort==5.12.0 + # via -r ./requirements-lint.in mccabe==0.7.0 # via flake8 -mypy-extensions==0.4.3 - # via - # -r requirements-fmt.txt - # black -pathspec==0.10.2 - # via - # -r requirements-fmt.txt - # black +mypy-extensions==1.0.0 + # via black +packaging==23.1 + # via black +pathspec==0.11.1 + # via black pep8-naming==0.13.3 - # via -r requirements-lint.in -platformdirs==2.5.4 - # via - # -r requirements-fmt.txt - # black + # via -r ./requirements-lint.in +platformdirs==3.9.1 + # via black pycodestyle==2.10.0 # via flake8 pyflakes==3.0.1 # via flake8 pyproject-flake8==6.0.0.post1 - # via -r requirements-lint.in + # via -r ./requirements-lint.in tomli==2.0.1 # via - # -r requirements-fmt.txt # black # pyproject-flake8 -typing-extensions==4.4.0 - # via - # -r requirements-fmt.txt - # black +typing-extensions==4.7.1 + # via black # The following packages are considered to be unsafe in a requirements file: # setuptools diff --git a/requirements-unit.in b/requirements-unit.in index fbce543f..5002ef0b 100644 --- a/requirements-unit.in +++ b/requirements-unit.in @@ -1,5 +1,24 @@ +# Copyright 2023 Canonical Ltd. +# See LICENSE file for licensing details. +# Please note this file introduces dependencies from the charm's requirements.in, +# special attention must be taken when updating this or the other .in file to try +# to avoid incompatibilities. +# Rules for editing this file: +# * Removing a dependency that is no longer used in the unit test file(s) +# is allowed, and should not represent any risk. +# * Adding a dependency in this file means the dependency is directly used +# in the unit test files(s). +# * ALL python packages/libs used directly in the unit test file(s) must be +# listed here even if requirements.in is already adding them. This will +# add clarity to the dependency list. +# * Pinning a version of a python package/lib shared with requirements.in +# must not introduce any incompatibilities. +charmed-kubeflow-chisme coverage +lightkube +ops pytest pytest-mock pytest-lazy-fixture --r requirements.txt +pyyaml +-r requirements.in diff --git a/requirements-unit.txt b/requirements-unit.txt index 397b2006..fc061b44 100644 --- a/requirements-unit.txt +++ b/requirements-unit.txt @@ -4,146 +4,109 @@ # # pip-compile ./requirements-unit.in # -anyio==3.6.2 +anyio==3.7.1 + # via httpcore +attrs==23.1.0 + # via jsonschema +certifi==2023.7.22 # via - # -r ./requirements.txt - # httpcore -attrs==22.2.0 - # via - # -r ./requirements.txt - # jsonschema - # pytest -certifi==2022.12.7 - # via - # -r ./requirements.txt # httpcore # httpx # requests -charmed-kubeflow-chisme==0.0.8 - # via -r ./requirements.txt -charset-normalizer==3.1.0 +charmed-kubeflow-chisme==0.0.11 # via - # -r ./requirements.txt - # requests -coverage==7.2.2 + # -r ./requirements-unit.in + # -r ./requirements.in +charset-normalizer==3.2.0 + # via requests +coverage==7.2.7 # via -r ./requirements-unit.in deepdiff==6.2.1 + # via charmed-kubeflow-chisme +exceptiongroup==1.1.2 # via - # -r ./requirements.txt - # charmed-kubeflow-chisme -exceptiongroup==1.1.1 - # via pytest + # anyio + # pytest h11==0.14.0 - # via - # -r ./requirements.txt - # httpcore -httpcore==0.16.3 - # via - # -r ./requirements.txt - # httpx -httpx==0.23.3 - # via - # -r ./requirements.txt - # lightkube + # via httpcore +httpcore==0.17.3 + # via httpx +httpx==0.24.1 + # via lightkube idna==3.4 # via - # -r ./requirements.txt # anyio + # httpx # requests - # rfc3986 -importlib-resources==5.12.0 - # via - # -r ./requirements.txt - # jsonschema +importlib-resources==6.0.0 + # via jsonschema iniconfig==2.0.0 # via pytest jinja2==3.1.2 - # via - # -r ./requirements.txt - # charmed-kubeflow-chisme + # via charmed-kubeflow-chisme jsonschema==4.17.3 + # via serialized-data-interface +lightkube==0.14.0 # via - # -r ./requirements.txt - # serialized-data-interface -lightkube==0.12.0 - # via - # -r ./requirements.txt + # -r ./requirements-unit.in + # -r ./requirements.in # charmed-kubeflow-chisme -lightkube-models==1.26.0.4 - # via - # -r ./requirements.txt - # lightkube -markupsafe==2.1.2 - # via - # -r ./requirements.txt - # jinja2 -ops==1.5.4 +lightkube-models==1.27.1.4 + # via lightkube +markupsafe==2.1.3 + # via jinja2 +ops==2.4.1 # via - # -r ./requirements.txt + # -r ./requirements-unit.in + # -r ./requirements.in # charmed-kubeflow-chisme # serialized-data-interface ordered-set==4.1.0 - # via - # -r ./requirements.txt - # deepdiff -packaging==23.0 + # via deepdiff +packaging==23.1 # via pytest pkgutil-resolve-name==1.3.10 - # via - # -r ./requirements.txt - # jsonschema -pluggy==1.0.0 + # via jsonschema +pluggy==1.2.0 # via pytest pyrsistent==0.19.3 - # via - # -r ./requirements.txt - # jsonschema -pytest==7.2.2 + # via jsonschema +pytest==7.4.0 # via # -r ./requirements-unit.in # pytest-lazy-fixture # pytest-mock pytest-lazy-fixture==0.6.3 # via -r ./requirements-unit.in -pytest-mock==3.10.0 +pytest-mock==3.11.1 # via -r ./requirements-unit.in -pyyaml==6.0 +pyyaml==6.0.1 # via - # -r ./requirements.txt + # -r ./requirements-unit.in + # -r ./requirements.in # lightkube # ops # serialized-data-interface -requests==2.28.2 - # via - # -r ./requirements.txt - # serialized-data-interface -rfc3986[idna2008]==1.5.0 - # via - # -r ./requirements.txt - # httpx -ruamel-yaml==0.17.21 - # via - # -r ./requirements.txt - # charmed-kubeflow-chisme +requests==2.31.0 + # via serialized-data-interface +ruamel-yaml==0.17.32 + # via charmed-kubeflow-chisme ruamel-yaml-clib==0.2.7 - # via - # -r ./requirements.txt - # ruamel-yaml -serialized-data-interface==0.6.0 - # via -r ./requirements.txt + # via ruamel-yaml +serialized-data-interface==0.7.0 + # via -r ./requirements.in sniffio==1.3.0 # via - # -r ./requirements.txt # anyio # httpcore # httpx +tenacity==8.2.2 + # via charmed-kubeflow-chisme tomli==2.0.1 # via pytest -urllib3==1.26.15 - # via - # -r ./requirements.txt - # requests -zipp==3.15.0 - # via - # -r ./requirements.txt - # importlib-resources +urllib3==2.0.4 + # via requests +websocket-client==1.6.1 + # via ops +zipp==3.16.2 + # via importlib-resources diff --git a/requirements.in b/requirements.in index 4f5bfae8..3eb23e7f 100644 --- a/requirements.in +++ b/requirements.in @@ -1,7 +1,7 @@ -# Copyright 2021 Canonical Ltd. +# Copyright 2023 Canonical Ltd. # See LICENSE file for licensing details. - charmed-kubeflow-chisme lightkube -ops<2 +ops +pyyaml serialized-data-interface diff --git a/requirements.txt b/requirements.txt index 42c2872d..dce06282 100644 --- a/requirements.txt +++ b/requirements.txt @@ -4,47 +4,49 @@ # # pip-compile ./requirements.in # -anyio==3.6.2 +anyio==3.7.1 # via httpcore -attrs==22.2.0 +attrs==23.1.0 # via jsonschema -certifi==2022.12.7 +certifi==2023.7.22 # via # httpcore # httpx # requests -charmed-kubeflow-chisme==0.0.8 +charmed-kubeflow-chisme==0.0.11 # via -r ./requirements.in -charset-normalizer==3.1.0 +charset-normalizer==3.2.0 # via requests deepdiff==6.2.1 # via charmed-kubeflow-chisme +exceptiongroup==1.1.2 + # via anyio h11==0.14.0 # via httpcore -httpcore==0.16.3 +httpcore==0.17.3 # via httpx -httpx==0.23.3 +httpx==0.24.1 # via lightkube idna==3.4 # via # anyio + # httpx # requests - # rfc3986 -importlib-resources==5.12.0 +importlib-resources==6.0.0 # via jsonschema jinja2==3.1.2 # via charmed-kubeflow-chisme jsonschema==4.17.3 # via serialized-data-interface -lightkube==0.12.0 +lightkube==0.14.0 # via # -r ./requirements.in # charmed-kubeflow-chisme -lightkube-models==1.26.0.4 +lightkube-models==1.27.1.4 # via lightkube -markupsafe==2.1.2 +markupsafe==2.1.3 # via jinja2 -ops==1.5.4 +ops==2.4.1 # via # -r ./requirements.in # charmed-kubeflow-chisme @@ -55,27 +57,30 @@ pkgutil-resolve-name==1.3.10 # via jsonschema pyrsistent==0.19.3 # via jsonschema -pyyaml==6.0 +pyyaml==6.0.1 # via + # -r ./requirements.in # lightkube # ops # serialized-data-interface -requests==2.28.2 +requests==2.31.0 # via serialized-data-interface -rfc3986[idna2008]==1.5.0 - # via httpx -ruamel-yaml==0.17.21 +ruamel-yaml==0.17.32 # via charmed-kubeflow-chisme ruamel-yaml-clib==0.2.7 # via ruamel-yaml -serialized-data-interface==0.6.0 +serialized-data-interface==0.7.0 # via -r ./requirements.in sniffio==1.3.0 # via # anyio # httpcore # httpx -urllib3==1.26.15 +tenacity==8.2.2 + # via charmed-kubeflow-chisme +urllib3==2.0.4 # via requests -zipp==3.15.0 +websocket-client==1.6.1 + # via ops +zipp==3.16.2 # via importlib-resources diff --git a/src/charm.py b/src/charm.py index 133e3db8..c5f1e93b 100755 --- a/src/charm.py +++ b/src/charm.py @@ -1,5 +1,5 @@ #!/usr/bin/env python3 -# Copyright 2021 Canonical Ltd. +# Copyright 2023 Canonical Ltd. # See LICENSE file for licensing details. import json diff --git a/tests/integration/dashboard_links_requirer_tester_charm/charmcraft.yaml b/tests/integration/dashboard_links_requirer_tester_charm/charmcraft.yaml index 26a3ed7c..fa7ba810 100644 --- a/tests/integration/dashboard_links_requirer_tester_charm/charmcraft.yaml +++ b/tests/integration/dashboard_links_requirer_tester_charm/charmcraft.yaml @@ -1,4 +1,4 @@ -# Copyright 2021 Canonical Ltd. +# Copyright 2023 Canonical Ltd. # See LICENSE file for licensing details. type: charm diff --git a/tests/integration/dashboard_links_requirer_tester_charm/config.yaml b/tests/integration/dashboard_links_requirer_tester_charm/config.yaml index 6ade07ab..48e233dc 100644 --- a/tests/integration/dashboard_links_requirer_tester_charm/config.yaml +++ b/tests/integration/dashboard_links_requirer_tester_charm/config.yaml @@ -1,4 +1,4 @@ -# Copyright 2021 Canonical Ltd. +# Copyright 2023 Canonical Ltd. # See LICENSE file for licensing details. options: menu_link_texts: diff --git a/tests/integration/dashboard_links_requirer_tester_charm/metadata.yaml b/tests/integration/dashboard_links_requirer_tester_charm/metadata.yaml index 25aabbbf..dcdf95c3 100755 --- a/tests/integration/dashboard_links_requirer_tester_charm/metadata.yaml +++ b/tests/integration/dashboard_links_requirer_tester_charm/metadata.yaml @@ -1,4 +1,4 @@ -# Copyright 2021 Canonical Ltd. +# Copyright 2023 Canonical Ltd. # See LICENSE file for licensing details. name: kubeflow-dashboard-requirer-mock description: none diff --git a/tests/integration/test_charm.py b/tests/integration/test_charm.py index f5e79630..c9607b2b 100644 --- a/tests/integration/test_charm.py +++ b/tests/integration/test_charm.py @@ -1,4 +1,4 @@ -# Copyright 2021 Canonical Ltd. +# Copyright 2023 Canonical Ltd. # See LICENSE file for licensing details. import json @@ -258,7 +258,6 @@ async def test_configmap_contents_with_ordering(ops_test: OpsTest, lightkube_cli # Move the user-driven links '*2' from the previous test to the top of the list # Test with both menu and documentation to confirm it works for different locations. for location in ["menu", "documentation"]: - link_order = [f"{location}-config2"] await ops_test.model.applications[CHARM_NAME].set_config( diff --git a/tests/unit/test_operator.py b/tests/unit/test_operator.py index 8d1c5480..a052c1a8 100644 --- a/tests/unit/test_operator.py +++ b/tests/unit/test_operator.py @@ -1,4 +1,4 @@ -# Copyright 2021 Canonical Ltd. +# Copyright 2023 Canonical Ltd. # See LICENSE file for licensing details. import json from dataclasses import asdict @@ -193,6 +193,8 @@ def test_create_resources_success( harness_with_profiles: Harness, ): harness_with_profiles.begin() + container = harness_with_profiles.charm.model.unit.get_container(CHARM_NAME) + harness_with_profiles.set_can_connect(container, True) harness_with_profiles.charm.on.install.emit() k8s_resource_handler.apply.assert_called_once() configmap_handler.apply.assert_called_once() @@ -211,8 +213,10 @@ def test_main( ): expected_links = [] harness_with_profiles.begin() + container = harness_with_profiles.charm.model.unit.get_container(CHARM_NAME) + harness_with_profiles.set_can_connect(container, True) harness_with_profiles.charm.on.install.emit() - k8s_resource_handler.apply.assert_called() + k8s_resource_handler.apply.assert_called_once() configmap_handler.apply.assert_called_once() update_layer.assert_called() assert isinstance(harness_with_profiles.charm.model.unit.status, ActiveStatus) diff --git a/tox.ini b/tox.ini index b802c78a..106801c2 100644 --- a/tox.ini +++ b/tox.ini @@ -1,4 +1,4 @@ -# Copyright 2022 Canonical Ltd. +# Copyright 2023 Canonical Ltd. # See LICENSE file for licensing details. [flake8]