From 221b049b287f2343f31864b7abaf012494c8d477 Mon Sep 17 00:00:00 2001 From: Daniela Plascencia Date: Mon, 31 Jul 2023 15:03:45 +0200 Subject: [PATCH 1/5] chore: update copyright year (#274) --- charms/kfp-api/pyproject.toml | 2 +- charms/kfp-api/tests/integration/test_charm.py | 2 +- charms/kfp-api/tests/unit/__init__.py | 2 +- charms/kfp-api/tox.ini | 2 +- charms/kfp-persistence/pyproject.toml | 2 +- charms/kfp-persistence/src/charm.py | 2 +- charms/kfp-persistence/tests/unit/test_operator.py | 2 +- charms/kfp-profile-controller/pyproject.toml | 2 +- charms/kfp-profile-controller/src/charm.py | 2 +- charms/kfp-profile-controller/tests/integration/profile.yaml | 2 +- charms/kfp-profile-controller/tests/integration/test_charm.py | 2 +- charms/kfp-profile-controller/tests/unit/test_operator.py | 2 +- charms/kfp-schedwf/pyproject.toml | 2 +- charms/kfp-schedwf/src/charm.py | 2 +- charms/kfp-schedwf/tests/unit/test_operator.py | 2 +- charms/kfp-ui/pyproject.toml | 2 +- charms/kfp-ui/src/charm.py | 2 +- charms/kfp-ui/tests/unit/test_operator.py | 2 +- charms/kfp-viewer/pyproject.toml | 2 +- charms/kfp-viewer/src/charm.py | 2 +- charms/kfp-viewer/tests/unit/test_operator.py | 2 +- charms/kfp-viz/pyproject.toml | 2 +- charms/kfp-viz/src/charm.py | 2 +- charms/kfp-viz/tests/unit/test_operator.py | 2 +- pyproject.toml | 2 +- tests/integration/helpers/localize_bundle.py | 2 +- 26 files changed, 26 insertions(+), 26 deletions(-) diff --git a/charms/kfp-api/pyproject.toml b/charms/kfp-api/pyproject.toml index 4dfb1022..de8987a1 100644 --- a/charms/kfp-api/pyproject.toml +++ b/charms/kfp-api/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/charms/kfp-api/tests/integration/test_charm.py b/charms/kfp-api/tests/integration/test_charm.py index 7869e4e7..65f9dbaf 100644 --- a/charms/kfp-api/tests/integration/test_charm.py +++ b/charms/kfp-api/tests/integration/test_charm.py @@ -1,4 +1,4 @@ -# Copyright 2022 Canonical Ltd. +# Copyright 2023 Canonical Ltd. # See LICENSE file for licensing details. import json diff --git a/charms/kfp-api/tests/unit/__init__.py b/charms/kfp-api/tests/unit/__init__.py index 18a37c02..c0960b24 100644 --- a/charms/kfp-api/tests/unit/__init__.py +++ b/charms/kfp-api/tests/unit/__init__.py @@ -1,4 +1,4 @@ -# Copyright 2022 Canonical Ltd. +# Copyright 2023 Canonical Ltd. # See LICENSE file for licensing details. # # Initialize unit tests diff --git a/charms/kfp-api/tox.ini b/charms/kfp-api/tox.ini index 8f4e94f9..faa8f09c 100644 --- a/charms/kfp-api/tox.ini +++ b/charms/kfp-api/tox.ini @@ -1,4 +1,4 @@ -# Copyright 2022 Canonical Ltd. +# Copyright 2023 Canonical Ltd. # See LICENSE file for licensing details. [flake8] diff --git a/charms/kfp-persistence/pyproject.toml b/charms/kfp-persistence/pyproject.toml index 4dfb1022..de8987a1 100644 --- a/charms/kfp-persistence/pyproject.toml +++ b/charms/kfp-persistence/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/charms/kfp-persistence/src/charm.py b/charms/kfp-persistence/src/charm.py index 48d4401c..b5c0e6cf 100755 --- a/charms/kfp-persistence/src/charm.py +++ b/charms/kfp-persistence/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. """Charm for the data persistence application of Kubeflow Pipelines. diff --git a/charms/kfp-persistence/tests/unit/test_operator.py b/charms/kfp-persistence/tests/unit/test_operator.py index 17b49d99..f3b4fed6 100644 --- a/charms/kfp-persistence/tests/unit/test_operator.py +++ b/charms/kfp-persistence/tests/unit/test_operator.py @@ -1,4 +1,4 @@ -# Copyright 2021 Canonical Ltd. +# Copyright 2023 Canonical Ltd. # See LICENSE file for licensing details. from contextlib import nullcontext as does_not_raise diff --git a/charms/kfp-profile-controller/pyproject.toml b/charms/kfp-profile-controller/pyproject.toml index 4dfb1022..de8987a1 100644 --- a/charms/kfp-profile-controller/pyproject.toml +++ b/charms/kfp-profile-controller/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/charms/kfp-profile-controller/src/charm.py b/charms/kfp-profile-controller/src/charm.py index fd461360..dda921e3 100755 --- a/charms/kfp-profile-controller/src/charm.py +++ b/charms/kfp-profile-controller/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. """Charm for the Kubeflow Pipelines Profile Controller. diff --git a/charms/kfp-profile-controller/tests/integration/profile.yaml b/charms/kfp-profile-controller/tests/integration/profile.yaml index dd89fa46..9f4514a3 100644 --- a/charms/kfp-profile-controller/tests/integration/profile.yaml +++ b/charms/kfp-profile-controller/tests/integration/profile.yaml @@ -1,4 +1,4 @@ -# Copyright 2022 Canonical Ltd. +# Copyright 2023 Canonical Ltd. # See LICENSE file for licensing details. apiVersion: kubeflow.org/v1 diff --git a/charms/kfp-profile-controller/tests/integration/test_charm.py b/charms/kfp-profile-controller/tests/integration/test_charm.py index f52a3c36..475cd7ff 100644 --- a/charms/kfp-profile-controller/tests/integration/test_charm.py +++ b/charms/kfp-profile-controller/tests/integration/test_charm.py @@ -1,4 +1,4 @@ -# Copyright 2021 Canonical Ltd. +# Copyright 2023 Canonical Ltd. # See LICENSE file for licensing details. import logging diff --git a/charms/kfp-profile-controller/tests/unit/test_operator.py b/charms/kfp-profile-controller/tests/unit/test_operator.py index 50a386dd..06bc4480 100644 --- a/charms/kfp-profile-controller/tests/unit/test_operator.py +++ b/charms/kfp-profile-controller/tests/unit/test_operator.py @@ -1,4 +1,4 @@ -# Copyright 2021 Canonical Ltd. +# Copyright 2023 Canonical Ltd. # See LICENSE file for licensing details. from base64 import b64decode diff --git a/charms/kfp-schedwf/pyproject.toml b/charms/kfp-schedwf/pyproject.toml index 4dfb1022..de8987a1 100644 --- a/charms/kfp-schedwf/pyproject.toml +++ b/charms/kfp-schedwf/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/charms/kfp-schedwf/src/charm.py b/charms/kfp-schedwf/src/charm.py index 4d1ad40a..d100b24c 100755 --- a/charms/kfp-schedwf/src/charm.py +++ b/charms/kfp-schedwf/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. """Charm for the Kubeflow Pipelines Scheduled Workflow Controller. diff --git a/charms/kfp-schedwf/tests/unit/test_operator.py b/charms/kfp-schedwf/tests/unit/test_operator.py index b8fc57c4..52438fc3 100644 --- a/charms/kfp-schedwf/tests/unit/test_operator.py +++ b/charms/kfp-schedwf/tests/unit/test_operator.py @@ -1,4 +1,4 @@ -# Copyright 2021 Canonical Ltd. +# Copyright 2023 Canonical Ltd. # See LICENSE file for licensing details. from contextlib import nullcontext as does_not_raise diff --git a/charms/kfp-ui/pyproject.toml b/charms/kfp-ui/pyproject.toml index 4dfb1022..de8987a1 100644 --- a/charms/kfp-ui/pyproject.toml +++ b/charms/kfp-ui/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/charms/kfp-ui/src/charm.py b/charms/kfp-ui/src/charm.py index 97362bc4..2855f801 100755 --- a/charms/kfp-ui/src/charm.py +++ b/charms/kfp-ui/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. """Charm for the Kubeflow Pipelines UI. diff --git a/charms/kfp-ui/tests/unit/test_operator.py b/charms/kfp-ui/tests/unit/test_operator.py index 07796dc4..8944c527 100644 --- a/charms/kfp-ui/tests/unit/test_operator.py +++ b/charms/kfp-ui/tests/unit/test_operator.py @@ -1,4 +1,4 @@ -# Copyright 2021 Canonical Ltd. +# Copyright 2023 Canonical Ltd. # See LICENSE file for licensing details. from base64 import b64decode diff --git a/charms/kfp-viewer/pyproject.toml b/charms/kfp-viewer/pyproject.toml index 4dfb1022..de8987a1 100644 --- a/charms/kfp-viewer/pyproject.toml +++ b/charms/kfp-viewer/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/charms/kfp-viewer/src/charm.py b/charms/kfp-viewer/src/charm.py index 34d6f918..824392d2 100755 --- a/charms/kfp-viewer/src/charm.py +++ b/charms/kfp-viewer/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. """Charm for the Kubeflow Pipelines Viewer. diff --git a/charms/kfp-viewer/tests/unit/test_operator.py b/charms/kfp-viewer/tests/unit/test_operator.py index 0e8d55f9..07304a26 100644 --- a/charms/kfp-viewer/tests/unit/test_operator.py +++ b/charms/kfp-viewer/tests/unit/test_operator.py @@ -1,4 +1,4 @@ -# Copyright 2021 Canonical Ltd. +# Copyright 2023 Canonical Ltd. # See LICENSE file for licensing details. from contextlib import nullcontext as does_not_raise diff --git a/charms/kfp-viz/pyproject.toml b/charms/kfp-viz/pyproject.toml index 4dfb1022..de8987a1 100644 --- a/charms/kfp-viz/pyproject.toml +++ b/charms/kfp-viz/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/charms/kfp-viz/src/charm.py b/charms/kfp-viz/src/charm.py index ca6214de..0018ac18 100755 --- a/charms/kfp-viz/src/charm.py +++ b/charms/kfp-viz/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. """Charm for the Kubeflow Pipelines Visualization Server. diff --git a/charms/kfp-viz/tests/unit/test_operator.py b/charms/kfp-viz/tests/unit/test_operator.py index 3e3beb13..23eeb8bd 100644 --- a/charms/kfp-viz/tests/unit/test_operator.py +++ b/charms/kfp-viz/tests/unit/test_operator.py @@ -1,4 +1,4 @@ -# Copyright 2021 Canonical Ltd. +# Copyright 2023 Canonical Ltd. # See LICENSE file for licensing details. from contextlib import nullcontext as does_not_raise diff --git a/pyproject.toml b/pyproject.toml index 962deeaa..d64168f9 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,4 +1,4 @@ -# Copyright 2021 Canonical Ltd. +# Copyright 2023 Canonical Ltd. # See LICENSE file for licensing details. # Testing tools configuration diff --git a/tests/integration/helpers/localize_bundle.py b/tests/integration/helpers/localize_bundle.py index 4773a6b0..2a74bc5f 100644 --- a/tests/integration/helpers/localize_bundle.py +++ b/tests/integration/helpers/localize_bundle.py @@ -1,4 +1,4 @@ -# Copyright 2022 Canonical Ltd. +# Copyright 2023 Canonical Ltd. # See LICENSE file for licensing details. import copy from pathlib import Path From b986f55e454e45ad1e7e1d8a838a0c2645d50f9d Mon Sep 17 00:00:00 2001 From: Daniela Plascencia Date: Mon, 31 Jul 2023 15:04:11 +0200 Subject: [PATCH 2/5] build: bump charm and repo level dependencies (#276) * build: bump kfp-api dependencies * build: bump kfp-persistence dependencies * build: bump kfp-profile-controller dependencies * build: bump kfp-schedwf dependencies * build: bump kfp-ui dependencies * build: bump kfp-viewer dependencies * build: bump kfp-viz dependencies * build: bump repo level requirements-integration* --- charms/kfp-api/requirements-fmt.txt | 12 +- charms/kfp-api/requirements-integration.in | 1 - charms/kfp-api/requirements-integration.txt | 160 +++--------------- charms/kfp-api/requirements-lint.in | 3 +- charms/kfp-api/requirements-lint.txt | 53 +++--- charms/kfp-api/requirements-unit.in | 19 ++- charms/kfp-api/requirements-unit.txt | 133 +++++---------- charms/kfp-api/requirements.in | 9 +- charms/kfp-api/requirements.txt | 28 ++- charms/kfp-persistence/requirements-fmt.txt | 12 +- .../requirements-integration.in | 1 - .../requirements-integration.txt | 83 +++------ charms/kfp-persistence/requirements-lint.in | 3 +- charms/kfp-persistence/requirements-lint.txt | 53 +++--- charms/kfp-persistence/requirements-unit.in | 20 ++- charms/kfp-persistence/requirements-unit.txt | 79 ++++----- charms/kfp-persistence/requirements.in | 7 +- charms/kfp-persistence/requirements.txt | 18 +- .../requirements-fmt.txt | 12 +- .../requirements-integration.in | 1 - .../requirements-integration.txt | 89 +++------- .../requirements-lint.in | 3 +- .../requirements-lint.txt | 53 +++--- .../requirements-unit.in | 20 ++- .../requirements-unit.txt | 79 ++++----- charms/kfp-profile-controller/requirements.in | 5 +- .../kfp-profile-controller/requirements.txt | 18 +- charms/kfp-schedwf/requirements-fmt.txt | 12 +- .../kfp-schedwf/requirements-integration.in | 1 - .../kfp-schedwf/requirements-integration.txt | 54 +++--- charms/kfp-schedwf/requirements-lint.in | 3 +- charms/kfp-schedwf/requirements-lint.txt | 53 +++--- charms/kfp-schedwf/requirements-unit.in | 20 ++- charms/kfp-schedwf/requirements-unit.txt | 38 +++-- charms/kfp-schedwf/requirements.txt | 8 +- charms/kfp-ui/requirements-fmt.txt | 12 +- charms/kfp-ui/requirements-integration.in | 1 - charms/kfp-ui/requirements-integration.txt | 88 +++------- charms/kfp-ui/requirements-lint.in | 3 +- charms/kfp-ui/requirements-lint.txt | 53 +++--- charms/kfp-ui/requirements-unit.in | 20 ++- charms/kfp-ui/requirements-unit.txt | 83 ++++----- charms/kfp-ui/requirements.in | 5 +- charms/kfp-ui/requirements.txt | 18 +- charms/kfp-viewer/requirements-fmt.txt | 12 +- charms/kfp-viewer/requirements-integration.in | 1 - .../kfp-viewer/requirements-integration.txt | 54 +++--- charms/kfp-viewer/requirements-lint.in | 3 +- charms/kfp-viewer/requirements-lint.txt | 53 +++--- charms/kfp-viewer/requirements-unit.in | 20 ++- charms/kfp-viewer/requirements-unit.txt | 38 +++-- charms/kfp-viewer/requirements.txt | 8 +- charms/kfp-viz/requirements-fmt.txt | 12 +- charms/kfp-viz/requirements-integration.in | 1 - charms/kfp-viz/requirements-integration.txt | 88 +++------- charms/kfp-viz/requirements-lint.in | 3 +- charms/kfp-viz/requirements-lint.txt | 53 +++--- charms/kfp-viz/requirements-unit.in | 20 ++- charms/kfp-viz/requirements-unit.txt | 83 ++++----- charms/kfp-viz/requirements.in | 3 - charms/kfp-viz/requirements.txt | 18 +- requirements-integration.in | 6 +- requirements-integration.txt | 36 ++-- 63 files changed, 779 insertions(+), 1179 deletions(-) diff --git a/charms/kfp-api/requirements-fmt.txt b/charms/kfp-api/requirements-fmt.txt index 2faae2da..090e6eb0 100644 --- a/charms/kfp-api/requirements-fmt.txt +++ b/charms/kfp-api/requirements-fmt.txt @@ -2,11 +2,11 @@ # 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==23.3.0 +black==23.7.0 # via -r ./requirements-fmt.in -click==8.1.3 +click==8.1.6 # via black isort==5.12.0 # via -r ./requirements-fmt.in @@ -14,11 +14,11 @@ mypy-extensions==1.0.0 # via black packaging==23.1 # via black -pathspec==0.11.1 +pathspec==0.11.2 # via black -platformdirs==3.7.0 +platformdirs==3.10.0 # via black tomli==2.0.1 # via black -typing-extensions==4.6.3 +typing-extensions==4.7.1 # via black diff --git a/charms/kfp-api/requirements-integration.in b/charms/kfp-api/requirements-integration.in index 5cea1296..e6f021b9 100644 --- a/charms/kfp-api/requirements-integration.in +++ b/charms/kfp-api/requirements-integration.in @@ -5,4 +5,3 @@ pytest-operator selenium selenium-wire tenacity --r requirements.txt diff --git a/charms/kfp-api/requirements-integration.txt b/charms/kfp-api/requirements-integration.txt index 963e6bd0..1c89298a 100644 --- a/charms/kfp-api/requirements-integration.txt +++ b/charms/kfp-api/requirements-integration.txt @@ -2,20 +2,12 @@ # This file is autogenerated by pip-compile with Python 3.8 # by the following command: # -# pip-compile --resolver=backtracking ./requirements-integration.in +# pip-compile ./requirements-integration.in # -anyio==3.7.0 - # via - # -r ./requirements.txt - # httpcore asttokens==2.2.1 # via stack-data -async-generator==1.10 - # via trio attrs==23.1.0 # via - # -r ./requirements.txt - # jsonschema # outcome # trio backcall==0.2.0 @@ -28,11 +20,8 @@ brotli==1.0.9 # via selenium-wire cachetools==5.3.1 # via google-auth -certifi==2023.5.7 +certifi==2023.7.22 # via - # -r ./requirements.txt - # httpcore - # httpx # kubernetes # requests # selenium @@ -41,13 +30,9 @@ cffi==1.15.1 # via # cryptography # pynacl -charmed-kubeflow-chisme==0.0.11 - # via -r ./requirements.txt -charset-normalizer==3.1.0 - # via - # -r ./requirements.txt - # requests -cryptography==41.0.1 +charset-normalizer==3.2.0 + # via requests +cryptography==41.0.2 # via # paramiko # pyopenssl @@ -55,14 +40,8 @@ decorator==5.1.1 # via # ipdb # ipython -deepdiff==6.2.1 - # via - # -r ./requirements.txt - # charmed-kubeflow-chisme -exceptiongroup==1.1.1 +exceptiongroup==1.1.2 # via - # -r ./requirements.txt - # anyio # pytest # trio # trio-websocket @@ -71,55 +50,30 @@ executing==1.2.0 google-auth==2.17.3 # via kubernetes h11==0.14.0 - # via - # -r ./requirements.txt - # httpcore - # wsproto + # via wsproto h2==4.1.0 # via selenium-wire hpack==4.0.0 # via h2 -httpcore==0.17.2 - # via - # -r ./requirements.txt - # httpx -httpx==0.24.1 - # via - # -r ./requirements.txt - # lightkube hyperframe==6.0.1 # via # h2 # selenium-wire idna==3.4 # via - # -r ./requirements.txt - # anyio - # httpx # requests # trio -importlib-resources==5.12.0 - # via - # -r ./requirements.txt - # jsonschema iniconfig==2.0.0 # via pytest ipdb==0.13.13 # via pytest-operator ipython==8.12.2 # via ipdb -jedi==0.18.2 +jedi==0.19.0 # 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==2.9.42.4 + # via pytest-operator +juju==2.9.44.0 # via # -r ./requirements-integration.in # pytest-operator @@ -127,41 +81,22 @@ jujubundlelib==0.5.7 # via theblues kaitaistruct==0.10 # via selenium-wire -kubernetes==26.1.0 +kubernetes==27.2.0 # via juju -lightkube==0.13.0 - # via - # -r ./requirements.txt - # charmed-kubeflow-chisme -lightkube-models==1.27.1.4 - # via - # -r ./requirements.txt - # lightkube macaroonbakery==1.3.1 # via # juju # theblues markupsafe==2.1.3 - # via - # -r ./requirements.txt - # jinja2 + # via jinja2 matplotlib-inline==0.1.6 # via ipython mypy-extensions==1.0.0 # via typing-inspect oauthlib==3.2.2 - # via requests-oauthlib -oci-image==1.0.0 - # via -r ./requirements.txt -ops==2.3.0 - # via - # -r ./requirements.txt - # charmed-kubeflow-chisme - # serialized-data-interface -ordered-set==4.1.0 # via - # -r ./requirements.txt - # deepdiff + # kubernetes + # requests-oauthlib outcome==1.2.0 # via trio packaging==23.1 @@ -174,13 +109,9 @@ pexpect==4.8.0 # via ipython pickleshare==0.7.5 # via ipython -pkgutil-resolve-name==1.3.10 - # via - # -r ./requirements.txt - # 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 @@ -209,25 +140,21 @@ pynacl==1.5.0 # pymacaroons pyopenssl==23.2.0 # via selenium-wire -pyparsing==3.1.0 +pyparsing==3.1.1 # via selenium-wire pyrfc3339==1.1 # via # juju # macaroonbakery -pyrsistent==0.19.3 - # via - # -r ./requirements.txt - # jsonschema pysocks==1.7.1 # via # selenium-wire # urllib3 -pytest==7.3.2 +pytest==7.4.0 # via # pytest-asyncio # pytest-operator -pytest-asyncio==0.21.0 +pytest-asyncio==0.21.1 # via pytest-operator pytest-operator==0.28.0 # via -r ./requirements-integration.in @@ -235,44 +162,28 @@ python-dateutil==2.8.2 # via kubernetes pytz==2023.3 # via pyrfc3339 -pyyaml==6.0 +pyyaml==6.0.1 # via - # -r ./requirements.txt # juju # jujubundlelib # kubernetes - # lightkube - # ops # pytest-operator - # serialized-data-interface requests==2.31.0 # via - # -r ./requirements.txt # kubernetes # macaroonbakery # requests-oauthlib - # serialized-data-interface # theblues requests-oauthlib==1.3.1 # via kubernetes rsa==4.9 # via google-auth -ruamel-yaml==0.17.32 - # via - # -r ./requirements.txt - # charmed-kubeflow-chisme -ruamel-yaml-clib==0.2.7 - # via - # -r ./requirements.txt - # 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 six==1.16.0 # via # asttokens @@ -283,21 +194,13 @@ six==1.16.0 # pymacaroons # python-dateutil sniffio==1.3.0 - # via - # -r ./requirements.txt - # anyio - # httpcore - # httpx - # trio + # via trio sortedcontainers==2.4.0 # via trio stack-data==0.6.2 # via ipython tenacity==8.2.2 - # via - # -r ./requirements-integration.in - # -r ./requirements.txt - # charmed-kubeflow-chisme + # via -r ./requirements-integration.in theblues==0.5.2 # via juju tomli==2.0.1 @@ -310,43 +213,32 @@ traitlets==5.9.0 # via # ipython # matplotlib-inline -trio==0.22.0 +trio==0.22.2 # via # selenium # trio-websocket trio-websocket==0.10.3 # via selenium -typing-extensions==4.6.3 +typing-extensions==4.7.1 # via # ipython # typing-inspect typing-inspect==0.9.0 # via juju -urllib3[socks]==2.0.3 +urllib3[socks]==2.0.4 # via - # -r ./requirements.txt # kubernetes # requests # selenium wcwidth==0.2.6 # via prompt-toolkit -websocket-client==1.6.0 - # via - # -r ./requirements.txt - # kubernetes - # ops +websocket-client==1.6.1 + # via kubernetes 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.21.0 # via selenium-wire - -# The following packages are considered to be unsafe in a requirements file: -# setuptools diff --git a/charms/kfp-api/requirements-lint.in b/charms/kfp-api/requirements-lint.in index 87f005ea..07a4a51c 100644 --- a/charms/kfp-api/requirements-lint.in +++ b/charms/kfp-api/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/charms/kfp-api/requirements-lint.txt b/charms/kfp-api/requirements-lint.txt index 453d41c4..890bea02 100644 --- a/charms/kfp-api/requirements-lint.txt +++ b/charms/kfp-api/requirements-lint.txt @@ -2,63 +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==23.3.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 + # via -r ./requirements-lint.in isort==5.12.0 - # via -r requirements-fmt.txt + # via -r ./requirements-lint.in mccabe==0.7.0 # via flake8 mypy-extensions==1.0.0 - # via - # -r requirements-fmt.txt - # black + # via black packaging==23.1 - # via - # -r requirements-fmt.txt - # black -pathspec==0.11.1 - # via - # -r requirements-fmt.txt - # black + # via black +pathspec==0.11.2 + # via black pep8-naming==0.13.3 - # via -r requirements-lint.in -platformdirs==3.7.0 - # via - # -r requirements-fmt.txt - # black + # via -r ./requirements-lint.in +platformdirs==3.10.0 + # 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.6.3 - # 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/charms/kfp-api/requirements-unit.in b/charms/kfp-api/requirements-unit.in index fbce543f..421af666 100644 --- a/charms/kfp-api/requirements-unit.in +++ b/charms/kfp-api/requirements-unit.in @@ -1,5 +1,22 @@ +# 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. coverage +ops pytest pytest-mock pytest-lazy-fixture --r requirements.txt +pyyaml +-r requirements.in diff --git a/charms/kfp-api/requirements-unit.txt b/charms/kfp-api/requirements-unit.txt index 7e43defe..b1e43af9 100644 --- a/charms/kfp-api/requirements-unit.txt +++ b/charms/kfp-api/requirements-unit.txt @@ -2,107 +2,75 @@ # This file is autogenerated by pip-compile with Python 3.8 # by the following command: # -# pip-compile --resolver=backtracking ./requirements-unit.in +# pip-compile ./requirements-unit.in # -anyio==3.7.0 - # via - # -r ./requirements.txt - # httpcore +anyio==3.7.1 + # via httpcore attrs==23.1.0 + # via jsonschema +certifi==2023.7.22 # via - # -r ./requirements.txt - # jsonschema -certifi==2023.5.7 - # via - # -r ./requirements.txt # httpcore # httpx # requests charmed-kubeflow-chisme==0.0.11 - # via -r ./requirements.txt -charset-normalizer==3.1.0 - # via - # -r ./requirements.txt - # requests + # via -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 - # -r ./requirements.txt # anyio # pytest h11==0.14.0 - # via - # -r ./requirements.txt - # httpcore -httpcore==0.17.2 - # via - # -r ./requirements.txt - # httpx + # via httpcore +httpcore==0.17.3 + # via httpx httpx==0.24.1 - # via - # -r ./requirements.txt - # lightkube + # via lightkube idna==3.4 # via - # -r ./requirements.txt # anyio # httpx # requests -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.13.0 - # via - # -r ./requirements.txt + # -r ./requirements.in # charmed-kubeflow-chisme lightkube-models==1.27.1.4 - # via - # -r ./requirements.txt - # lightkube + # via lightkube markupsafe==2.1.3 - # via - # -r ./requirements.txt - # jinja2 + # via jinja2 oci-image==1.0.0 - # via -r ./requirements.txt -ops==2.3.0 + # via -r ./requirements.in +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 + # via deepdiff packaging==23.1 # via pytest pkgutil-resolve-name==1.3.10 - # via - # -r ./requirements.txt - # jsonschema + # via jsonschema pluggy==1.2.0 # via pytest pyrsistent==0.19.3 - # via - # -r ./requirements.txt - # jsonschema -pytest==7.3.2 + # via jsonschema +pytest==7.4.0 # via # -r ./requirements-unit.in # pytest-lazy-fixture @@ -111,47 +79,34 @@ pytest-lazy-fixture==0.6.3 # via -r ./requirements-unit.in 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 # lightkube # ops # serialized-data-interface requests==2.31.0 - # via - # -r ./requirements.txt - # serialized-data-interface + # via serialized-data-interface ruamel-yaml==0.17.32 - # via - # -r ./requirements.txt - # charmed-kubeflow-chisme + # 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 - # -r ./requirements.txt + # -r ./requirements.in # charmed-kubeflow-chisme tomli==2.0.1 # via pytest -urllib3==2.0.3 - # via - # -r ./requirements.txt - # requests -websocket-client==1.6.0 - # via - # -r ./requirements.txt - # ops -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/charms/kfp-api/requirements.in b/charms/kfp-api/requirements.in index 7a2bf1e0..b1e6a356 100644 --- a/charms/kfp-api/requirements.in +++ b/charms/kfp-api/requirements.in @@ -1,11 +1,6 @@ -charmed-kubeflow-chisme>=0.0.8 -# Workaround for https://github.com/python-jsonschema/jsonschema/issues/1117 -# and https://github.com/python-jsonschema/jsonschema/issues/1114 -jsonschema<4.18 +charmed-kubeflow-chisme lightkube -lightkube-models>=1.25.4.4 -ops>=2.2.0 +ops oci-image serialized-data-interface -# Unittest fails if not pinned tenacity diff --git a/charms/kfp-api/requirements.txt b/charms/kfp-api/requirements.txt index 7a7d220a..4c92ed02 100644 --- a/charms/kfp-api/requirements.txt +++ b/charms/kfp-api/requirements.txt @@ -2,19 +2,19 @@ # This file is autogenerated by pip-compile with Python 3.8 # by the following command: # -# pip-compile --resolver=backtracking requirements.in +# pip-compile ./requirements.in # anyio==3.7.1 # via httpcore attrs==23.1.0 # via jsonschema -certifi==2023.5.7 +certifi==2023.7.22 # via # httpcore # httpx # requests charmed-kubeflow-chisme==0.0.11 - # via -r requirements.in + # via -r ./requirements.in charset-normalizer==3.2.0 # via requests deepdiff==6.2.1 @@ -37,24 +37,20 @@ importlib-resources==6.0.0 jinja2==3.1.2 # via charmed-kubeflow-chisme jsonschema==4.17.3 - # via - # -r requirements.in - # serialized-data-interface + # via serialized-data-interface lightkube==0.14.0 # via - # -r requirements.in + # -r ./requirements.in # charmed-kubeflow-chisme lightkube-models==1.27.1.4 - # via - # -r requirements.in - # lightkube + # via lightkube markupsafe==2.1.3 # via jinja2 oci-image==1.0.0 - # via -r requirements.in + # via -r ./requirements.in ops==2.4.1 # via - # -r requirements.in + # -r ./requirements.in # charmed-kubeflow-chisme # serialized-data-interface ordered-set==4.1.0 @@ -74,8 +70,8 @@ ruamel-yaml==0.17.32 # via charmed-kubeflow-chisme ruamel-yaml-clib==0.2.7 # via ruamel-yaml -serialized-data-interface==0.6.0 - # via -r requirements.in +serialized-data-interface==0.7.0 + # via -r ./requirements.in sniffio==1.3.0 # via # anyio @@ -83,9 +79,9 @@ sniffio==1.3.0 # httpx tenacity==8.2.2 # via - # -r requirements.in + # -r ./requirements.in # charmed-kubeflow-chisme -urllib3==2.0.3 +urllib3==2.0.4 # via requests websocket-client==1.6.1 # via ops diff --git a/charms/kfp-persistence/requirements-fmt.txt b/charms/kfp-persistence/requirements-fmt.txt index 2faae2da..090e6eb0 100644 --- a/charms/kfp-persistence/requirements-fmt.txt +++ b/charms/kfp-persistence/requirements-fmt.txt @@ -2,11 +2,11 @@ # 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==23.3.0 +black==23.7.0 # via -r ./requirements-fmt.in -click==8.1.3 +click==8.1.6 # via black isort==5.12.0 # via -r ./requirements-fmt.in @@ -14,11 +14,11 @@ mypy-extensions==1.0.0 # via black packaging==23.1 # via black -pathspec==0.11.1 +pathspec==0.11.2 # via black -platformdirs==3.7.0 +platformdirs==3.10.0 # via black tomli==2.0.1 # via black -typing-extensions==4.6.3 +typing-extensions==4.7.1 # via black diff --git a/charms/kfp-persistence/requirements-integration.in b/charms/kfp-persistence/requirements-integration.in index 5cea1296..e6f021b9 100644 --- a/charms/kfp-persistence/requirements-integration.in +++ b/charms/kfp-persistence/requirements-integration.in @@ -5,4 +5,3 @@ pytest-operator selenium selenium-wire tenacity --r requirements.txt diff --git a/charms/kfp-persistence/requirements-integration.txt b/charms/kfp-persistence/requirements-integration.txt index b081b453..1c89298a 100644 --- a/charms/kfp-persistence/requirements-integration.txt +++ b/charms/kfp-persistence/requirements-integration.txt @@ -2,16 +2,12 @@ # This file is autogenerated by pip-compile with Python 3.8 # by the following command: # -# pip-compile --resolver=backtracking ./requirements-integration.in +# pip-compile ./requirements-integration.in # asttokens==2.2.1 # via stack-data -async-generator==1.10 - # via trio attrs==23.1.0 # via - # -r ./requirements.txt - # jsonschema # outcome # trio backcall==0.2.0 @@ -24,9 +20,8 @@ brotli==1.0.9 # via selenium-wire cachetools==5.3.1 # via google-auth -certifi==2023.5.7 +certifi==2023.7.22 # via - # -r ./requirements.txt # kubernetes # requests # selenium @@ -35,11 +30,9 @@ cffi==1.15.1 # via # cryptography # pynacl -charset-normalizer==3.1.0 - # via - # -r ./requirements.txt - # requests -cryptography==41.0.1 +charset-normalizer==3.2.0 + # via requests +cryptography==41.0.2 # via # paramiko # pyopenssl @@ -47,7 +40,7 @@ decorator==5.1.1 # via # ipdb # ipython -exceptiongroup==1.1.1 +exceptiongroup==1.1.2 # via # pytest # trio @@ -68,28 +61,19 @@ hyperframe==6.0.1 # selenium-wire idna==3.4 # via - # -r ./requirements.txt # requests # trio -importlib-resources==5.12.0 - # via - # -r ./requirements.txt - # jsonschema iniconfig==2.0.0 # via pytest ipdb==0.13.13 # via pytest-operator ipython==8.12.2 # via ipdb -jedi==0.18.2 +jedi==0.19.0 # via ipython jinja2==3.1.2 # via pytest-operator -jsonschema==4.17.3 - # via - # -r ./requirements.txt - # serialized-data-interface -juju==2.9.42.4 +juju==2.9.44.0 # via # -r ./requirements-integration.in # pytest-operator @@ -97,7 +81,7 @@ jujubundlelib==0.5.7 # via theblues kaitaistruct==0.10 # via selenium-wire -kubernetes==26.1.0 +kubernetes==27.2.0 # via juju macaroonbakery==1.3.1 # via @@ -110,13 +94,9 @@ matplotlib-inline==0.1.6 mypy-extensions==1.0.0 # via typing-inspect oauthlib==3.2.2 - # via requests-oauthlib -oci-image==1.0.0 - # via -r ./requirements.txt -ops==1.2.0 # via - # -r ./requirements.txt - # serialized-data-interface + # kubernetes + # requests-oauthlib outcome==1.2.0 # via trio packaging==23.1 @@ -129,13 +109,9 @@ pexpect==4.8.0 # via ipython pickleshare==0.7.5 # via ipython -pkgutil-resolve-name==1.3.10 - # via - # -r ./requirements.txt - # 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 @@ -164,25 +140,21 @@ pynacl==1.5.0 # pymacaroons pyopenssl==23.2.0 # via selenium-wire -pyparsing==3.1.0 +pyparsing==3.1.1 # via selenium-wire pyrfc3339==1.1 # via # juju # macaroonbakery -pyrsistent==0.19.3 - # via - # -r ./requirements.txt - # jsonschema pysocks==1.7.1 # via # selenium-wire # urllib3 -pytest==7.3.2 +pytest==7.4.0 # via # pytest-asyncio # pytest-operator -pytest-asyncio==0.21.0 +pytest-asyncio==0.21.1 # via pytest-operator pytest-operator==0.28.0 # via -r ./requirements-integration.in @@ -190,22 +162,17 @@ python-dateutil==2.8.2 # via kubernetes pytz==2023.3 # via pyrfc3339 -pyyaml==6.0 +pyyaml==6.0.1 # via - # -r ./requirements.txt # juju # jujubundlelib # kubernetes - # ops # pytest-operator - # serialized-data-interface requests==2.31.0 # via - # -r ./requirements.txt # kubernetes # macaroonbakery # requests-oauthlib - # serialized-data-interface # theblues requests-oauthlib==1.3.1 # via kubernetes @@ -217,8 +184,6 @@ selenium==4.10.0 # selenium-wire selenium-wire==5.1.0 # via -r ./requirements-integration.in -serialized-data-interface==0.6.0 - # via -r ./requirements.txt six==1.16.0 # via # asttokens @@ -248,27 +213,26 @@ traitlets==5.9.0 # via # ipython # matplotlib-inline -trio==0.22.0 +trio==0.22.2 # via # selenium # trio-websocket trio-websocket==0.10.3 # via selenium -typing-extensions==4.6.3 +typing-extensions==4.7.1 # via # ipython # typing-inspect typing-inspect==0.9.0 # via juju -urllib3[socks]==2.0.3 +urllib3[socks]==2.0.4 # via - # -r ./requirements.txt # kubernetes # requests # selenium wcwidth==0.2.6 # via prompt-toolkit -websocket-client==1.6.0 +websocket-client==1.6.1 # via kubernetes websockets==7.0 # via juju @@ -276,12 +240,5 @@ wsproto==1.2.0 # via # selenium-wire # trio-websocket -zipp==3.15.0 - # via - # -r ./requirements.txt - # 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/charms/kfp-persistence/requirements-lint.in b/charms/kfp-persistence/requirements-lint.in index 87f005ea..07a4a51c 100644 --- a/charms/kfp-persistence/requirements-lint.in +++ b/charms/kfp-persistence/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/charms/kfp-persistence/requirements-lint.txt b/charms/kfp-persistence/requirements-lint.txt index 453d41c4..890bea02 100644 --- a/charms/kfp-persistence/requirements-lint.txt +++ b/charms/kfp-persistence/requirements-lint.txt @@ -2,63 +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==23.3.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 + # via -r ./requirements-lint.in isort==5.12.0 - # via -r requirements-fmt.txt + # via -r ./requirements-lint.in mccabe==0.7.0 # via flake8 mypy-extensions==1.0.0 - # via - # -r requirements-fmt.txt - # black + # via black packaging==23.1 - # via - # -r requirements-fmt.txt - # black -pathspec==0.11.1 - # via - # -r requirements-fmt.txt - # black + # via black +pathspec==0.11.2 + # via black pep8-naming==0.13.3 - # via -r requirements-lint.in -platformdirs==3.7.0 - # via - # -r requirements-fmt.txt - # black + # via -r ./requirements-lint.in +platformdirs==3.10.0 + # 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.6.3 - # 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/charms/kfp-persistence/requirements-unit.in b/charms/kfp-persistence/requirements-unit.in index fbce543f..84024f88 100644 --- a/charms/kfp-persistence/requirements-unit.in +++ b/charms/kfp-persistence/requirements-unit.in @@ -1,5 +1,23 @@ +# 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. coverage +oci_image +ops pytest pytest-mock pytest-lazy-fixture --r requirements.txt +pyyaml +-r requirements.in diff --git a/charms/kfp-persistence/requirements-unit.txt b/charms/kfp-persistence/requirements-unit.txt index 9c8f3e86..b9bcf966 100644 --- a/charms/kfp-persistence/requirements-unit.txt +++ b/charms/kfp-persistence/requirements-unit.txt @@ -2,57 +2,44 @@ # This file is autogenerated by pip-compile with Python 3.8 # by the following command: # -# pip-compile --resolver=backtracking ./requirements-unit.in +# pip-compile ./requirements-unit.in # attrs==23.1.0 - # via - # -r ./requirements.txt - # jsonschema -certifi==2023.5.7 - # via - # -r ./requirements.txt - # requests -charset-normalizer==3.1.0 - # via - # -r ./requirements.txt - # requests + # via jsonschema +certifi==2023.7.22 + # via requests +charset-normalizer==3.2.0 + # via requests coverage==7.2.7 # via -r ./requirements-unit.in -exceptiongroup==1.1.1 +exceptiongroup==1.1.2 # via pytest idna==3.4 - # via - # -r ./requirements.txt - # requests -importlib-resources==5.12.0 - # via - # -r ./requirements.txt - # jsonschema + # via requests +importlib-resources==6.0.0 + # via jsonschema iniconfig==2.0.0 # via pytest jsonschema==4.17.3 - # via - # -r ./requirements.txt - # serialized-data-interface + # via serialized-data-interface oci-image==1.0.0 - # via -r ./requirements.txt -ops==1.2.0 # via - # -r ./requirements.txt + # -r ./requirements-unit.in + # -r ./requirements.in +ops==2.4.1 + # via + # -r ./requirements-unit.in + # -r ./requirements.in # serialized-data-interface packaging==23.1 # via pytest pkgutil-resolve-name==1.3.10 - # via - # -r ./requirements.txt - # jsonschema + # via jsonschema pluggy==1.2.0 # via pytest pyrsistent==0.19.3 - # via - # -r ./requirements.txt - # jsonschema -pytest==7.3.2 + # via jsonschema +pytest==7.4.0 # via # -r ./requirements-unit.in # pytest-lazy-fixture @@ -61,24 +48,20 @@ pytest-lazy-fixture==0.6.3 # via -r ./requirements-unit.in 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 # ops # serialized-data-interface requests==2.31.0 - # via - # -r ./requirements.txt - # serialized-data-interface -serialized-data-interface==0.6.0 - # via -r ./requirements.txt + # via serialized-data-interface +serialized-data-interface==0.7.0 + # via -r ./requirements.in tomli==2.0.1 # via pytest -urllib3==2.0.3 - # 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/charms/kfp-persistence/requirements.in b/charms/kfp-persistence/requirements.in index 67c7c782..8cf0f9b1 100644 --- a/charms/kfp-persistence/requirements.in +++ b/charms/kfp-persistence/requirements.in @@ -1,6 +1,3 @@ -# Workaround for https://github.com/python-jsonschema/jsonschema/issues/1117 -# and https://github.com/python-jsonschema/jsonschema/issues/1114 -jsonschema<4.18 ops -oci-image==1.0.0 -serialized-data-interface<0.7 +oci-image +serialized-data-interface diff --git a/charms/kfp-persistence/requirements.txt b/charms/kfp-persistence/requirements.txt index 6bb6f130..be26a022 100644 --- a/charms/kfp-persistence/requirements.txt +++ b/charms/kfp-persistence/requirements.txt @@ -2,11 +2,11 @@ # This file is autogenerated by pip-compile with Python 3.8 # by the following command: # -# pip-compile --resolver=backtracking requirements.in +# pip-compile ./requirements.in # attrs==23.1.0 # via jsonschema -certifi==2023.5.7 +certifi==2023.7.22 # via requests charset-normalizer==3.2.0 # via requests @@ -15,14 +15,12 @@ idna==3.4 importlib-resources==6.0.0 # via jsonschema jsonschema==4.17.3 - # via - # -r requirements.in - # serialized-data-interface + # via serialized-data-interface oci-image==1.0.0 - # via -r requirements.in + # via -r ./requirements.in ops==2.4.1 # via - # -r requirements.in + # -r ./requirements.in # serialized-data-interface pkgutil-resolve-name==1.3.10 # via jsonschema @@ -34,9 +32,9 @@ pyyaml==6.0.1 # serialized-data-interface requests==2.31.0 # via serialized-data-interface -serialized-data-interface==0.6.0 - # via -r requirements.in -urllib3==2.0.3 +serialized-data-interface==0.7.0 + # via -r ./requirements.in +urllib3==2.0.4 # via requests websocket-client==1.6.1 # via ops diff --git a/charms/kfp-profile-controller/requirements-fmt.txt b/charms/kfp-profile-controller/requirements-fmt.txt index 2faae2da..090e6eb0 100644 --- a/charms/kfp-profile-controller/requirements-fmt.txt +++ b/charms/kfp-profile-controller/requirements-fmt.txt @@ -2,11 +2,11 @@ # 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==23.3.0 +black==23.7.0 # via -r ./requirements-fmt.in -click==8.1.3 +click==8.1.6 # via black isort==5.12.0 # via -r ./requirements-fmt.in @@ -14,11 +14,11 @@ mypy-extensions==1.0.0 # via black packaging==23.1 # via black -pathspec==0.11.1 +pathspec==0.11.2 # via black -platformdirs==3.7.0 +platformdirs==3.10.0 # via black tomli==2.0.1 # via black -typing-extensions==4.6.3 +typing-extensions==4.7.1 # via black diff --git a/charms/kfp-profile-controller/requirements-integration.in b/charms/kfp-profile-controller/requirements-integration.in index ef7a259f..9420320b 100644 --- a/charms/kfp-profile-controller/requirements-integration.in +++ b/charms/kfp-profile-controller/requirements-integration.in @@ -6,4 +6,3 @@ pytest-operator selenium selenium-wire tenacity --r requirements.txt diff --git a/charms/kfp-profile-controller/requirements-integration.txt b/charms/kfp-profile-controller/requirements-integration.txt index 844579bb..1cbd196d 100644 --- a/charms/kfp-profile-controller/requirements-integration.txt +++ b/charms/kfp-profile-controller/requirements-integration.txt @@ -2,18 +2,14 @@ # This file is autogenerated by pip-compile with Python 3.8 # by the following command: # -# pip-compile --resolver=backtracking ./requirements-integration.in +# pip-compile ./requirements-integration.in # -anyio==3.7.0 +anyio==3.7.1 # via httpcore asttokens==2.2.1 # via stack-data -async-generator==1.10 - # via trio attrs==23.1.0 # via - # -r ./requirements.txt - # jsonschema # outcome # trio backcall==0.2.0 @@ -26,9 +22,8 @@ brotli==1.0.9 # via selenium-wire cachetools==5.3.1 # via google-auth -certifi==2023.5.7 +certifi==2023.7.22 # via - # -r ./requirements.txt # httpcore # httpx # kubernetes @@ -39,11 +34,9 @@ cffi==1.15.1 # via # cryptography # pynacl -charset-normalizer==3.1.0 - # via - # -r ./requirements.txt - # requests -cryptography==41.0.1 +charset-normalizer==3.2.0 + # via requests +cryptography==41.0.2 # via # paramiko # pyopenssl @@ -51,7 +44,7 @@ decorator==5.1.1 # via # ipdb # ipython -exceptiongroup==1.1.1 +exceptiongroup==1.1.2 # via # anyio # pytest @@ -69,7 +62,7 @@ h2==4.1.0 # via selenium-wire hpack==4.0.0 # via h2 -httpcore==0.17.2 +httpcore==0.17.3 # via httpx httpx==0.24.1 # via lightkube @@ -79,30 +72,21 @@ hyperframe==6.0.1 # selenium-wire idna==3.4 # via - # -r ./requirements.txt # anyio # httpx # requests # trio -importlib-resources==5.12.0 - # via - # -r ./requirements.txt - # jsonschema iniconfig==2.0.0 # via pytest ipdb==0.13.13 # via pytest-operator ipython==8.12.2 # via ipdb -jedi==0.18.2 +jedi==0.19.0 # via ipython jinja2==3.1.2 # via pytest-operator -jsonschema==4.17.3 - # via - # -r ./requirements.txt - # serialized-data-interface -juju==2.9.42.4 +juju==2.9.44.0 # via # -r ./requirements-integration.in # pytest-operator @@ -110,9 +94,9 @@ jujubundlelib==0.5.7 # via theblues kaitaistruct==0.10 # via selenium-wire -kubernetes==26.1.0 +kubernetes==27.2.0 # via juju -lightkube==0.13.0 +lightkube==0.14.0 # via -r ./requirements-integration.in lightkube-models==1.27.1.4 # via lightkube @@ -127,13 +111,9 @@ matplotlib-inline==0.1.6 mypy-extensions==1.0.0 # via typing-inspect oauthlib==3.2.2 - # via requests-oauthlib -oci-image==1.0.0 - # via -r ./requirements.txt -ops==1.2.0 # via - # -r ./requirements.txt - # serialized-data-interface + # kubernetes + # requests-oauthlib outcome==1.2.0 # via trio packaging==23.1 @@ -146,13 +126,9 @@ pexpect==4.8.0 # via ipython pickleshare==0.7.5 # via ipython -pkgutil-resolve-name==1.3.10 - # via - # -r ./requirements.txt - # 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 @@ -181,25 +157,21 @@ pynacl==1.5.0 # pymacaroons pyopenssl==23.2.0 # via selenium-wire -pyparsing==3.1.0 +pyparsing==3.1.1 # via selenium-wire pyrfc3339==1.1 # via # juju # macaroonbakery -pyrsistent==0.19.3 - # via - # -r ./requirements.txt - # jsonschema pysocks==1.7.1 # via # selenium-wire # urllib3 -pytest==7.3.2 +pytest==7.4.0 # via # pytest-asyncio # pytest-operator -pytest-asyncio==0.21.0 +pytest-asyncio==0.21.1 # via pytest-operator pytest-operator==0.28.0 # via -r ./requirements-integration.in @@ -207,23 +179,18 @@ python-dateutil==2.8.2 # via kubernetes pytz==2023.3 # via pyrfc3339 -pyyaml==6.0 +pyyaml==6.0.1 # via - # -r ./requirements.txt # juju # jujubundlelib # kubernetes # lightkube - # ops # pytest-operator - # serialized-data-interface requests==2.31.0 # via - # -r ./requirements.txt # kubernetes # macaroonbakery # requests-oauthlib - # serialized-data-interface # theblues requests-oauthlib==1.3.1 # via kubernetes @@ -235,8 +202,6 @@ selenium==4.10.0 # selenium-wire selenium-wire==5.1.0 # via -r ./requirements-integration.in -serialized-data-interface==0.6.0 - # via -r ./requirements.txt six==1.16.0 # via # asttokens @@ -270,27 +235,26 @@ traitlets==5.9.0 # via # ipython # matplotlib-inline -trio==0.22.0 +trio==0.22.2 # via # selenium # trio-websocket trio-websocket==0.10.3 # via selenium -typing-extensions==4.6.3 +typing-extensions==4.7.1 # via # ipython # typing-inspect typing-inspect==0.9.0 # via juju -urllib3[socks]==2.0.3 +urllib3[socks]==2.0.4 # via - # -r ./requirements.txt # kubernetes # requests # selenium wcwidth==0.2.6 # via prompt-toolkit -websocket-client==1.6.0 +websocket-client==1.6.1 # via kubernetes websockets==7.0 # via juju @@ -298,12 +262,5 @@ wsproto==1.2.0 # via # selenium-wire # trio-websocket -zipp==3.15.0 - # via - # -r ./requirements.txt - # 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/charms/kfp-profile-controller/requirements-lint.in b/charms/kfp-profile-controller/requirements-lint.in index 87f005ea..07a4a51c 100644 --- a/charms/kfp-profile-controller/requirements-lint.in +++ b/charms/kfp-profile-controller/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/charms/kfp-profile-controller/requirements-lint.txt b/charms/kfp-profile-controller/requirements-lint.txt index 453d41c4..890bea02 100644 --- a/charms/kfp-profile-controller/requirements-lint.txt +++ b/charms/kfp-profile-controller/requirements-lint.txt @@ -2,63 +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==23.3.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 + # via -r ./requirements-lint.in isort==5.12.0 - # via -r requirements-fmt.txt + # via -r ./requirements-lint.in mccabe==0.7.0 # via flake8 mypy-extensions==1.0.0 - # via - # -r requirements-fmt.txt - # black + # via black packaging==23.1 - # via - # -r requirements-fmt.txt - # black -pathspec==0.11.1 - # via - # -r requirements-fmt.txt - # black + # via black +pathspec==0.11.2 + # via black pep8-naming==0.13.3 - # via -r requirements-lint.in -platformdirs==3.7.0 - # via - # -r requirements-fmt.txt - # black + # via -r ./requirements-lint.in +platformdirs==3.10.0 + # 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.6.3 - # 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/charms/kfp-profile-controller/requirements-unit.in b/charms/kfp-profile-controller/requirements-unit.in index fbce543f..84024f88 100644 --- a/charms/kfp-profile-controller/requirements-unit.in +++ b/charms/kfp-profile-controller/requirements-unit.in @@ -1,5 +1,23 @@ +# 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. coverage +oci_image +ops pytest pytest-mock pytest-lazy-fixture --r requirements.txt +pyyaml +-r requirements.in diff --git a/charms/kfp-profile-controller/requirements-unit.txt b/charms/kfp-profile-controller/requirements-unit.txt index 9c8f3e86..b9bcf966 100644 --- a/charms/kfp-profile-controller/requirements-unit.txt +++ b/charms/kfp-profile-controller/requirements-unit.txt @@ -2,57 +2,44 @@ # This file is autogenerated by pip-compile with Python 3.8 # by the following command: # -# pip-compile --resolver=backtracking ./requirements-unit.in +# pip-compile ./requirements-unit.in # attrs==23.1.0 - # via - # -r ./requirements.txt - # jsonschema -certifi==2023.5.7 - # via - # -r ./requirements.txt - # requests -charset-normalizer==3.1.0 - # via - # -r ./requirements.txt - # requests + # via jsonschema +certifi==2023.7.22 + # via requests +charset-normalizer==3.2.0 + # via requests coverage==7.2.7 # via -r ./requirements-unit.in -exceptiongroup==1.1.1 +exceptiongroup==1.1.2 # via pytest idna==3.4 - # via - # -r ./requirements.txt - # requests -importlib-resources==5.12.0 - # via - # -r ./requirements.txt - # jsonschema + # via requests +importlib-resources==6.0.0 + # via jsonschema iniconfig==2.0.0 # via pytest jsonschema==4.17.3 - # via - # -r ./requirements.txt - # serialized-data-interface + # via serialized-data-interface oci-image==1.0.0 - # via -r ./requirements.txt -ops==1.2.0 # via - # -r ./requirements.txt + # -r ./requirements-unit.in + # -r ./requirements.in +ops==2.4.1 + # via + # -r ./requirements-unit.in + # -r ./requirements.in # serialized-data-interface packaging==23.1 # via pytest pkgutil-resolve-name==1.3.10 - # via - # -r ./requirements.txt - # jsonschema + # via jsonschema pluggy==1.2.0 # via pytest pyrsistent==0.19.3 - # via - # -r ./requirements.txt - # jsonschema -pytest==7.3.2 + # via jsonschema +pytest==7.4.0 # via # -r ./requirements-unit.in # pytest-lazy-fixture @@ -61,24 +48,20 @@ pytest-lazy-fixture==0.6.3 # via -r ./requirements-unit.in 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 # ops # serialized-data-interface requests==2.31.0 - # via - # -r ./requirements.txt - # serialized-data-interface -serialized-data-interface==0.6.0 - # via -r ./requirements.txt + # via serialized-data-interface +serialized-data-interface==0.7.0 + # via -r ./requirements.in tomli==2.0.1 # via pytest -urllib3==2.0.3 - # 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/charms/kfp-profile-controller/requirements.in b/charms/kfp-profile-controller/requirements.in index ef3c7451..8cf0f9b1 100644 --- a/charms/kfp-profile-controller/requirements.in +++ b/charms/kfp-profile-controller/requirements.in @@ -1,6 +1,3 @@ -# Workaround for https://github.com/python-jsonschema/jsonschema/issues/1117 -# and https://github.com/python-jsonschema/jsonschema/issues/1114 -jsonschema<4.18 ops oci-image -serialized-data-interface<0.7 +serialized-data-interface diff --git a/charms/kfp-profile-controller/requirements.txt b/charms/kfp-profile-controller/requirements.txt index 6bb6f130..be26a022 100644 --- a/charms/kfp-profile-controller/requirements.txt +++ b/charms/kfp-profile-controller/requirements.txt @@ -2,11 +2,11 @@ # This file is autogenerated by pip-compile with Python 3.8 # by the following command: # -# pip-compile --resolver=backtracking requirements.in +# pip-compile ./requirements.in # attrs==23.1.0 # via jsonschema -certifi==2023.5.7 +certifi==2023.7.22 # via requests charset-normalizer==3.2.0 # via requests @@ -15,14 +15,12 @@ idna==3.4 importlib-resources==6.0.0 # via jsonschema jsonschema==4.17.3 - # via - # -r requirements.in - # serialized-data-interface + # via serialized-data-interface oci-image==1.0.0 - # via -r requirements.in + # via -r ./requirements.in ops==2.4.1 # via - # -r requirements.in + # -r ./requirements.in # serialized-data-interface pkgutil-resolve-name==1.3.10 # via jsonschema @@ -34,9 +32,9 @@ pyyaml==6.0.1 # serialized-data-interface requests==2.31.0 # via serialized-data-interface -serialized-data-interface==0.6.0 - # via -r requirements.in -urllib3==2.0.3 +serialized-data-interface==0.7.0 + # via -r ./requirements.in +urllib3==2.0.4 # via requests websocket-client==1.6.1 # via ops diff --git a/charms/kfp-schedwf/requirements-fmt.txt b/charms/kfp-schedwf/requirements-fmt.txt index 2faae2da..090e6eb0 100644 --- a/charms/kfp-schedwf/requirements-fmt.txt +++ b/charms/kfp-schedwf/requirements-fmt.txt @@ -2,11 +2,11 @@ # 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==23.3.0 +black==23.7.0 # via -r ./requirements-fmt.in -click==8.1.3 +click==8.1.6 # via black isort==5.12.0 # via -r ./requirements-fmt.in @@ -14,11 +14,11 @@ mypy-extensions==1.0.0 # via black packaging==23.1 # via black -pathspec==0.11.1 +pathspec==0.11.2 # via black -platformdirs==3.7.0 +platformdirs==3.10.0 # via black tomli==2.0.1 # via black -typing-extensions==4.6.3 +typing-extensions==4.7.1 # via black diff --git a/charms/kfp-schedwf/requirements-integration.in b/charms/kfp-schedwf/requirements-integration.in index 5cea1296..e6f021b9 100644 --- a/charms/kfp-schedwf/requirements-integration.in +++ b/charms/kfp-schedwf/requirements-integration.in @@ -5,4 +5,3 @@ pytest-operator selenium selenium-wire tenacity --r requirements.txt diff --git a/charms/kfp-schedwf/requirements-integration.txt b/charms/kfp-schedwf/requirements-integration.txt index c9b1a7c1..1c89298a 100644 --- a/charms/kfp-schedwf/requirements-integration.txt +++ b/charms/kfp-schedwf/requirements-integration.txt @@ -2,12 +2,10 @@ # This file is autogenerated by pip-compile with Python 3.8 # by the following command: # -# pip-compile --resolver=backtracking ./requirements-integration.in +# pip-compile ./requirements-integration.in # asttokens==2.2.1 # via stack-data -async-generator==1.10 - # via trio attrs==23.1.0 # via # outcome @@ -22,7 +20,7 @@ brotli==1.0.9 # via selenium-wire cachetools==5.3.1 # via google-auth -certifi==2023.5.7 +certifi==2023.7.22 # via # kubernetes # requests @@ -32,9 +30,9 @@ cffi==1.15.1 # via # cryptography # pynacl -charset-normalizer==3.1.0 +charset-normalizer==3.2.0 # via requests -cryptography==41.0.1 +cryptography==41.0.2 # via # paramiko # pyopenssl @@ -42,7 +40,7 @@ decorator==5.1.1 # via # ipdb # ipython -exceptiongroup==1.1.1 +exceptiongroup==1.1.2 # via # pytest # trio @@ -71,11 +69,11 @@ ipdb==0.13.13 # via pytest-operator ipython==8.12.2 # via ipdb -jedi==0.18.2 +jedi==0.19.0 # via ipython jinja2==3.1.2 # via pytest-operator -juju==2.9.42.4 +juju==2.9.44.0 # via # -r ./requirements-integration.in # pytest-operator @@ -83,7 +81,7 @@ jujubundlelib==0.5.7 # via theblues kaitaistruct==0.10 # via selenium-wire -kubernetes==26.1.0 +kubernetes==27.2.0 # via juju macaroonbakery==1.3.1 # via @@ -96,11 +94,9 @@ matplotlib-inline==0.1.6 mypy-extensions==1.0.0 # via typing-inspect oauthlib==3.2.2 - # via requests-oauthlib -oci-image==1.0.0 - # via -r ./requirements.txt -ops==2.3.0 - # via -r ./requirements.txt + # via + # kubernetes + # requests-oauthlib outcome==1.2.0 # via trio packaging==23.1 @@ -115,7 +111,7 @@ pickleshare==0.7.5 # via ipython pluggy==1.2.0 # via pytest -prompt-toolkit==3.0.38 +prompt-toolkit==3.0.39 # via ipython protobuf==3.20.3 # via macaroonbakery @@ -144,7 +140,7 @@ pynacl==1.5.0 # pymacaroons pyopenssl==23.2.0 # via selenium-wire -pyparsing==3.1.0 +pyparsing==3.1.1 # via selenium-wire pyrfc3339==1.1 # via @@ -154,11 +150,11 @@ pysocks==1.7.1 # via # selenium-wire # urllib3 -pytest==7.3.2 +pytest==7.4.0 # via # pytest-asyncio # pytest-operator -pytest-asyncio==0.21.0 +pytest-asyncio==0.21.1 # via pytest-operator pytest-operator==0.28.0 # via -r ./requirements-integration.in @@ -166,13 +162,11 @@ python-dateutil==2.8.2 # via kubernetes pytz==2023.3 # via pyrfc3339 -pyyaml==6.0 +pyyaml==6.0.1 # via - # -r ./requirements.txt # juju # jujubundlelib # kubernetes - # ops # pytest-operator requests==2.31.0 # via @@ -219,30 +213,27 @@ traitlets==5.9.0 # via # ipython # matplotlib-inline -trio==0.22.0 +trio==0.22.2 # via # selenium # trio-websocket trio-websocket==0.10.3 # via selenium -typing-extensions==4.6.3 +typing-extensions==4.7.1 # via # ipython # typing-inspect typing-inspect==0.9.0 # via juju -urllib3[socks]==2.0.3 +urllib3[socks]==2.0.4 # via # kubernetes # requests # selenium wcwidth==0.2.6 # via prompt-toolkit -websocket-client==1.6.0 - # via - # -r ./requirements.txt - # kubernetes - # ops +websocket-client==1.6.1 + # via kubernetes websockets==7.0 # via juju wsproto==1.2.0 @@ -251,6 +242,3 @@ wsproto==1.2.0 # trio-websocket zstandard==0.21.0 # via selenium-wire - -# The following packages are considered to be unsafe in a requirements file: -# setuptools diff --git a/charms/kfp-schedwf/requirements-lint.in b/charms/kfp-schedwf/requirements-lint.in index 87f005ea..07a4a51c 100644 --- a/charms/kfp-schedwf/requirements-lint.in +++ b/charms/kfp-schedwf/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/charms/kfp-schedwf/requirements-lint.txt b/charms/kfp-schedwf/requirements-lint.txt index 453d41c4..890bea02 100644 --- a/charms/kfp-schedwf/requirements-lint.txt +++ b/charms/kfp-schedwf/requirements-lint.txt @@ -2,63 +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==23.3.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 + # via -r ./requirements-lint.in isort==5.12.0 - # via -r requirements-fmt.txt + # via -r ./requirements-lint.in mccabe==0.7.0 # via flake8 mypy-extensions==1.0.0 - # via - # -r requirements-fmt.txt - # black + # via black packaging==23.1 - # via - # -r requirements-fmt.txt - # black -pathspec==0.11.1 - # via - # -r requirements-fmt.txt - # black + # via black +pathspec==0.11.2 + # via black pep8-naming==0.13.3 - # via -r requirements-lint.in -platformdirs==3.7.0 - # via - # -r requirements-fmt.txt - # black + # via -r ./requirements-lint.in +platformdirs==3.10.0 + # 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.6.3 - # 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/charms/kfp-schedwf/requirements-unit.in b/charms/kfp-schedwf/requirements-unit.in index fbce543f..84024f88 100644 --- a/charms/kfp-schedwf/requirements-unit.in +++ b/charms/kfp-schedwf/requirements-unit.in @@ -1,5 +1,23 @@ +# 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. coverage +oci_image +ops pytest pytest-mock pytest-lazy-fixture --r requirements.txt +pyyaml +-r requirements.in diff --git a/charms/kfp-schedwf/requirements-unit.txt b/charms/kfp-schedwf/requirements-unit.txt index 330586d2..c4fed205 100644 --- a/charms/kfp-schedwf/requirements-unit.txt +++ b/charms/kfp-schedwf/requirements-unit.txt @@ -2,23 +2,37 @@ # This file is autogenerated by pip-compile with Python 3.8 # by the following command: # -# pip-compile --resolver=backtracking ./requirements-unit.in +# pip-compile ./requirements-unit.in # +attrs==23.1.0 + # via jsonschema coverage==7.2.7 # via -r ./requirements-unit.in -exceptiongroup==1.1.1 +exceptiongroup==1.1.2 # via pytest +importlib-resources==6.0.0 + # via jsonschema iniconfig==2.0.0 # via pytest +jsonschema==4.17.3 + # via -r ./requirements.in oci-image==1.0.0 - # via -r ./requirements.txt -ops==2.3.0 - # via -r ./requirements.txt + # via + # -r ./requirements-unit.in + # -r ./requirements.in +ops==2.4.1 + # via + # -r ./requirements-unit.in + # -r ./requirements.in packaging==23.1 # via pytest +pkgutil-resolve-name==1.3.10 + # via jsonschema pluggy==1.2.0 # via pytest -pytest==7.3.2 +pyrsistent==0.19.3 + # via jsonschema +pytest==7.4.0 # via # -r ./requirements-unit.in # pytest-lazy-fixture @@ -27,13 +41,13 @@ pytest-lazy-fixture==0.6.3 # via -r ./requirements-unit.in 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 # ops tomli==2.0.1 # via pytest -websocket-client==1.6.0 - # via - # -r ./requirements.txt - # ops +websocket-client==1.6.1 + # via ops +zipp==3.16.2 + # via importlib-resources diff --git a/charms/kfp-schedwf/requirements.txt b/charms/kfp-schedwf/requirements.txt index 3e692755..4f0a87fa 100644 --- a/charms/kfp-schedwf/requirements.txt +++ b/charms/kfp-schedwf/requirements.txt @@ -2,18 +2,18 @@ # This file is autogenerated by pip-compile with Python 3.8 # by the following command: # -# pip-compile --resolver=backtracking requirements.in +# pip-compile ./requirements.in # attrs==23.1.0 # via jsonschema importlib-resources==6.0.0 # via jsonschema jsonschema==4.17.3 - # via -r requirements.in + # via -r ./requirements.in oci-image==1.0.0 - # via -r requirements.in + # via -r ./requirements.in ops==2.4.1 - # via -r requirements.in + # via -r ./requirements.in pkgutil-resolve-name==1.3.10 # via jsonschema pyrsistent==0.19.3 diff --git a/charms/kfp-ui/requirements-fmt.txt b/charms/kfp-ui/requirements-fmt.txt index 2faae2da..090e6eb0 100644 --- a/charms/kfp-ui/requirements-fmt.txt +++ b/charms/kfp-ui/requirements-fmt.txt @@ -2,11 +2,11 @@ # 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==23.3.0 +black==23.7.0 # via -r ./requirements-fmt.in -click==8.1.3 +click==8.1.6 # via black isort==5.12.0 # via -r ./requirements-fmt.in @@ -14,11 +14,11 @@ mypy-extensions==1.0.0 # via black packaging==23.1 # via black -pathspec==0.11.1 +pathspec==0.11.2 # via black -platformdirs==3.7.0 +platformdirs==3.10.0 # via black tomli==2.0.1 # via black -typing-extensions==4.6.3 +typing-extensions==4.7.1 # via black diff --git a/charms/kfp-ui/requirements-integration.in b/charms/kfp-ui/requirements-integration.in index 5cea1296..e6f021b9 100644 --- a/charms/kfp-ui/requirements-integration.in +++ b/charms/kfp-ui/requirements-integration.in @@ -5,4 +5,3 @@ pytest-operator selenium selenium-wire tenacity --r requirements.txt diff --git a/charms/kfp-ui/requirements-integration.txt b/charms/kfp-ui/requirements-integration.txt index c48f4de1..1c89298a 100644 --- a/charms/kfp-ui/requirements-integration.txt +++ b/charms/kfp-ui/requirements-integration.txt @@ -2,16 +2,12 @@ # This file is autogenerated by pip-compile with Python 3.8 # by the following command: # -# pip-compile --resolver=backtracking ./requirements-integration.in +# pip-compile ./requirements-integration.in # asttokens==2.2.1 # via stack-data -async-generator==1.10 - # via trio attrs==23.1.0 # via - # -r ./requirements.txt - # jsonschema # outcome # trio backcall==0.2.0 @@ -24,9 +20,8 @@ brotli==1.0.9 # via selenium-wire cachetools==5.3.1 # via google-auth -certifi==2023.5.7 +certifi==2023.7.22 # via - # -r ./requirements.txt # kubernetes # requests # selenium @@ -35,11 +30,9 @@ cffi==1.15.1 # via # cryptography # pynacl -charset-normalizer==3.1.0 - # via - # -r ./requirements.txt - # requests -cryptography==41.0.1 +charset-normalizer==3.2.0 + # via requests +cryptography==41.0.2 # via # paramiko # pyopenssl @@ -47,7 +40,7 @@ decorator==5.1.1 # via # ipdb # ipython -exceptiongroup==1.1.1 +exceptiongroup==1.1.2 # via # pytest # trio @@ -68,28 +61,19 @@ hyperframe==6.0.1 # selenium-wire idna==3.4 # via - # -r ./requirements.txt # requests # trio -importlib-resources==5.12.0 - # via - # -r ./requirements.txt - # jsonschema iniconfig==2.0.0 # via pytest ipdb==0.13.13 # via pytest-operator ipython==8.12.2 # via ipdb -jedi==0.18.2 +jedi==0.19.0 # via ipython jinja2==3.1.2 # via pytest-operator -jsonschema==4.17.3 - # via - # -r ./requirements.txt - # serialized-data-interface -juju==2.9.42.4 +juju==2.9.44.0 # via # -r ./requirements-integration.in # pytest-operator @@ -97,7 +81,7 @@ jujubundlelib==0.5.7 # via theblues kaitaistruct==0.10 # via selenium-wire -kubernetes==26.1.0 +kubernetes==27.2.0 # via juju macaroonbakery==1.3.1 # via @@ -110,13 +94,9 @@ matplotlib-inline==0.1.6 mypy-extensions==1.0.0 # via typing-inspect oauthlib==3.2.2 - # via requests-oauthlib -oci-image==1.0.0 - # via -r ./requirements.txt -ops==2.3.0 # via - # -r ./requirements.txt - # serialized-data-interface + # kubernetes + # requests-oauthlib outcome==1.2.0 # via trio packaging==23.1 @@ -129,13 +109,9 @@ pexpect==4.8.0 # via ipython pickleshare==0.7.5 # via ipython -pkgutil-resolve-name==1.3.10 - # via - # -r ./requirements.txt - # 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 @@ -164,25 +140,21 @@ pynacl==1.5.0 # pymacaroons pyopenssl==23.2.0 # via selenium-wire -pyparsing==3.1.0 +pyparsing==3.1.1 # via selenium-wire pyrfc3339==1.1 # via # juju # macaroonbakery -pyrsistent==0.19.3 - # via - # -r ./requirements.txt - # jsonschema pysocks==1.7.1 # via # selenium-wire # urllib3 -pytest==7.3.2 +pytest==7.4.0 # via # pytest-asyncio # pytest-operator -pytest-asyncio==0.21.0 +pytest-asyncio==0.21.1 # via pytest-operator pytest-operator==0.28.0 # via -r ./requirements-integration.in @@ -190,22 +162,17 @@ python-dateutil==2.8.2 # via kubernetes pytz==2023.3 # via pyrfc3339 -pyyaml==6.0 +pyyaml==6.0.1 # via - # -r ./requirements.txt # juju # jujubundlelib # kubernetes - # ops # pytest-operator - # serialized-data-interface requests==2.31.0 # via - # -r ./requirements.txt # kubernetes # macaroonbakery # requests-oauthlib - # serialized-data-interface # theblues requests-oauthlib==1.3.1 # via kubernetes @@ -217,8 +184,6 @@ selenium==4.10.0 # selenium-wire selenium-wire==5.1.0 # via -r ./requirements-integration.in -serialized-data-interface==0.6.0 - # via -r ./requirements.txt six==1.16.0 # via # asttokens @@ -248,43 +213,32 @@ traitlets==5.9.0 # via # ipython # matplotlib-inline -trio==0.22.0 +trio==0.22.2 # via # selenium # trio-websocket trio-websocket==0.10.3 # via selenium -typing-extensions==4.6.3 +typing-extensions==4.7.1 # via # ipython # typing-inspect typing-inspect==0.9.0 # via juju -urllib3[socks]==2.0.3 +urllib3[socks]==2.0.4 # via - # -r ./requirements.txt # kubernetes # requests # selenium wcwidth==0.2.6 # via prompt-toolkit -websocket-client==1.6.0 - # via - # -r ./requirements.txt - # kubernetes - # ops +websocket-client==1.6.1 + # via kubernetes 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.21.0 # via selenium-wire - -# The following packages are considered to be unsafe in a requirements file: -# setuptools diff --git a/charms/kfp-ui/requirements-lint.in b/charms/kfp-ui/requirements-lint.in index 87f005ea..07a4a51c 100644 --- a/charms/kfp-ui/requirements-lint.in +++ b/charms/kfp-ui/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/charms/kfp-ui/requirements-lint.txt b/charms/kfp-ui/requirements-lint.txt index 453d41c4..890bea02 100644 --- a/charms/kfp-ui/requirements-lint.txt +++ b/charms/kfp-ui/requirements-lint.txt @@ -2,63 +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==23.3.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 + # via -r ./requirements-lint.in isort==5.12.0 - # via -r requirements-fmt.txt + # via -r ./requirements-lint.in mccabe==0.7.0 # via flake8 mypy-extensions==1.0.0 - # via - # -r requirements-fmt.txt - # black + # via black packaging==23.1 - # via - # -r requirements-fmt.txt - # black -pathspec==0.11.1 - # via - # -r requirements-fmt.txt - # black + # via black +pathspec==0.11.2 + # via black pep8-naming==0.13.3 - # via -r requirements-lint.in -platformdirs==3.7.0 - # via - # -r requirements-fmt.txt - # black + # via -r ./requirements-lint.in +platformdirs==3.10.0 + # 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.6.3 - # 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/charms/kfp-ui/requirements-unit.in b/charms/kfp-ui/requirements-unit.in index fbce543f..84024f88 100644 --- a/charms/kfp-ui/requirements-unit.in +++ b/charms/kfp-ui/requirements-unit.in @@ -1,5 +1,23 @@ +# 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. coverage +oci_image +ops pytest pytest-mock pytest-lazy-fixture --r requirements.txt +pyyaml +-r requirements.in diff --git a/charms/kfp-ui/requirements-unit.txt b/charms/kfp-ui/requirements-unit.txt index c9c5627f..b9bcf966 100644 --- a/charms/kfp-ui/requirements-unit.txt +++ b/charms/kfp-ui/requirements-unit.txt @@ -2,57 +2,44 @@ # This file is autogenerated by pip-compile with Python 3.8 # by the following command: # -# pip-compile --resolver=backtracking ./requirements-unit.in +# pip-compile ./requirements-unit.in # attrs==23.1.0 - # via - # -r ./requirements.txt - # jsonschema -certifi==2023.5.7 - # via - # -r ./requirements.txt - # requests -charset-normalizer==3.1.0 - # via - # -r ./requirements.txt - # requests + # via jsonschema +certifi==2023.7.22 + # via requests +charset-normalizer==3.2.0 + # via requests coverage==7.2.7 # via -r ./requirements-unit.in -exceptiongroup==1.1.1 +exceptiongroup==1.1.2 # via pytest idna==3.4 - # via - # -r ./requirements.txt - # requests -importlib-resources==5.12.0 - # via - # -r ./requirements.txt - # jsonschema + # via requests +importlib-resources==6.0.0 + # via jsonschema iniconfig==2.0.0 # via pytest jsonschema==4.17.3 - # via - # -r ./requirements.txt - # serialized-data-interface + # via serialized-data-interface oci-image==1.0.0 - # via -r ./requirements.txt -ops==2.3.0 # via - # -r ./requirements.txt + # -r ./requirements-unit.in + # -r ./requirements.in +ops==2.4.1 + # via + # -r ./requirements-unit.in + # -r ./requirements.in # serialized-data-interface packaging==23.1 # via pytest pkgutil-resolve-name==1.3.10 - # via - # -r ./requirements.txt - # jsonschema + # via jsonschema pluggy==1.2.0 # via pytest pyrsistent==0.19.3 - # via - # -r ./requirements.txt - # jsonschema -pytest==7.3.2 + # via jsonschema +pytest==7.4.0 # via # -r ./requirements-unit.in # pytest-lazy-fixture @@ -61,28 +48,20 @@ pytest-lazy-fixture==0.6.3 # via -r ./requirements-unit.in 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 # ops # serialized-data-interface requests==2.31.0 - # via - # -r ./requirements.txt - # serialized-data-interface -serialized-data-interface==0.6.0 - # via -r ./requirements.txt + # via serialized-data-interface +serialized-data-interface==0.7.0 + # via -r ./requirements.in tomli==2.0.1 # via pytest -urllib3==2.0.3 - # via - # -r ./requirements.txt - # requests -websocket-client==1.6.0 - # via - # -r ./requirements.txt - # ops -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/charms/kfp-ui/requirements.in b/charms/kfp-ui/requirements.in index ef3c7451..8cf0f9b1 100644 --- a/charms/kfp-ui/requirements.in +++ b/charms/kfp-ui/requirements.in @@ -1,6 +1,3 @@ -# Workaround for https://github.com/python-jsonschema/jsonschema/issues/1117 -# and https://github.com/python-jsonschema/jsonschema/issues/1114 -jsonschema<4.18 ops oci-image -serialized-data-interface<0.7 +serialized-data-interface diff --git a/charms/kfp-ui/requirements.txt b/charms/kfp-ui/requirements.txt index 6bb6f130..be26a022 100644 --- a/charms/kfp-ui/requirements.txt +++ b/charms/kfp-ui/requirements.txt @@ -2,11 +2,11 @@ # This file is autogenerated by pip-compile with Python 3.8 # by the following command: # -# pip-compile --resolver=backtracking requirements.in +# pip-compile ./requirements.in # attrs==23.1.0 # via jsonschema -certifi==2023.5.7 +certifi==2023.7.22 # via requests charset-normalizer==3.2.0 # via requests @@ -15,14 +15,12 @@ idna==3.4 importlib-resources==6.0.0 # via jsonschema jsonschema==4.17.3 - # via - # -r requirements.in - # serialized-data-interface + # via serialized-data-interface oci-image==1.0.0 - # via -r requirements.in + # via -r ./requirements.in ops==2.4.1 # via - # -r requirements.in + # -r ./requirements.in # serialized-data-interface pkgutil-resolve-name==1.3.10 # via jsonschema @@ -34,9 +32,9 @@ pyyaml==6.0.1 # serialized-data-interface requests==2.31.0 # via serialized-data-interface -serialized-data-interface==0.6.0 - # via -r requirements.in -urllib3==2.0.3 +serialized-data-interface==0.7.0 + # via -r ./requirements.in +urllib3==2.0.4 # via requests websocket-client==1.6.1 # via ops diff --git a/charms/kfp-viewer/requirements-fmt.txt b/charms/kfp-viewer/requirements-fmt.txt index 2faae2da..090e6eb0 100644 --- a/charms/kfp-viewer/requirements-fmt.txt +++ b/charms/kfp-viewer/requirements-fmt.txt @@ -2,11 +2,11 @@ # 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==23.3.0 +black==23.7.0 # via -r ./requirements-fmt.in -click==8.1.3 +click==8.1.6 # via black isort==5.12.0 # via -r ./requirements-fmt.in @@ -14,11 +14,11 @@ mypy-extensions==1.0.0 # via black packaging==23.1 # via black -pathspec==0.11.1 +pathspec==0.11.2 # via black -platformdirs==3.7.0 +platformdirs==3.10.0 # via black tomli==2.0.1 # via black -typing-extensions==4.6.3 +typing-extensions==4.7.1 # via black diff --git a/charms/kfp-viewer/requirements-integration.in b/charms/kfp-viewer/requirements-integration.in index 5cea1296..e6f021b9 100644 --- a/charms/kfp-viewer/requirements-integration.in +++ b/charms/kfp-viewer/requirements-integration.in @@ -5,4 +5,3 @@ pytest-operator selenium selenium-wire tenacity --r requirements.txt diff --git a/charms/kfp-viewer/requirements-integration.txt b/charms/kfp-viewer/requirements-integration.txt index c9b1a7c1..1c89298a 100644 --- a/charms/kfp-viewer/requirements-integration.txt +++ b/charms/kfp-viewer/requirements-integration.txt @@ -2,12 +2,10 @@ # This file is autogenerated by pip-compile with Python 3.8 # by the following command: # -# pip-compile --resolver=backtracking ./requirements-integration.in +# pip-compile ./requirements-integration.in # asttokens==2.2.1 # via stack-data -async-generator==1.10 - # via trio attrs==23.1.0 # via # outcome @@ -22,7 +20,7 @@ brotli==1.0.9 # via selenium-wire cachetools==5.3.1 # via google-auth -certifi==2023.5.7 +certifi==2023.7.22 # via # kubernetes # requests @@ -32,9 +30,9 @@ cffi==1.15.1 # via # cryptography # pynacl -charset-normalizer==3.1.0 +charset-normalizer==3.2.0 # via requests -cryptography==41.0.1 +cryptography==41.0.2 # via # paramiko # pyopenssl @@ -42,7 +40,7 @@ decorator==5.1.1 # via # ipdb # ipython -exceptiongroup==1.1.1 +exceptiongroup==1.1.2 # via # pytest # trio @@ -71,11 +69,11 @@ ipdb==0.13.13 # via pytest-operator ipython==8.12.2 # via ipdb -jedi==0.18.2 +jedi==0.19.0 # via ipython jinja2==3.1.2 # via pytest-operator -juju==2.9.42.4 +juju==2.9.44.0 # via # -r ./requirements-integration.in # pytest-operator @@ -83,7 +81,7 @@ jujubundlelib==0.5.7 # via theblues kaitaistruct==0.10 # via selenium-wire -kubernetes==26.1.0 +kubernetes==27.2.0 # via juju macaroonbakery==1.3.1 # via @@ -96,11 +94,9 @@ matplotlib-inline==0.1.6 mypy-extensions==1.0.0 # via typing-inspect oauthlib==3.2.2 - # via requests-oauthlib -oci-image==1.0.0 - # via -r ./requirements.txt -ops==2.3.0 - # via -r ./requirements.txt + # via + # kubernetes + # requests-oauthlib outcome==1.2.0 # via trio packaging==23.1 @@ -115,7 +111,7 @@ pickleshare==0.7.5 # via ipython pluggy==1.2.0 # via pytest -prompt-toolkit==3.0.38 +prompt-toolkit==3.0.39 # via ipython protobuf==3.20.3 # via macaroonbakery @@ -144,7 +140,7 @@ pynacl==1.5.0 # pymacaroons pyopenssl==23.2.0 # via selenium-wire -pyparsing==3.1.0 +pyparsing==3.1.1 # via selenium-wire pyrfc3339==1.1 # via @@ -154,11 +150,11 @@ pysocks==1.7.1 # via # selenium-wire # urllib3 -pytest==7.3.2 +pytest==7.4.0 # via # pytest-asyncio # pytest-operator -pytest-asyncio==0.21.0 +pytest-asyncio==0.21.1 # via pytest-operator pytest-operator==0.28.0 # via -r ./requirements-integration.in @@ -166,13 +162,11 @@ python-dateutil==2.8.2 # via kubernetes pytz==2023.3 # via pyrfc3339 -pyyaml==6.0 +pyyaml==6.0.1 # via - # -r ./requirements.txt # juju # jujubundlelib # kubernetes - # ops # pytest-operator requests==2.31.0 # via @@ -219,30 +213,27 @@ traitlets==5.9.0 # via # ipython # matplotlib-inline -trio==0.22.0 +trio==0.22.2 # via # selenium # trio-websocket trio-websocket==0.10.3 # via selenium -typing-extensions==4.6.3 +typing-extensions==4.7.1 # via # ipython # typing-inspect typing-inspect==0.9.0 # via juju -urllib3[socks]==2.0.3 +urllib3[socks]==2.0.4 # via # kubernetes # requests # selenium wcwidth==0.2.6 # via prompt-toolkit -websocket-client==1.6.0 - # via - # -r ./requirements.txt - # kubernetes - # ops +websocket-client==1.6.1 + # via kubernetes websockets==7.0 # via juju wsproto==1.2.0 @@ -251,6 +242,3 @@ wsproto==1.2.0 # trio-websocket zstandard==0.21.0 # via selenium-wire - -# The following packages are considered to be unsafe in a requirements file: -# setuptools diff --git a/charms/kfp-viewer/requirements-lint.in b/charms/kfp-viewer/requirements-lint.in index 87f005ea..07a4a51c 100644 --- a/charms/kfp-viewer/requirements-lint.in +++ b/charms/kfp-viewer/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/charms/kfp-viewer/requirements-lint.txt b/charms/kfp-viewer/requirements-lint.txt index 453d41c4..890bea02 100644 --- a/charms/kfp-viewer/requirements-lint.txt +++ b/charms/kfp-viewer/requirements-lint.txt @@ -2,63 +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==23.3.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 + # via -r ./requirements-lint.in isort==5.12.0 - # via -r requirements-fmt.txt + # via -r ./requirements-lint.in mccabe==0.7.0 # via flake8 mypy-extensions==1.0.0 - # via - # -r requirements-fmt.txt - # black + # via black packaging==23.1 - # via - # -r requirements-fmt.txt - # black -pathspec==0.11.1 - # via - # -r requirements-fmt.txt - # black + # via black +pathspec==0.11.2 + # via black pep8-naming==0.13.3 - # via -r requirements-lint.in -platformdirs==3.7.0 - # via - # -r requirements-fmt.txt - # black + # via -r ./requirements-lint.in +platformdirs==3.10.0 + # 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.6.3 - # 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/charms/kfp-viewer/requirements-unit.in b/charms/kfp-viewer/requirements-unit.in index fbce543f..1c170d0a 100644 --- a/charms/kfp-viewer/requirements-unit.in +++ b/charms/kfp-viewer/requirements-unit.in @@ -1,5 +1,23 @@ +# 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. coverage +oci-image +ops pytest pytest-mock pytest-lazy-fixture --r requirements.txt +pyyaml +-r requirements.in diff --git a/charms/kfp-viewer/requirements-unit.txt b/charms/kfp-viewer/requirements-unit.txt index 330586d2..c4fed205 100644 --- a/charms/kfp-viewer/requirements-unit.txt +++ b/charms/kfp-viewer/requirements-unit.txt @@ -2,23 +2,37 @@ # This file is autogenerated by pip-compile with Python 3.8 # by the following command: # -# pip-compile --resolver=backtracking ./requirements-unit.in +# pip-compile ./requirements-unit.in # +attrs==23.1.0 + # via jsonschema coverage==7.2.7 # via -r ./requirements-unit.in -exceptiongroup==1.1.1 +exceptiongroup==1.1.2 # via pytest +importlib-resources==6.0.0 + # via jsonschema iniconfig==2.0.0 # via pytest +jsonschema==4.17.3 + # via -r ./requirements.in oci-image==1.0.0 - # via -r ./requirements.txt -ops==2.3.0 - # via -r ./requirements.txt + # via + # -r ./requirements-unit.in + # -r ./requirements.in +ops==2.4.1 + # via + # -r ./requirements-unit.in + # -r ./requirements.in packaging==23.1 # via pytest +pkgutil-resolve-name==1.3.10 + # via jsonschema pluggy==1.2.0 # via pytest -pytest==7.3.2 +pyrsistent==0.19.3 + # via jsonschema +pytest==7.4.0 # via # -r ./requirements-unit.in # pytest-lazy-fixture @@ -27,13 +41,13 @@ pytest-lazy-fixture==0.6.3 # via -r ./requirements-unit.in 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 # ops tomli==2.0.1 # via pytest -websocket-client==1.6.0 - # via - # -r ./requirements.txt - # ops +websocket-client==1.6.1 + # via ops +zipp==3.16.2 + # via importlib-resources diff --git a/charms/kfp-viewer/requirements.txt b/charms/kfp-viewer/requirements.txt index 3e692755..4f0a87fa 100644 --- a/charms/kfp-viewer/requirements.txt +++ b/charms/kfp-viewer/requirements.txt @@ -2,18 +2,18 @@ # This file is autogenerated by pip-compile with Python 3.8 # by the following command: # -# pip-compile --resolver=backtracking requirements.in +# pip-compile ./requirements.in # attrs==23.1.0 # via jsonschema importlib-resources==6.0.0 # via jsonschema jsonschema==4.17.3 - # via -r requirements.in + # via -r ./requirements.in oci-image==1.0.0 - # via -r requirements.in + # via -r ./requirements.in ops==2.4.1 - # via -r requirements.in + # via -r ./requirements.in pkgutil-resolve-name==1.3.10 # via jsonschema pyrsistent==0.19.3 diff --git a/charms/kfp-viz/requirements-fmt.txt b/charms/kfp-viz/requirements-fmt.txt index 2faae2da..090e6eb0 100644 --- a/charms/kfp-viz/requirements-fmt.txt +++ b/charms/kfp-viz/requirements-fmt.txt @@ -2,11 +2,11 @@ # 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==23.3.0 +black==23.7.0 # via -r ./requirements-fmt.in -click==8.1.3 +click==8.1.6 # via black isort==5.12.0 # via -r ./requirements-fmt.in @@ -14,11 +14,11 @@ mypy-extensions==1.0.0 # via black packaging==23.1 # via black -pathspec==0.11.1 +pathspec==0.11.2 # via black -platformdirs==3.7.0 +platformdirs==3.10.0 # via black tomli==2.0.1 # via black -typing-extensions==4.6.3 +typing-extensions==4.7.1 # via black diff --git a/charms/kfp-viz/requirements-integration.in b/charms/kfp-viz/requirements-integration.in index 5cea1296..e6f021b9 100644 --- a/charms/kfp-viz/requirements-integration.in +++ b/charms/kfp-viz/requirements-integration.in @@ -5,4 +5,3 @@ pytest-operator selenium selenium-wire tenacity --r requirements.txt diff --git a/charms/kfp-viz/requirements-integration.txt b/charms/kfp-viz/requirements-integration.txt index c48f4de1..1c89298a 100644 --- a/charms/kfp-viz/requirements-integration.txt +++ b/charms/kfp-viz/requirements-integration.txt @@ -2,16 +2,12 @@ # This file is autogenerated by pip-compile with Python 3.8 # by the following command: # -# pip-compile --resolver=backtracking ./requirements-integration.in +# pip-compile ./requirements-integration.in # asttokens==2.2.1 # via stack-data -async-generator==1.10 - # via trio attrs==23.1.0 # via - # -r ./requirements.txt - # jsonschema # outcome # trio backcall==0.2.0 @@ -24,9 +20,8 @@ brotli==1.0.9 # via selenium-wire cachetools==5.3.1 # via google-auth -certifi==2023.5.7 +certifi==2023.7.22 # via - # -r ./requirements.txt # kubernetes # requests # selenium @@ -35,11 +30,9 @@ cffi==1.15.1 # via # cryptography # pynacl -charset-normalizer==3.1.0 - # via - # -r ./requirements.txt - # requests -cryptography==41.0.1 +charset-normalizer==3.2.0 + # via requests +cryptography==41.0.2 # via # paramiko # pyopenssl @@ -47,7 +40,7 @@ decorator==5.1.1 # via # ipdb # ipython -exceptiongroup==1.1.1 +exceptiongroup==1.1.2 # via # pytest # trio @@ -68,28 +61,19 @@ hyperframe==6.0.1 # selenium-wire idna==3.4 # via - # -r ./requirements.txt # requests # trio -importlib-resources==5.12.0 - # via - # -r ./requirements.txt - # jsonschema iniconfig==2.0.0 # via pytest ipdb==0.13.13 # via pytest-operator ipython==8.12.2 # via ipdb -jedi==0.18.2 +jedi==0.19.0 # via ipython jinja2==3.1.2 # via pytest-operator -jsonschema==4.17.3 - # via - # -r ./requirements.txt - # serialized-data-interface -juju==2.9.42.4 +juju==2.9.44.0 # via # -r ./requirements-integration.in # pytest-operator @@ -97,7 +81,7 @@ jujubundlelib==0.5.7 # via theblues kaitaistruct==0.10 # via selenium-wire -kubernetes==26.1.0 +kubernetes==27.2.0 # via juju macaroonbakery==1.3.1 # via @@ -110,13 +94,9 @@ matplotlib-inline==0.1.6 mypy-extensions==1.0.0 # via typing-inspect oauthlib==3.2.2 - # via requests-oauthlib -oci-image==1.0.0 - # via -r ./requirements.txt -ops==2.3.0 # via - # -r ./requirements.txt - # serialized-data-interface + # kubernetes + # requests-oauthlib outcome==1.2.0 # via trio packaging==23.1 @@ -129,13 +109,9 @@ pexpect==4.8.0 # via ipython pickleshare==0.7.5 # via ipython -pkgutil-resolve-name==1.3.10 - # via - # -r ./requirements.txt - # 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 @@ -164,25 +140,21 @@ pynacl==1.5.0 # pymacaroons pyopenssl==23.2.0 # via selenium-wire -pyparsing==3.1.0 +pyparsing==3.1.1 # via selenium-wire pyrfc3339==1.1 # via # juju # macaroonbakery -pyrsistent==0.19.3 - # via - # -r ./requirements.txt - # jsonschema pysocks==1.7.1 # via # selenium-wire # urllib3 -pytest==7.3.2 +pytest==7.4.0 # via # pytest-asyncio # pytest-operator -pytest-asyncio==0.21.0 +pytest-asyncio==0.21.1 # via pytest-operator pytest-operator==0.28.0 # via -r ./requirements-integration.in @@ -190,22 +162,17 @@ python-dateutil==2.8.2 # via kubernetes pytz==2023.3 # via pyrfc3339 -pyyaml==6.0 +pyyaml==6.0.1 # via - # -r ./requirements.txt # juju # jujubundlelib # kubernetes - # ops # pytest-operator - # serialized-data-interface requests==2.31.0 # via - # -r ./requirements.txt # kubernetes # macaroonbakery # requests-oauthlib - # serialized-data-interface # theblues requests-oauthlib==1.3.1 # via kubernetes @@ -217,8 +184,6 @@ selenium==4.10.0 # selenium-wire selenium-wire==5.1.0 # via -r ./requirements-integration.in -serialized-data-interface==0.6.0 - # via -r ./requirements.txt six==1.16.0 # via # asttokens @@ -248,43 +213,32 @@ traitlets==5.9.0 # via # ipython # matplotlib-inline -trio==0.22.0 +trio==0.22.2 # via # selenium # trio-websocket trio-websocket==0.10.3 # via selenium -typing-extensions==4.6.3 +typing-extensions==4.7.1 # via # ipython # typing-inspect typing-inspect==0.9.0 # via juju -urllib3[socks]==2.0.3 +urllib3[socks]==2.0.4 # via - # -r ./requirements.txt # kubernetes # requests # selenium wcwidth==0.2.6 # via prompt-toolkit -websocket-client==1.6.0 - # via - # -r ./requirements.txt - # kubernetes - # ops +websocket-client==1.6.1 + # via kubernetes 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.21.0 # via selenium-wire - -# The following packages are considered to be unsafe in a requirements file: -# setuptools diff --git a/charms/kfp-viz/requirements-lint.in b/charms/kfp-viz/requirements-lint.in index 87f005ea..07a4a51c 100644 --- a/charms/kfp-viz/requirements-lint.in +++ b/charms/kfp-viz/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/charms/kfp-viz/requirements-lint.txt b/charms/kfp-viz/requirements-lint.txt index 453d41c4..890bea02 100644 --- a/charms/kfp-viz/requirements-lint.txt +++ b/charms/kfp-viz/requirements-lint.txt @@ -2,63 +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==23.3.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 + # via -r ./requirements-lint.in isort==5.12.0 - # via -r requirements-fmt.txt + # via -r ./requirements-lint.in mccabe==0.7.0 # via flake8 mypy-extensions==1.0.0 - # via - # -r requirements-fmt.txt - # black + # via black packaging==23.1 - # via - # -r requirements-fmt.txt - # black -pathspec==0.11.1 - # via - # -r requirements-fmt.txt - # black + # via black +pathspec==0.11.2 + # via black pep8-naming==0.13.3 - # via -r requirements-lint.in -platformdirs==3.7.0 - # via - # -r requirements-fmt.txt - # black + # via -r ./requirements-lint.in +platformdirs==3.10.0 + # 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.6.3 - # 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/charms/kfp-viz/requirements-unit.in b/charms/kfp-viz/requirements-unit.in index fbce543f..1c170d0a 100644 --- a/charms/kfp-viz/requirements-unit.in +++ b/charms/kfp-viz/requirements-unit.in @@ -1,5 +1,23 @@ +# 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. coverage +oci-image +ops pytest pytest-mock pytest-lazy-fixture --r requirements.txt +pyyaml +-r requirements.in diff --git a/charms/kfp-viz/requirements-unit.txt b/charms/kfp-viz/requirements-unit.txt index c9c5627f..b9bcf966 100644 --- a/charms/kfp-viz/requirements-unit.txt +++ b/charms/kfp-viz/requirements-unit.txt @@ -2,57 +2,44 @@ # This file is autogenerated by pip-compile with Python 3.8 # by the following command: # -# pip-compile --resolver=backtracking ./requirements-unit.in +# pip-compile ./requirements-unit.in # attrs==23.1.0 - # via - # -r ./requirements.txt - # jsonschema -certifi==2023.5.7 - # via - # -r ./requirements.txt - # requests -charset-normalizer==3.1.0 - # via - # -r ./requirements.txt - # requests + # via jsonschema +certifi==2023.7.22 + # via requests +charset-normalizer==3.2.0 + # via requests coverage==7.2.7 # via -r ./requirements-unit.in -exceptiongroup==1.1.1 +exceptiongroup==1.1.2 # via pytest idna==3.4 - # via - # -r ./requirements.txt - # requests -importlib-resources==5.12.0 - # via - # -r ./requirements.txt - # jsonschema + # via requests +importlib-resources==6.0.0 + # via jsonschema iniconfig==2.0.0 # via pytest jsonschema==4.17.3 - # via - # -r ./requirements.txt - # serialized-data-interface + # via serialized-data-interface oci-image==1.0.0 - # via -r ./requirements.txt -ops==2.3.0 # via - # -r ./requirements.txt + # -r ./requirements-unit.in + # -r ./requirements.in +ops==2.4.1 + # via + # -r ./requirements-unit.in + # -r ./requirements.in # serialized-data-interface packaging==23.1 # via pytest pkgutil-resolve-name==1.3.10 - # via - # -r ./requirements.txt - # jsonschema + # via jsonschema pluggy==1.2.0 # via pytest pyrsistent==0.19.3 - # via - # -r ./requirements.txt - # jsonschema -pytest==7.3.2 + # via jsonschema +pytest==7.4.0 # via # -r ./requirements-unit.in # pytest-lazy-fixture @@ -61,28 +48,20 @@ pytest-lazy-fixture==0.6.3 # via -r ./requirements-unit.in 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 # ops # serialized-data-interface requests==2.31.0 - # via - # -r ./requirements.txt - # serialized-data-interface -serialized-data-interface==0.6.0 - # via -r ./requirements.txt + # via serialized-data-interface +serialized-data-interface==0.7.0 + # via -r ./requirements.in tomli==2.0.1 # via pytest -urllib3==2.0.3 - # via - # -r ./requirements.txt - # requests -websocket-client==1.6.0 - # via - # -r ./requirements.txt - # ops -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/charms/kfp-viz/requirements.in b/charms/kfp-viz/requirements.in index 2a11e321..8cf0f9b1 100644 --- a/charms/kfp-viz/requirements.in +++ b/charms/kfp-viz/requirements.in @@ -1,6 +1,3 @@ -# Workaround for https://github.com/python-jsonschema/jsonschema/issues/1117 -# and https://github.com/python-jsonschema/jsonschema/issues/1114 -jsonschema<4.18 ops oci-image serialized-data-interface diff --git a/charms/kfp-viz/requirements.txt b/charms/kfp-viz/requirements.txt index 6bb6f130..be26a022 100644 --- a/charms/kfp-viz/requirements.txt +++ b/charms/kfp-viz/requirements.txt @@ -2,11 +2,11 @@ # This file is autogenerated by pip-compile with Python 3.8 # by the following command: # -# pip-compile --resolver=backtracking requirements.in +# pip-compile ./requirements.in # attrs==23.1.0 # via jsonschema -certifi==2023.5.7 +certifi==2023.7.22 # via requests charset-normalizer==3.2.0 # via requests @@ -15,14 +15,12 @@ idna==3.4 importlib-resources==6.0.0 # via jsonschema jsonschema==4.17.3 - # via - # -r requirements.in - # serialized-data-interface + # via serialized-data-interface oci-image==1.0.0 - # via -r requirements.in + # via -r ./requirements.in ops==2.4.1 # via - # -r requirements.in + # -r ./requirements.in # serialized-data-interface pkgutil-resolve-name==1.3.10 # via jsonschema @@ -34,9 +32,9 @@ pyyaml==6.0.1 # serialized-data-interface requests==2.31.0 # via serialized-data-interface -serialized-data-interface==0.6.0 - # via -r requirements.in -urllib3==2.0.3 +serialized-data-interface==0.7.0 + # via -r ./requirements.in +urllib3==2.0.4 # via requests websocket-client==1.6.1 # via ops diff --git a/requirements-integration.in b/requirements-integration.in index a1879092..83a5597b 100644 --- a/requirements-integration.in +++ b/requirements-integration.in @@ -4,13 +4,11 @@ aiohttp jsonschema<4.18 # Pinning to <3.0 to ensure compatibility with the 2.9 controller version # Note: 3.0 is not being maintained anymore -# FIXME: This is a workaround for https://github.com/juju/python-libjuju/issues/913 -# please pin to a released python-libjuju ASAP. -juju @ git+https://github.com/DnPlas/python-libjuju@dnplas-pyyaml-6 +juju<3.0 # Need this version of kfp to work with kfp 2.0.0-alpha.7 kfp==1.8.22 lightkube pytest -pyyaml pytest-operator +pyyaml tenacity diff --git a/requirements-integration.txt b/requirements-integration.txt index 4165d40f..a0d146e8 100644 --- a/requirements-integration.txt +++ b/requirements-integration.txt @@ -2,12 +2,12 @@ # This file is autogenerated by pip-compile with Python 3.8 # by the following command: # -# pip-compile --resolver=backtracking requirements-integration.in +# pip-compile ./requirements-integration.in # absl-py==1.4.0 # via kfp -aiohttp==3.8.4 - # via -r requirements-integration.in +aiohttp==3.8.5 + # via -r ./requirements-integration.in aiosignal==1.3.1 # via aiohttp anyio==3.7.1 @@ -26,7 +26,7 @@ bcrypt==4.0.1 # via paramiko cachetools==5.3.1 # via google-auth -certifi==2023.5.7 +certifi==2023.7.22 # via # httpcore # httpx @@ -41,7 +41,7 @@ charset-normalizer==3.2.0 # via # aiohttp # requests -click==8.1.5 +click==8.1.6 # via # kfp # typer @@ -122,22 +122,22 @@ ipdb==0.13.13 # via pytest-operator ipython==8.12.2 # via ipdb -jedi==0.18.2 +jedi==0.19.0 # via ipython jinja2==3.1.2 # via pytest-operator jsonschema==4.17.3 # via - # -r requirements-integration.in + # -r ./requirements-integration.in # kfp -juju @ git+https://github.com/DnPlas/python-libjuju@dnplas-pyyaml-6 +juju==2.9.44.0 # via - # -r requirements-integration.in + # -r ./requirements-integration.in # pytest-operator jujubundlelib==0.5.7 # via theblues kfp==1.8.22 - # via -r requirements-integration.in + # via -r ./requirements-integration.in kfp-pipeline-spec==0.1.16 # via kfp kfp-server-api==1.8.5 @@ -147,7 +147,7 @@ kubernetes==25.3.0 # juju # kfp lightkube==0.14.0 - # via -r requirements-integration.in + # via -r ./requirements-integration.in lightkube-models==1.27.1.4 # via lightkube macaroonbakery==1.3.1 @@ -202,7 +202,7 @@ pyasn1-modules==0.3.0 # via google-auth pycparser==2.21 # via cffi -pydantic==1.10.11 +pydantic==1.10.12 # via kfp pygments==2.15.1 # via ipython @@ -213,7 +213,7 @@ pynacl==1.5.0 # macaroonbakery # paramiko # pymacaroons -pyparsing==3.1.0 +pyparsing==3.1.1 # via httplib2 pyrfc3339==1.1 # via @@ -223,13 +223,13 @@ pyrsistent==0.19.3 # via jsonschema pytest==7.4.0 # via - # -r requirements-integration.in + # -r ./requirements-integration.in # pytest-asyncio # pytest-operator pytest-asyncio==0.21.1 # via pytest-operator pytest-operator==0.28.0 - # via -r requirements-integration.in + # via -r ./requirements-integration.in python-dateutil==2.8.2 # via # kfp-server-api @@ -238,7 +238,7 @@ pytz==2023.3 # via pyrfc3339 pyyaml==6.0.1 # via - # -r requirements-integration.in + # -r ./requirements-integration.in # juju # jujubundlelib # kfp @@ -285,7 +285,7 @@ strip-hints==0.1.10 tabulate==0.9.0 # via kfp tenacity==8.2.2 - # via -r requirements-integration.in + # via -r ./requirements-integration.in termcolor==2.3.0 # via fire theblues==0.5.2 @@ -328,7 +328,7 @@ websocket-client==1.6.1 # via kubernetes websockets==7.0 # via juju -wheel==0.40.0 +wheel==0.41.0 # via strip-hints wrapt==1.15.0 # via deprecated From bd4ebc03accf66d83ee9d7c8ecc93fac0741e83e Mon Sep 17 00:00:00 2001 From: Daniela Plascencia Date: Mon, 31 Jul 2023 15:04:28 +0200 Subject: [PATCH 3/5] build: bump kfp-api libs (#275) --- .../data_platform_libs/v0/data_interfaces.py | 414 +++++++++++++++--- .../grafana_k8s/v0/grafana_dashboard.py | 118 +++-- .../v1/kubernetes_service_patch.py | 7 +- .../prometheus_k8s/v0/prometheus_scrape.py | 66 ++- 4 files changed, 463 insertions(+), 142 deletions(-) diff --git a/charms/kfp-api/lib/charms/data_platform_libs/v0/data_interfaces.py b/charms/kfp-api/lib/charms/data_platform_libs/v0/data_interfaces.py index e9152e1d..74db75db 100644 --- a/charms/kfp-api/lib/charms/data_platform_libs/v0/data_interfaces.py +++ b/charms/kfp-api/lib/charms/data_platform_libs/v0/data_interfaces.py @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -"""Library to manage the relation for the data-platform products. +r"""Library to manage the relation for the data-platform products. This library contains the Requires and Provides classes for handling the relation between an application and multiple managed application supported by the data-team: @@ -144,6 +144,19 @@ def _on_cluster2_database_created(self, event: DatabaseCreatedEvent) -> None: ``` +When it's needed to check whether a plugin (extension) is enabled on the PostgreSQL +charm, you can use the is_postgresql_plugin_enabled method. To use that, you need to +add the following dependency to your charmcraft.yaml file: + +```yaml + +parts: + charm: + charm-binary-python-packages: + - psycopg[binary] + +``` + ### Provider Charm Following an example of using the DatabaseRequestedEvent, in the context of the @@ -283,17 +296,17 @@ def _on_topic_requested(self, event: TopicRequestedEvent): from abc import ABC, abstractmethod from collections import namedtuple from datetime import datetime -from typing import List, Optional +from typing import List, Optional, Union from ops.charm import ( CharmBase, CharmEvents, RelationChangedEvent, + RelationCreatedEvent, RelationEvent, - RelationJoinedEvent, ) from ops.framework import EventSource, Object -from ops.model import Relation +from ops.model import Application, ModelError, Relation, Unit # The unique Charmhub library identifier, never change it LIBID = "6c3e6b6680d64e9c89e611d1a15f65be" @@ -303,7 +316,7 @@ def _on_topic_requested(self, event: TopicRequestedEvent): # Increment this PATCH version before using `charmcraft publish-lib` or reset # to 0 if you are raising the major API version -LIBPATCH = 9 +LIBPATCH = 16 PYDEPS = ["ops>=2.0.0"] @@ -318,7 +331,7 @@ def _on_topic_requested(self, event: TopicRequestedEvent): deleted - key that were deleted""" -def diff(event: RelationChangedEvent, bucket: str) -> Diff: +def diff(event: RelationChangedEvent, bucket: Union[Unit, Application]) -> Diff: """Retrieves the diff of the data in the relation changed databag. Args: @@ -332,9 +345,11 @@ def diff(event: RelationChangedEvent, bucket: str) -> Diff: # Retrieve the old data from the data key in the application relation databag. old_data = json.loads(event.relation.data[bucket].get("data", "{}")) # Retrieve the new data from the event relation databag. - new_data = { - key: value for key, value in event.relation.data[event.app].items() if key != "data" - } + new_data = ( + {key: value for key, value in event.relation.data[event.app].items() if key != "data"} + if event.app + else {} + ) # These are the keys that were added to the databag and triggered this event. added = new_data.keys() - old_data.keys() @@ -396,9 +411,11 @@ def fetch_relation_data(self) -> dict: """ data = {} for relation in self.relations: - data[relation.id] = { - key: value for key, value in relation.data[relation.app].items() if key != "data" - } + data[relation.id] = ( + {key: value for key, value in relation.data[relation.app].items() if key != "data"} + if relation.app + else {} + ) return data def _update_relation_data(self, relation_id: int, data: dict) -> None: @@ -413,8 +430,8 @@ def _update_relation_data(self, relation_id: int, data: dict) -> None: that should be updated in the relation. """ if self.local_unit.is_leader(): - relation = self.charm.model.get_relation(self.relation_name, relation_id) - relation.data[self.local_app].update(data) + if relation := self.charm.model.get_relation(self.relation_name, relation_id): + relation.data[self.local_app].update(data) @property def relations(self) -> List[Relation]: @@ -456,7 +473,7 @@ def set_tls_ca(self, relation_id: int, tls_ca: str) -> None: relation_id: the identifier for a particular relation. tls_ca: TLS certification authority. """ - self._update_relation_data(relation_id, {"tls_ca": tls_ca}) + self._update_relation_data(relation_id, {"tls-ca": tls_ca}) class DataRequires(Object, ABC): @@ -466,7 +483,7 @@ def __init__( self, charm, relation_name: str, - extra_user_roles: str = None, + extra_user_roles: Optional[str] = None, ): """Manager of base client relations.""" super().__init__(charm, relation_name) @@ -476,15 +493,15 @@ def __init__( self.local_unit = self.charm.unit self.relation_name = relation_name self.framework.observe( - self.charm.on[relation_name].relation_joined, self._on_relation_joined_event + self.charm.on[relation_name].relation_created, self._on_relation_created_event ) self.framework.observe( self.charm.on[relation_name].relation_changed, self._on_relation_changed_event ) @abstractmethod - def _on_relation_joined_event(self, event: RelationJoinedEvent) -> None: - """Event emitted when the application joins the relation.""" + def _on_relation_created_event(self, event: RelationCreatedEvent) -> None: + """Event emitted when the relation is created.""" raise NotImplementedError @abstractmethod @@ -504,9 +521,11 @@ def fetch_relation_data(self) -> dict: """ data = {} for relation in self.relations: - data[relation.id] = { - key: value for key, value in relation.data[relation.app].items() if key != "data" - } + data[relation.id] = ( + {key: value for key, value in relation.data[relation.app].items() if key != "data"} + if relation.app + else {} + ) return data def _update_relation_data(self, relation_id: int, data: dict) -> None: @@ -550,11 +569,14 @@ def _is_relation_active(relation: Relation): try: _ = repr(relation.data) return True - except RuntimeError: + except (RuntimeError, ModelError): return False @staticmethod - def _is_resource_created_for_relation(relation: Relation): + def _is_resource_created_for_relation(relation: Relation) -> bool: + if not relation.app: + return False + return ( "username" in relation.data[relation.app] and "password" in relation.data[relation.app] ) @@ -586,10 +608,7 @@ def is_resource_created(self, relation_id: Optional[int] = None) -> bool: else: return ( all( - [ - self._is_resource_created_for_relation(relation) - for relation in self.relations - ] + self._is_resource_created_for_relation(relation) for relation in self.relations ) if self.relations else False @@ -605,6 +624,9 @@ class ExtraRoleEvent(RelationEvent): @property def extra_user_roles(self) -> Optional[str]: """Returns the extra user roles that were requested.""" + if not self.relation.app: + return None + return self.relation.data[self.relation.app].get("extra-user-roles") @@ -614,21 +636,33 @@ class AuthenticationEvent(RelationEvent): @property def username(self) -> Optional[str]: """Returns the created username.""" + if not self.relation.app: + return None + return self.relation.data[self.relation.app].get("username") @property def password(self) -> Optional[str]: """Returns the password for the created user.""" + if not self.relation.app: + return None + return self.relation.data[self.relation.app].get("password") @property def tls(self) -> Optional[str]: """Returns whether TLS is configured.""" + if not self.relation.app: + return None + return self.relation.data[self.relation.app].get("tls") @property def tls_ca(self) -> Optional[str]: """Returns TLS CA.""" + if not self.relation.app: + return None + return self.relation.data[self.relation.app].get("tls-ca") @@ -641,6 +675,9 @@ class DatabaseProvidesEvent(RelationEvent): @property def database(self) -> Optional[str]: """Returns the database that was requested.""" + if not self.relation.app: + return None + return self.relation.data[self.relation.app].get("database") @@ -663,16 +700,33 @@ class DatabaseRequiresEvent(RelationEvent): @property def database(self) -> Optional[str]: """Returns the database name.""" + if not self.relation.app: + return None + return self.relation.data[self.relation.app].get("database") @property def endpoints(self) -> Optional[str]: - """Returns a comma separated list of read/write endpoints.""" + """Returns a comma separated list of read/write endpoints. + + In VM charms, this is the primary's address. + In kubernetes charms, this is the service to the primary pod. + """ + if not self.relation.app: + return None + return self.relation.data[self.relation.app].get("endpoints") @property def read_only_endpoints(self) -> Optional[str]: - """Returns a comma separated list of read only endpoints.""" + """Returns a comma separated list of read only endpoints. + + In VM charms, this is the address of all the secondary instances. + In kubernetes charms, this is the service to all replica pod instances. + """ + if not self.relation.app: + return None + return self.relation.data[self.relation.app].get("read-only-endpoints") @property @@ -681,6 +735,9 @@ def replset(self) -> Optional[str]: MongoDB only. """ + if not self.relation.app: + return None + return self.relation.data[self.relation.app].get("replset") @property @@ -689,6 +746,9 @@ def uris(self) -> Optional[str]: MongoDB, Redis, OpenSearch. """ + if not self.relation.app: + return None + return self.relation.data[self.relation.app].get("uris") @property @@ -697,6 +757,9 @@ def version(self) -> Optional[str]: Version as informed by the database daemon. """ + if not self.relation.app: + return None + return self.relation.data[self.relation.app].get("version") @@ -729,7 +792,7 @@ class DatabaseRequiresEvents(CharmEvents): class DatabaseProvides(DataProvides): """Provider-side of the database relations.""" - on = DatabaseProvidesEvents() + on = DatabaseProvidesEvents() # pyright: ignore [reportGeneralTypeIssues] def __init__(self, charm: CharmBase, relation_name: str) -> None: super().__init__(charm, relation_name) @@ -746,7 +809,9 @@ def _on_relation_changed(self, event: RelationChangedEvent) -> None: # Emit a database requested event if the setup key (database name and optional # extra user roles) was added to the relation databag by the application. if "database" in diff.added: - self.on.database_requested.emit(event.relation, app=event.app, unit=event.unit) + getattr(self.on, "database_requested").emit( + event.relation, app=event.app, unit=event.unit + ) def set_database(self, relation_id: int, database_name: str) -> None: """Set database name. @@ -766,6 +831,10 @@ def set_endpoints(self, relation_id: int, connection_strings: str) -> None: This function writes in the application data bag, therefore, only the leader unit can call it. + In VM charms, only the primary's address should be passed as an endpoint. + In kubernetes charms, the service endpoint to the primary pod should be + passed as an endpoint. + Args: relation_id: the identifier for a particular relation. connection_strings: database hosts and ports comma separated list. @@ -819,15 +888,15 @@ def set_version(self, relation_id: int, version: str) -> None: class DatabaseRequires(DataRequires): """Requires-side of the database relation.""" - on = DatabaseRequiresEvents() + on = DatabaseRequiresEvents() # pyright: ignore [reportGeneralTypeIssues] def __init__( self, charm, relation_name: str, database_name: str, - extra_user_roles: str = None, - relations_aliases: List[str] = None, + extra_user_roles: Optional[str] = None, + relations_aliases: Optional[List[str]] = None, ): """Manager of database client relations.""" super().__init__(charm, relation_name, extra_user_roles) @@ -915,8 +984,52 @@ def _get_relation_alias(self, relation_id: int) -> Optional[str]: return relation.data[self.local_unit].get("alias") return None - def _on_relation_joined_event(self, event: RelationJoinedEvent) -> None: - """Event emitted when the application joins the database relation.""" + def is_postgresql_plugin_enabled(self, plugin: str, relation_index: int = 0) -> bool: + """Returns whether a plugin is enabled in the database. + + Args: + plugin: name of the plugin to check. + relation_index: optional relation index to check the database + (default: 0 - first relation). + + PostgreSQL only. + """ + # Psycopg 3 is imported locally to avoid the need of its package installation + # when relating to a database charm other than PostgreSQL. + import psycopg + + # Return False if no relation is established. + if len(self.relations) == 0: + return False + + relation_data = self.fetch_relation_data()[self.relations[relation_index].id] + host = relation_data.get("endpoints") + + # Return False if there is no endpoint available. + if host is None: + return False + + host = host.split(":")[0] + user = relation_data.get("username") + password = relation_data.get("password") + connection_string = ( + f"host='{host}' dbname='{self.database}' user='{user}' password='{password}'" + ) + try: + with psycopg.connect(connection_string) as connection: + with connection.cursor() as cursor: + cursor.execute( + "SELECT TRUE FROM pg_extension WHERE extname=%s::text;", (plugin,) + ) + return cursor.fetchone() is not None + except psycopg.Error as e: + logger.exception( + f"failed to check whether {plugin} plugin is enabled in the database: %s", str(e) + ) + return False + + def _on_relation_created_event(self, event: RelationCreatedEvent) -> None: + """Event emitted when the database relation is created.""" # If relations aliases were provided, assign one to the relation. self._assign_relation_alias(event.relation.id) @@ -943,7 +1056,9 @@ def _on_relation_changed_event(self, event: RelationChangedEvent) -> None: if "username" in diff.added and "password" in diff.added: # Emit the default event (the one without an alias). logger.info("database created at %s", datetime.now()) - self.on.database_created.emit(event.relation, app=event.app, unit=event.unit) + getattr(self.on, "database_created").emit( + event.relation, app=event.app, unit=event.unit + ) # Emit the aliased event (if any). self._emit_aliased_event(event, "database_created") @@ -957,7 +1072,9 @@ def _on_relation_changed_event(self, event: RelationChangedEvent) -> None: if "endpoints" in diff.added or "endpoints" in diff.changed: # Emit the default event (the one without an alias). logger.info("endpoints changed on %s", datetime.now()) - self.on.endpoints_changed.emit(event.relation, app=event.app, unit=event.unit) + getattr(self.on, "endpoints_changed").emit( + event.relation, app=event.app, unit=event.unit + ) # Emit the aliased event (if any). self._emit_aliased_event(event, "endpoints_changed") @@ -971,7 +1088,7 @@ def _on_relation_changed_event(self, event: RelationChangedEvent) -> None: if "read-only-endpoints" in diff.added or "read-only-endpoints" in diff.changed: # Emit the default event (the one without an alias). logger.info("read-only-endpoints changed on %s", datetime.now()) - self.on.read_only_endpoints_changed.emit( + getattr(self.on, "read_only_endpoints_changed").emit( event.relation, app=event.app, unit=event.unit ) @@ -988,11 +1105,17 @@ class KafkaProvidesEvent(RelationEvent): @property def topic(self) -> Optional[str]: """Returns the topic that was requested.""" + if not self.relation.app: + return None + return self.relation.data[self.relation.app].get("topic") @property def consumer_group_prefix(self) -> Optional[str]: """Returns the consumer-group-prefix that was requested.""" + if not self.relation.app: + return None + return self.relation.data[self.relation.app].get("consumer-group-prefix") @@ -1015,21 +1138,33 @@ class KafkaRequiresEvent(RelationEvent): @property def topic(self) -> Optional[str]: """Returns the topic.""" + if not self.relation.app: + return None + return self.relation.data[self.relation.app].get("topic") @property def bootstrap_server(self) -> Optional[str]: - """Returns a a comma-seperated list of broker uris.""" + """Returns a comma-separated list of broker uris.""" + if not self.relation.app: + return None + return self.relation.data[self.relation.app].get("endpoints") @property def consumer_group_prefix(self) -> Optional[str]: """Returns the consumer-group-prefix.""" + if not self.relation.app: + return None + return self.relation.data[self.relation.app].get("consumer-group-prefix") @property def zookeeper_uris(self) -> Optional[str]: """Returns a comma separated list of Zookeeper uris.""" + if not self.relation.app: + return None + return self.relation.data[self.relation.app].get("zookeeper-uris") @@ -1057,7 +1192,7 @@ class KafkaRequiresEvents(CharmEvents): class KafkaProvides(DataProvides): """Provider-side of the Kafka relation.""" - on = KafkaProvidesEvents() + on = KafkaProvidesEvents() # pyright: ignore [reportGeneralTypeIssues] def __init__(self, charm: CharmBase, relation_name: str) -> None: super().__init__(charm, relation_name) @@ -1074,7 +1209,9 @@ def _on_relation_changed(self, event: RelationChangedEvent) -> None: # Emit a topic requested event if the setup key (topic name and optional # extra user roles) was added to the relation databag by the application. if "topic" in diff.added: - self.on.topic_requested.emit(event.relation, app=event.app, unit=event.unit) + getattr(self.on, "topic_requested").emit( + event.relation, app=event.app, unit=event.unit + ) def set_topic(self, relation_id: int, topic: str) -> None: """Set topic name in the application relation databag. @@ -1108,7 +1245,7 @@ def set_zookeeper_uris(self, relation_id: int, zookeeper_uris: str) -> None: Args: relation_id: the identifier for a particular relation. - zookeeper_uris: comma-seperated list of ZooKeeper server uris. + zookeeper_uris: comma-separated list of ZooKeeper server uris. """ self._update_relation_data(relation_id, {"zookeeper-uris": zookeeper_uris}) @@ -1116,7 +1253,7 @@ def set_zookeeper_uris(self, relation_id: int, zookeeper_uris: str) -> None: class KafkaRequires(DataRequires): """Requires-side of the Kafka relation.""" - on = KafkaRequiresEvents() + on = KafkaRequiresEvents() # pyright: ignore [reportGeneralTypeIssues] def __init__( self, @@ -1133,8 +1270,20 @@ def __init__( self.topic = topic self.consumer_group_prefix = consumer_group_prefix or "" - def _on_relation_joined_event(self, event: RelationJoinedEvent) -> None: - """Event emitted when the application joins the Kafka relation.""" + @property + def topic(self): + """Topic to use in Kafka.""" + return self._topic + + @topic.setter + def topic(self, value): + # Avoid wildcards + if value == "*": + raise ValueError(f"Error on topic '{value}', cannot be a wildcard.") + self._topic = value + + def _on_relation_created_event(self, event: RelationCreatedEvent) -> None: + """Event emitted when the Kafka relation is created.""" # Sets topic, extra user roles, and "consumer-group-prefix" in the relation relation_data = { f: getattr(self, f.replace("-", "_"), "") @@ -1153,18 +1302,183 @@ def _on_relation_changed_event(self, event: RelationChangedEvent) -> None: if "username" in diff.added and "password" in diff.added: # Emit the default event (the one without an alias). logger.info("topic created at %s", datetime.now()) - self.on.topic_created.emit(event.relation, app=event.app, unit=event.unit) + getattr(self.on, "topic_created").emit(event.relation, app=event.app, unit=event.unit) # To avoid unnecessary application restarts do not trigger # “endpoints_changed“ event if “topic_created“ is triggered. return - # Emit an endpoints (bootstap-server) changed event if the Kafka endpoints + # Emit an endpoints (bootstrap-server) changed event if the Kafka endpoints # added or changed this info in the relation databag. if "endpoints" in diff.added or "endpoints" in diff.changed: # Emit the default event (the one without an alias). logger.info("endpoints changed on %s", datetime.now()) - self.on.bootstrap_server_changed.emit( + getattr(self.on, "bootstrap_server_changed").emit( + event.relation, app=event.app, unit=event.unit + ) # here check if this is the right design + return + + +# Opensearch related events + + +class OpenSearchProvidesEvent(RelationEvent): + """Base class for OpenSearch events.""" + + @property + def index(self) -> Optional[str]: + """Returns the index that was requested.""" + if not self.relation.app: + return None + + return self.relation.data[self.relation.app].get("index") + + +class IndexRequestedEvent(OpenSearchProvidesEvent, ExtraRoleEvent): + """Event emitted when a new index is requested for use on this relation.""" + + +class OpenSearchProvidesEvents(CharmEvents): + """OpenSearch events. + + This class defines the events that OpenSearch can emit. + """ + + index_requested = EventSource(IndexRequestedEvent) + + +class OpenSearchRequiresEvent(DatabaseRequiresEvent): + """Base class for OpenSearch requirer events.""" + + +class IndexCreatedEvent(AuthenticationEvent, OpenSearchRequiresEvent): + """Event emitted when a new index is created for use on this relation.""" + + +class OpenSearchRequiresEvents(CharmEvents): + """OpenSearch events. + + This class defines the events that the opensearch requirer can emit. + """ + + index_created = EventSource(IndexCreatedEvent) + endpoints_changed = EventSource(DatabaseEndpointsChangedEvent) + authentication_updated = EventSource(AuthenticationEvent) + + +# OpenSearch Provides and Requires Objects + + +class OpenSearchProvides(DataProvides): + """Provider-side of the OpenSearch relation.""" + + on = OpenSearchProvidesEvents() # pyright: ignore[reportGeneralTypeIssues] + + def __init__(self, charm: CharmBase, relation_name: str) -> None: + super().__init__(charm, relation_name) + + def _on_relation_changed(self, event: RelationChangedEvent) -> None: + """Event emitted when the relation has changed.""" + # Only the leader should handle this event. + if not self.local_unit.is_leader(): + return + + # Check which data has changed to emit customs events. + diff = self._diff(event) + + # Emit an index requested event if the setup key (index name and optional extra user roles) + # have been added to the relation databag by the application. + if "index" in diff.added: + getattr(self.on, "index_requested").emit( + event.relation, app=event.app, unit=event.unit + ) + + def set_index(self, relation_id: int, index: str) -> None: + """Set the index in the application relation databag. + + Args: + relation_id: the identifier for a particular relation. + index: the index as it is _created_ on the provider charm. This needn't match the + requested index, and can be used to present a different index name if, for example, + the requested index is invalid. + """ + self._update_relation_data(relation_id, {"index": index}) + + def set_endpoints(self, relation_id: int, endpoints: str) -> None: + """Set the endpoints in the application relation databag. + + Args: + relation_id: the identifier for a particular relation. + endpoints: the endpoint addresses for opensearch nodes. + """ + self._update_relation_data(relation_id, {"endpoints": endpoints}) + + def set_version(self, relation_id: int, version: str) -> None: + """Set the opensearch version in the application relation databag. + + Args: + relation_id: the identifier for a particular relation. + version: database version. + """ + self._update_relation_data(relation_id, {"version": version}) + + +class OpenSearchRequires(DataRequires): + """Requires-side of the OpenSearch relation.""" + + on = OpenSearchRequiresEvents() # pyright: ignore[reportGeneralTypeIssues] + + def __init__( + self, charm, relation_name: str, index: str, extra_user_roles: Optional[str] = None + ): + """Manager of OpenSearch client relations.""" + super().__init__(charm, relation_name, extra_user_roles) + self.charm = charm + self.index = index + + def _on_relation_created_event(self, event: RelationCreatedEvent) -> None: + """Event emitted when the OpenSearch relation is created.""" + # Sets both index and extra user roles in the relation if the roles are provided. + # Otherwise, sets only the index. + data = {"index": self.index} + if self.extra_user_roles: + data["extra-user-roles"] = self.extra_user_roles + + self._update_relation_data(event.relation.id, data) + + def _on_relation_changed_event(self, event: RelationChangedEvent) -> None: + """Event emitted when the OpenSearch relation has changed. + + This event triggers individual custom events depending on the changing relation. + """ + # Check which data has changed to emit customs events. + diff = self._diff(event) + + # Check if authentication has updated, emit event if so + updates = {"username", "password", "tls", "tls-ca"} + if len(set(diff._asdict().keys()) - updates) < len(diff): + logger.info("authentication updated at: %s", datetime.now()) + getattr(self.on, "authentication_updated").emit( + event.relation, app=event.app, unit=event.unit + ) + + # Check if the index is created + # (the OpenSearch charm shares the credentials). + if "username" in diff.added and "password" in diff.added: + # Emit the default event (the one without an alias). + logger.info("index created at: %s", datetime.now()) + getattr(self.on, "index_created").emit(event.relation, app=event.app, unit=event.unit) + + # To avoid unnecessary application restarts do not trigger + # “endpoints_changed“ event if “index_created“ is triggered. + return + + # Emit a endpoints changed event if the OpenSearch application added or changed this info + # in the relation databag. + if "endpoints" in diff.added or "endpoints" in diff.changed: + # Emit the default event (the one without an alias). + logger.info("endpoints changed on %s", datetime.now()) + getattr(self.on, "endpoints_changed").emit( event.relation, app=event.app, unit=event.unit ) # here check if this is the right design return diff --git a/charms/kfp-api/lib/charms/grafana_k8s/v0/grafana_dashboard.py b/charms/kfp-api/lib/charms/grafana_k8s/v0/grafana_dashboard.py index fa7ed773..c20ab2b1 100644 --- a/charms/kfp-api/lib/charms/grafana_k8s/v0/grafana_dashboard.py +++ b/charms/kfp-api/lib/charms/grafana_k8s/v0/grafana_dashboard.py @@ -219,7 +219,7 @@ def __init__(self, *args): # Increment this PATCH version before using `charmcraft publish-lib` or reset # to 0 if you are raising the major API version -LIBPATCH = 28 +LIBPATCH = 32 logger = logging.getLogger(__name__) @@ -525,7 +525,7 @@ def _validate_relation_by_interface_and_direction( relation = charm.meta.relations[relation_name] actual_relation_interface = relation.interface_name - if actual_relation_interface != expected_relation_interface: + if actual_relation_interface and actual_relation_interface != expected_relation_interface: raise RelationInterfaceMismatchError( relation_name, expected_relation_interface, actual_relation_interface ) @@ -582,7 +582,7 @@ def _convert_dashboard_fields(content: str, inject_dropdowns: bool = True) -> st # If no existing template variables exist, just insert our own if "templating" not in dict_content: - dict_content["templating"] = {"list": [d for d in template_dropdowns]} # type: ignore + dict_content["templating"] = {"list": list(template_dropdowns)} # type: ignore else: # Otherwise, set a flag so we can go back later existing_templates = True @@ -830,18 +830,18 @@ def _modify_panel(panel: dict, topology: dict, transformer: "CosTool") -> dict: if "datasource" not in panel.keys(): continue - else: - if type(panel["datasource"]) == str: - if panel["datasource"] not in known_datasources: - continue - querytype = known_datasources[panel["datasource"]] - elif type(panel["datasource"]) == dict: - if panel["datasource"]["uid"] not in known_datasources: - continue - querytype = known_datasources[panel["datasource"]["uid"]] - else: - logger.error("Unknown datasource format: skipping") + + if type(panel["datasource"]) == str: + if panel["datasource"] not in known_datasources: + continue + querytype = known_datasources[panel["datasource"]] + elif type(panel["datasource"]) == dict: + if panel["datasource"]["uid"] not in known_datasources: continue + querytype = known_datasources[panel["datasource"]["uid"]] + else: + logger.error("Unknown datasource format: skipping") + continue # Capture all values inside `[]` into a list which we'll iterate over later to # put them back in-order. Then apply the regex again and replace everything with @@ -901,13 +901,12 @@ def _type_convert_stored(obj): """Convert Stored* to their appropriate types, recursively.""" if isinstance(obj, StoredList): return list(map(_type_convert_stored, obj)) - elif isinstance(obj, StoredDict): + if isinstance(obj, StoredDict): rdict = {} # type: Dict[Any, Any] for k in obj.keys(): rdict[k] = _type_convert_stored(obj[k]) return rdict - else: - return obj + return obj class GrafanaDashboardsChanged(EventBase): @@ -956,7 +955,7 @@ def restore(self, snapshot): """Restore grafana source information.""" self.error_message = snapshot["error_message"] self.valid = snapshot["valid"] - self.errors = json.loads(snapshot["errors"]) + self.errors = json.loads(str(snapshot["errors"])) class GrafanaProviderEvents(ObjectEvents): @@ -969,7 +968,7 @@ class GrafanaDashboardProvider(Object): """An API to provide Grafana dashboards to a Grafana charm.""" _stored = StoredState() - on = GrafanaProviderEvents() + on = GrafanaProviderEvents() # pyright: ignore def __init__( self, @@ -1073,7 +1072,7 @@ def add_dashboard(self, content: str, inject_dropdowns: bool = True) -> None: """ # Update of storage must be done irrespective of leadership, so # that the stored state is there when this unit becomes leader. - stored_dashboard_templates = self._stored.dashboard_templates # type: Any + stored_dashboard_templates: Any = self._stored.dashboard_templates # pyright: ignore encoded_dashboard = _encode_dashboard_content(content) @@ -1094,7 +1093,7 @@ def remove_non_builtin_dashboards(self) -> None: """Remove all dashboards to the relation added via :method:`add_dashboard`.""" # Update of storage must be done irrespective of leadership, so # that the stored state is there when this unit becomes leader. - stored_dashboard_templates = self._stored.dashboard_templates # type: Any + stored_dashboard_templates: Any = self._stored.dashboard_templates # pyright: ignore for dashboard_id in list(stored_dashboard_templates.keys()): if dashboard_id.startswith("prog:"): @@ -1121,7 +1120,7 @@ def _update_all_dashboards_from_dir( # Ensure we do not leave outdated dashboards by removing from stored all # the encoded dashboards that start with "file/". if self._dashboards_path: - stored_dashboard_templates = self._stored.dashboard_templates # type: Any + stored_dashboard_templates: Any = self._stored.dashboard_templates # pyright: ignore for dashboard_id in list(stored_dashboard_templates.keys()): if dashboard_id.startswith("file:"): @@ -1175,7 +1174,7 @@ def _reinitialize_dashboard_data(self, inject_dropdowns: bool = True) -> None: e.grafana_dashboards_absolute_path, e.message, ) - stored_dashboard_templates = self._stored.dashboard_templates # type: Any + stored_dashboard_templates: Any = self._stored.dashboard_templates # pyright: ignore for dashboard_id in list(stored_dashboard_templates.keys()): if dashboard_id.startswith("file:"): @@ -1213,16 +1212,18 @@ def _on_grafana_dashboard_relation_changed(self, event: RelationChangedEvent) -> valid = bool(data.get("valid", True)) errors = data.get("errors", []) if valid and not errors: - self.on.dashboard_status_changed.emit(valid=valid) + self.on.dashboard_status_changed.emit(valid=valid) # pyright: ignore else: - self.on.dashboard_status_changed.emit(valid=valid, errors=errors) + self.on.dashboard_status_changed.emit( # pyright: ignore + valid=valid, errors=errors + ) def _upset_dashboards_on_relation(self, relation: Relation) -> None: """Update the dashboards in the relation data bucket.""" # It's completely ridiculous to add a UUID, but if we don't have some # pseudo-random value, this never makes it across 'juju set-state' stored_data = { - "templates": _type_convert_stored(self._stored.dashboard_templates), + "templates": _type_convert_stored(self._stored.dashboard_templates), # pyright: ignore "uuid": str(uuid.uuid4()), } @@ -1251,13 +1252,13 @@ def _juju_topology(self) -> Dict: @property def dashboard_templates(self) -> List: """Return a list of the known dashboard templates.""" - return [v for v in self._stored.dashboard_templates.values()] # type: ignore + return list(self._stored.dashboard_templates.values()) # type: ignore class GrafanaDashboardConsumer(Object): """A consumer object for working with Grafana Dashboards.""" - on = GrafanaDashboardEvents() + on = GrafanaDashboardEvents() # pyright: ignore _stored = StoredState() def __init__( @@ -1305,7 +1306,7 @@ def __init__( self._relation_name = relation_name self._tranformer = CosTool(self._charm) - self._stored.set_default(dashboards=dict()) # type: ignore + self._stored.set_default(dashboards={}) # type: ignore self.framework.observe( self._charm.on[self._relation_name].relation_changed, @@ -1349,13 +1350,13 @@ def _on_grafana_dashboard_relation_changed(self, event: RelationChangedEvent) -> changes = self._render_dashboards_and_signal_changed(event.relation) if changes: - self.on.dashboards_changed.emit() + self.on.dashboards_changed.emit() # pyright: ignore def _on_grafana_peer_changed(self, _: RelationChangedEvent) -> None: """Emit dashboard events on peer events so secondary charm data updates.""" if self._charm.unit.is_leader(): return - self.on.dashboards_changed.emit() + self.on.dashboards_changed.emit() # pyright: ignore def update_dashboards(self, relation: Optional[Relation] = None) -> None: """Re-establish dashboards on one or more relations. @@ -1402,7 +1403,7 @@ def _render_dashboards_and_signal_changed(self, relation: Relation) -> bool: # """ other_app = relation.app - raw_data = relation.data[other_app].get("dashboards", {}) # type: ignore + raw_data = relation.data[other_app].get("dashboards", "") # pyright: ignore if not raw_data: logger.warning( @@ -1417,11 +1418,6 @@ def _render_dashboards_and_signal_changed(self, relation: Relation) -> bool: # # The only piece of data needed on this side of the relations is "templates" templates = data.pop("templates") - # Import only if a charmed operator uses the consumer, we don't impose these - # dependencies on the client - from jinja2 import Template - from jinja2.exceptions import TemplateSyntaxError - # The dashboards are WAY too big since this ultimately calls out to Juju to # set the relation data, and it overflows the maximum argument length for # subprocess, so we have to use b64, annoyingly. @@ -1434,14 +1430,12 @@ def _render_dashboards_and_signal_changed(self, relation: Relation) -> bool: # relation_has_invalid_dashboards = False for _, (fname, template) in enumerate(templates.items()): - decoded_content = None content = None error = None topology = template.get("juju_topology", {}) try: - decoded_content = _decode_dashboard_content(template["content"]) + content = _decode_dashboard_content(template["content"]) inject_dropdowns = template.get("inject_dropdowns", True) - content = Template(decoded_content).render() content = self._manage_dashboard_uid(content, template) content = _convert_dashboard_fields(content, inject_dropdowns) @@ -1456,9 +1450,6 @@ def _render_dashboards_and_signal_changed(self, relation: Relation) -> bool: # error = str(e.msg) logger.warning("Invalid JSON in Grafana dashboard: {}".format(fname)) continue - except TemplateSyntaxError as e: - error = str(e) - relation_has_invalid_dashboards = True # Prepend the relation name and ID to the dashboard ID to avoid clashes with # multiple relations with apps from the same charm, or having dashboards with @@ -1505,28 +1496,27 @@ def _render_dashboards_and_signal_changed(self, relation: Relation) -> bool: # # Dropping dashboards for a relation needs to be signalled return True - else: - stored_data = rendered_dashboards - currently_stored_data = self._get_stored_dashboards(relation.id) - coerced_data = ( - _type_convert_stored(currently_stored_data) if currently_stored_data else {} - ) + stored_data = rendered_dashboards + currently_stored_data = self._get_stored_dashboards(relation.id) + + coerced_data = _type_convert_stored(currently_stored_data) if currently_stored_data else {} - if not coerced_data == stored_data: - stored_dashboards = self.get_peer_data("dashboards") - stored_dashboards[relation.id] = stored_data - self.set_peer_data("dashboards", stored_dashboards) - return True + if not coerced_data == stored_data: + stored_dashboards = self.get_peer_data("dashboards") + stored_dashboards[relation.id] = stored_data + self.set_peer_data("dashboards", stored_dashboards) + return True + return None # type: ignore def _manage_dashboard_uid(self, dashboard: str, template: dict) -> str: """Add an uid to the dashboard if it is not present.""" - dashboard = json.loads(dashboard) + dashboard_dict = json.loads(dashboard) - if not dashboard.get("uid", None) and "dashboard_alt_uid" in template: - dashboard["uid"] = template["dashboard_alt_uid"] + if not dashboard_dict.get("uid", None) and "dashboard_alt_uid" in template: + dashboard_dict["uid"] = template["dashboard_alt_uid"] - return json.dumps(dashboard) + return json.dumps(dashboard_dict) def _remove_all_dashboards_for_relation(self, relation: Relation) -> None: """If an errored dashboard is in stored data, remove it and trigger a deletion.""" @@ -1534,7 +1524,7 @@ def _remove_all_dashboards_for_relation(self, relation: Relation) -> None: stored_dashboards = self.get_peer_data("dashboards") stored_dashboards.pop(str(relation.id)) self.set_peer_data("dashboards", stored_dashboards) - self.on.dashboards_changed.emit() + self.on.dashboards_changed.emit() # pyright: ignore def _to_external_object(self, relation_id, dashboard): return { @@ -1616,7 +1606,7 @@ class GrafanaDashboardAggregator(Object): """ _stored = StoredState() - on = GrafanaProviderEvents() + on = GrafanaProviderEvents() # pyright: ignore def __init__( self, @@ -1681,7 +1671,7 @@ def _update_remote_grafana(self, _: Optional[RelationEvent] = None) -> None: """Push dashboards to the downstream Grafana relation.""" # It's still ridiculous to add a UUID here, but needed stored_data = { - "templates": _type_convert_stored(self._stored.dashboard_templates), + "templates": _type_convert_stored(self._stored.dashboard_templates), # pyright: ignore "uuid": str(uuid.uuid4()), } @@ -1702,7 +1692,7 @@ def remove_dashboards(self, event: RelationBrokenEvent) -> None: del self._stored.dashboard_templates[id] # type: ignore stored_data = { - "templates": _type_convert_stored(self._stored.dashboard_templates), + "templates": _type_convert_stored(self._stored.dashboard_templates), # pyright: ignore "uuid": str(uuid.uuid4()), } @@ -1830,10 +1820,10 @@ def _handle_reactive_dashboards(self, event: RelationEvent) -> Optional[Dict]: # Replace old piechart panels dash = re.sub(r'"type": "grafana-piechart-panel"', '"type": "piechart"', dash) - from jinja2 import Template + from jinja2 import DebugUndefined, Template content = _encode_dashboard_content( - Template(dash).render(host=r"$host", datasource=r"${prometheusds}") # type: ignore + Template(dash, undefined=DebugUndefined).render(datasource=r"${prometheusds}") # type: ignore ) id = "prog:{}".format(content[-24:-16]) diff --git a/charms/kfp-api/lib/charms/observability_libs/v1/kubernetes_service_patch.py b/charms/kfp-api/lib/charms/observability_libs/v1/kubernetes_service_patch.py index 56cca01a..64dd13ce 100644 --- a/charms/kfp-api/lib/charms/observability_libs/v1/kubernetes_service_patch.py +++ b/charms/kfp-api/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 = 6 +LIBPATCH = 7 ServiceType = Literal["ClusterIP", "LoadBalancer"] @@ -310,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/charms/kfp-api/lib/charms/prometheus_k8s/v0/prometheus_scrape.py b/charms/kfp-api/lib/charms/prometheus_k8s/v0/prometheus_scrape.py index 13ae0c48..cac364e3 100644 --- a/charms/kfp-api/lib/charms/prometheus_k8s/v0/prometheus_scrape.py +++ b/charms/kfp-api/lib/charms/prometheus_k8s/v0/prometheus_scrape.py @@ -370,7 +370,7 @@ def _on_scrape_targets_changed(self, event): # Increment this PATCH version before using `charmcraft publish-lib` or reset # to 0 if you are raising the major API version -LIBPATCH = 34 +LIBPATCH = 38 logger = logging.getLogger(__name__) @@ -391,6 +391,7 @@ def _on_scrape_targets_changed(self, event): "scheme", "basic_auth", "tls_config", + "authorization", } DEFAULT_JOB = { "metrics_path": "/metrics", @@ -601,15 +602,22 @@ def render_alertmanager_static_configs(alertmanagers: List[str]): # Create a mapping from paths to netlocs # Group alertmanager targets into a dictionary of lists: # {path: [netloc1, netloc2]} - paths = defaultdict(list) # type: Dict[str, List[str]] + paths = defaultdict(list) # type: Dict[Tuple[str, str], List[str]] for parsed in map(urlparse, sanitized): path = parsed.path or "/" - paths[path].append(parsed.netloc) + paths[(parsed.scheme, path)].append(parsed.netloc) return { "alertmanagers": [ - {"path_prefix": path_prefix, "static_configs": [{"targets": netlocs}]} - for path_prefix, netlocs in paths.items() + { + "scheme": scheme, + "path_prefix": path_prefix, + "static_configs": [{"targets": netlocs}], + # FIXME figure out how to get alertmanager's ca_file into here + # Without this, prom errors: "x509: certificate signed by unknown authority" + "tls_config": {"insecure_skip_verify": True}, + } + for (scheme, path_prefix), netlocs in paths.items() ] } @@ -715,13 +723,12 @@ def _type_convert_stored(obj): """Convert Stored* to their appropriate types, recursively.""" if isinstance(obj, StoredList): return list(map(_type_convert_stored, obj)) - elif isinstance(obj, StoredDict): + if isinstance(obj, StoredDict): rdict = {} # type: Dict[Any, Any] for k in obj.keys(): rdict[k] = _type_convert_stored(obj[k]) return rdict - else: - return obj + return obj def _validate_relation_by_interface_and_direction( @@ -1353,29 +1360,39 @@ def _static_scrape_config(self, relation) -> list: if not relation.units: return [] - scrape_jobs = json.loads(relation.data[relation.app].get("scrape_jobs", "[]")) + scrape_configs = json.loads(relation.data[relation.app].get("scrape_jobs", "[]")) - if not scrape_jobs: + if not scrape_configs: return [] scrape_metadata = json.loads(relation.data[relation.app].get("scrape_metadata", "{}")) if not scrape_metadata: - return scrape_jobs + return scrape_configs topology = JujuTopology.from_dict(scrape_metadata) job_name_prefix = "juju_{}_prometheus_scrape".format(topology.identifier) - scrape_jobs = PrometheusConfig.prefix_job_names(scrape_jobs, job_name_prefix) - scrape_jobs = PrometheusConfig.sanitize_scrape_configs(scrape_jobs) + scrape_configs = PrometheusConfig.prefix_job_names(scrape_configs, job_name_prefix) + scrape_configs = PrometheusConfig.sanitize_scrape_configs(scrape_configs) hosts = self._relation_hosts(relation) - scrape_jobs = PrometheusConfig.expand_wildcard_targets_into_individual_jobs( - scrape_jobs, hosts, topology + scrape_configs = PrometheusConfig.expand_wildcard_targets_into_individual_jobs( + scrape_configs, hosts, topology ) - return scrape_jobs + # If scheme is https but no ca section present, then auto add "insecure_skip_verify", + # otherwise scraping errors out with "x509: certificate signed by unknown authority". + # https://prometheus.io/docs/prometheus/latest/configuration/configuration/#tls_config + for scrape_config in scrape_configs: + tls_config = scrape_config.get("tls_config", {}) + ca_present = "ca" in tls_config or "ca_file" in tls_config + if scrape_config.get("scheme") == "https" and not ca_present: + tls_config["insecure_skip_verify"] = True + scrape_config["tls_config"] = tls_config + + return scrape_configs def _relation_hosts(self, relation: Relation) -> Dict[str, Tuple[str, str]]: """Returns a mapping from unit names to (address, path) tuples, for the given relation.""" @@ -1440,7 +1457,7 @@ def _dedupe_job_names(jobs: List[dict]): job["job_name"] = "{}_{}".format(job["job_name"], hashed) new_jobs = [] for key in jobs_dict: - new_jobs.extend([i for i in jobs_dict[key]]) + new_jobs.extend(list(jobs_dict[key])) # Deduplicate jobs which are equal # Again this in O(n^2) but it should be okay @@ -1793,11 +1810,10 @@ def _scrape_jobs(self) -> list: A list of dictionaries, where each dictionary specifies a single scrape job for Prometheus. """ - jobs = self._jobs if self._jobs else [DEFAULT_JOB] + jobs = self._jobs or [] if callable(self._lookaside_jobs): - return jobs + PrometheusConfig.sanitize_scrape_configs(self._lookaside_jobs()) - else: - return jobs + jobs.extend(PrometheusConfig.sanitize_scrape_configs(self._lookaside_jobs())) + return jobs or [DEFAULT_JOB] @property def _scrape_metadata(self) -> dict: @@ -2078,6 +2094,7 @@ def set_target_job_data(self, targets: dict, app_name: str, **kwargs) -> None: Args: targets: a `dict` containing target information app_name: a `str` identifying the application + kwargs: a `dict` of the extra arguments passed to the function """ if not self._charm.unit.is_leader(): return @@ -2203,6 +2220,7 @@ def _static_scrape_job(self, targets, application_name, **kwargs) -> dict: "port". application_name: a string name of the application for which this static scrape job is being constructed. + kwargs: a `dict` of the extra arguments passed to the function Returns: A dictionary corresponding to a Prometheus static scrape @@ -2248,7 +2266,7 @@ def _static_config_extra_labels(self, target: Dict[str, str]) -> Dict[str, str]: logger.debug("Could not perform DNS lookup for %s", target["hostname"]) dns_name = target["hostname"] extra_info["dns_name"] = dns_name - label_re = re.compile(r'(?P