diff --git a/charmcraft.yaml b/charmcraft.yaml index d7980afc..855e28b8 100644 --- a/charmcraft.yaml +++ b/charmcraft.yaml @@ -1,4 +1,4 @@ -# Copyright 2021 Canonical Ltd. +# Copyright 2023 Canonical Ltd. # See LICENSE file for licensing details. type: charm @@ -12,3 +12,6 @@ bases: parts: charm: charm-python-packages: [setuptools, pip] + # Install rustc and cargo as build packages because some charm's + # dependencies need this to be built and installed from source. + build-packages: [rustc, cargo] diff --git a/config.yaml b/config.yaml index dc239c9d..bc1b19ec 100644 --- a/config.yaml +++ b/config.yaml @@ -1,4 +1,4 @@ -# Copyright 2021 Canonical Ltd. +# Copyright 2023 Canonical Ltd. # See LICENSE file for licensing details. options: diff --git a/metadata.yaml b/metadata.yaml index addedb16..9b51bb8c 100755 --- a/metadata.yaml +++ b/metadata.yaml @@ -1,4 +1,4 @@ -# Copyright 2021 Canonical Ltd. +# Copyright 2023 Canonical Ltd. # See LICENSE file for licensing details. name: dex-auth summary: A federated OpenID Connect provider diff --git a/requirements-fmt.txt b/requirements-fmt.txt index 6e09e6ba..0cb547ab 100644 --- a/requirements-fmt.txt +++ b/requirements-fmt.txt @@ -2,14 +2,14 @@ # This file is autogenerated by pip-compile with Python 3.8 # by the following command: # -# pip-compile ./requirements-fmt.in +# pip-compile requirements-fmt.in # black==23.7.0 - # via -r ./requirements-fmt.in + # via -r requirements-fmt.in click==8.1.6 # via black isort==5.12.0 - # via -r ./requirements-fmt.in + # via -r requirements-fmt.in mypy-extensions==1.0.0 # via black packaging==23.1 diff --git a/requirements-integration.txt b/requirements-integration.txt index d9a9fb62..a2ad37d4 100644 --- a/requirements-integration.txt +++ b/requirements-integration.txt @@ -2,10 +2,10 @@ # This file is autogenerated by pip-compile with Python 3.8 # by the following command: # -# pip-compile ./requirements-integration.in +# pip-compile requirements-integration.in # aiohttp==3.8.5 - # via -r ./requirements-integration.in + # via -r requirements-integration.in aiosignal==1.3.1 # via aiohttp anyio==3.7.1 @@ -29,7 +29,7 @@ brotli==1.0.9 # via selenium-wire cachetools==5.3.1 # via google-auth -certifi==2023.5.7 +certifi==2023.7.22 # via # httpcore # httpx @@ -100,11 +100,11 @@ jedi==0.18.2 # via ipython jinja2==3.1.2 # via - # -r ./requirements-integration.in + # -r requirements-integration.in # pytest-operator juju==2.9.44.0 # via - # -r ./requirements-integration.in + # -r requirements-integration.in # pytest-operator jujubundlelib==0.5.7 # via theblues @@ -113,7 +113,7 @@ kaitaistruct==0.10 kubernetes==27.2.0 # via juju 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 @@ -194,14 +194,14 @@ pytest==7.4.0 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 kubernetes pytz==2023.3 # via pyrfc3339 pyyaml==6.0.1 # via - # -r ./requirements-integration.in + # -r requirements-integration.in # juju # jujubundlelib # kubernetes @@ -209,7 +209,7 @@ pyyaml==6.0.1 # pytest-operator requests==2.31.0 # via - # -r ./requirements-integration.in + # -r requirements-integration.in # kubernetes # macaroonbakery # requests-oauthlib @@ -220,10 +220,10 @@ rsa==4.9 # via google-auth selenium==4.10.0 # via - # -r ./requirements-integration.in + # -r requirements-integration.in # selenium-wire selenium-wire==5.1.0 - # via -r ./requirements-integration.in + # via -r requirements-integration.in six==1.16.0 # via # asttokens @@ -244,7 +244,7 @@ sortedcontainers==2.4.0 stack-data==0.6.2 # via ipython tenacity==8.2.2 - # via -r ./requirements-integration.in + # via -r requirements-integration.in theblues==0.5.2 # via juju tomli==2.0.1 diff --git a/requirements-lint.txt b/requirements-lint.txt index d1814e06..ab9acc9b 100644 --- a/requirements-lint.txt +++ b/requirements-lint.txt @@ -2,26 +2,26 @@ # This file is autogenerated by pip-compile with Python 3.8 # by the following command: # -# pip-compile ./requirements-lint.in +# pip-compile requirements-lint.in # black==23.7.0 - # via -r ./requirements-lint.in + # 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-lint.in + # via -r requirements-lint.in mccabe==0.7.0 # via flake8 mypy-extensions==1.0.0 @@ -31,7 +31,7 @@ packaging==23.1 pathspec==0.11.1 # via black pep8-naming==0.13.3 - # via -r ./requirements-lint.in + # via -r requirements-lint.in platformdirs==3.9.1 # via black pycodestyle==2.10.0 @@ -39,7 +39,7 @@ pycodestyle==2.10.0 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 # black diff --git a/requirements-unit.in b/requirements-unit.in index 3faaf62a..f3cd6a7a 100644 --- a/requirements-unit.in +++ b/requirements-unit.in @@ -1,12 +1,7 @@ -bcrypt -charmed-kubeflow-chisme +# Copyright 2023 Canonical Ltd. +# See LICENSE file for licensing details. coverage -# Workaround for https://github.com/python-jsonschema/jsonschema/issues/1117 -# and https://github.com/python-jsonschema/jsonschema/issues/1114 -jsonschema<4.18 ops pytest -pytest-mock -pytest-lazy-fixture pyyaml -serialized-data-interface +-r requirements.txt diff --git a/requirements-unit.txt b/requirements-unit.txt index 41994b2f..d9f58696 100644 --- a/requirements-unit.txt +++ b/requirements-unit.txt @@ -2,108 +2,151 @@ # This file is autogenerated by pip-compile with Python 3.8 # by the following command: # -# pip-compile ./requirements-unit.in +# pip-compile requirements-unit.in # anyio==3.7.1 - # via httpcore + # via + # -r requirements.txt + # httpcore attrs==23.1.0 - # via jsonschema + # via + # -r requirements.txt + # jsonschema bcrypt==4.0.1 - # via -r ./requirements-unit.in -certifi==2023.5.7 + # via -r requirements.txt +certifi==2023.7.22 # via + # -r requirements.txt # httpcore # httpx # requests charmed-kubeflow-chisme==0.0.11 - # via -r ./requirements-unit.in + # via -r requirements.txt charset-normalizer==3.2.0 - # via requests + # via + # -r requirements.txt + # requests coverage==7.2.7 - # via -r ./requirements-unit.in + # via -r requirements-unit.in deepdiff==6.2.1 - # via charmed-kubeflow-chisme + # via + # -r requirements.txt + # charmed-kubeflow-chisme exceptiongroup==1.1.2 # via + # -r requirements.txt # anyio # pytest h11==0.14.0 - # via httpcore + # via + # -r requirements.txt + # httpcore httpcore==0.17.3 - # via httpx + # via + # -r requirements.txt + # httpx httpx==0.24.1 - # via lightkube + # via + # -r requirements.txt + # lightkube idna==3.4 # via + # -r requirements.txt # anyio # httpx # requests importlib-resources==6.0.0 - # via jsonschema + # via + # -r requirements.txt + # jsonschema iniconfig==2.0.0 # via pytest jinja2==3.1.2 - # via charmed-kubeflow-chisme + # via + # -r requirements.txt + # charmed-kubeflow-chisme jsonschema==4.17.3 # via - # -r ./requirements-unit.in + # -r requirements.txt # serialized-data-interface lightkube==0.14.0 - # via charmed-kubeflow-chisme + # via + # -r requirements.txt + # charmed-kubeflow-chisme lightkube-models==1.27.1.4 - # via lightkube + # via + # -r requirements.txt + # lightkube markupsafe==2.1.3 - # via jinja2 + # via + # -r requirements.txt + # jinja2 ops==2.4.1 # via - # -r ./requirements-unit.in + # -r requirements-unit.in + # -r requirements.txt # charmed-kubeflow-chisme # serialized-data-interface ordered-set==4.1.0 - # via deepdiff + # via + # -r requirements.txt + # deepdiff packaging==23.1 # via pytest pkgutil-resolve-name==1.3.10 - # via jsonschema + # via + # -r requirements.txt + # jsonschema pluggy==1.2.0 # via pytest pyrsistent==0.19.3 - # via jsonschema -pytest==7.4.0 # via - # -r ./requirements-unit.in - # pytest-lazy-fixture - # pytest-mock -pytest-lazy-fixture==0.6.3 - # via -r ./requirements-unit.in -pytest-mock==3.11.1 - # via -r ./requirements-unit.in + # -r requirements.txt + # jsonschema +pytest==7.4.0 + # via -r requirements-unit.in pyyaml==6.0.1 # via - # -r ./requirements-unit.in + # -r requirements-unit.in + # -r requirements.txt # lightkube # ops # serialized-data-interface requests==2.31.0 - # via serialized-data-interface + # via + # -r requirements.txt + # serialized-data-interface ruamel-yaml==0.17.32 - # via charmed-kubeflow-chisme + # via + # -r requirements.txt + # charmed-kubeflow-chisme ruamel-yaml-clib==0.2.7 - # via ruamel-yaml -serialized-data-interface==0.6.0 - # via -r ./requirements-unit.in + # via + # -r requirements.txt + # ruamel-yaml +serialized-data-interface==0.7.0 + # via -r requirements.txt sniffio==1.3.0 # via + # -r requirements.txt # anyio # httpcore # httpx tenacity==8.2.2 - # via charmed-kubeflow-chisme + # via + # -r requirements.txt + # charmed-kubeflow-chisme tomli==2.0.1 # via pytest urllib3==2.0.4 - # via requests + # via + # -r requirements.txt + # requests websocket-client==1.6.1 - # via ops + # via + # -r requirements.txt + # ops zipp==3.16.2 - # via importlib-resources + # via + # -r requirements.txt + # importlib-resources diff --git a/requirements.in b/requirements.in index e1691642..037e1074 100644 --- a/requirements.in +++ b/requirements.in @@ -1,10 +1,8 @@ -# Copyright 2021 Canonical Ltd. +# Copyright 2023 Canonical Ltd. # See LICENSE file for licensing details. +bcrypt charmed-kubeflow-chisme jinja2 -# Workaround for https://github.com/python-jsonschema/jsonschema/issues/1117 -# and https://github.com/python-jsonschema/jsonschema/issues/1114 -jsonschema<4.18 lightkube -ops<2 +ops serialized-data-interface diff --git a/requirements.txt b/requirements.txt index 1ffe7f7c..20f3b40a 100644 --- a/requirements.txt +++ b/requirements.txt @@ -2,19 +2,21 @@ # This file is autogenerated by pip-compile with Python 3.8 # by the following command: # -# pip-compile ./requirements.in +# pip-compile requirements.in # anyio==3.7.1 # via httpcore attrs==23.1.0 # via jsonschema -certifi==2023.5.7 +bcrypt==4.0.1 + # via -r requirements.in +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 @@ -36,23 +38,21 @@ importlib-resources==6.0.0 # via jsonschema jinja2==3.1.2 # via - # -r ./requirements.in + # -r requirements.in # 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 lightkube markupsafe==2.1.3 # via jinja2 -ops==1.5.5 +ops==2.4.1 # via - # -r ./requirements.in + # -r requirements.in # charmed-kubeflow-chisme # serialized-data-interface ordered-set==4.1.0 @@ -72,8 +72,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,5 +83,7 @@ tenacity==8.2.2 # via charmed-kubeflow-chisme urllib3==2.0.4 # via requests +websocket-client==1.6.1 + # via ops zipp==3.16.2 # via importlib-resources diff --git a/src/charm.py b/src/charm.py index 754667d7..55f167b3 100755 --- a/src/charm.py +++ b/src/charm.py @@ -1,5 +1,5 @@ #!/usr/bin/env python3 -# Copyright 2021 Canonical Ltd. +# Copyright 2023 Canonical Ltd. # See LICENSE file for licensing details. import logging diff --git a/tests/integration/test_charm.py b/tests/integration/test_charm.py index f15bf181..2af91634 100644 --- a/tests/integration/test_charm.py +++ b/tests/integration/test_charm.py @@ -1,4 +1,4 @@ -# Copyright 2021 Canonical Ltd. +# Copyright 2023 Canonical Ltd. # See LICENSE file for licensing details. import json diff --git a/tests/integration/test_upgrade_charm.py b/tests/integration/test_upgrade_charm.py index e78c136c..48dbea37 100644 --- a/tests/integration/test_upgrade_charm.py +++ b/tests/integration/test_upgrade_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/tests/unit/test_charm.py b/tests/unit/test_charm.py index 47ffcb4f..7a511cee 100644 --- a/tests/unit/test_charm.py +++ b/tests/unit/test_charm.py @@ -1,4 +1,4 @@ -# Copyright 2021 Canonical Ltd. +# Copyright 2023 Canonical Ltd. # See LICENSE file for licensing details. from unittest.mock import patch diff --git a/tox.ini b/tox.ini index fd9eec76..73509eaa 100644 --- a/tox.ini +++ b/tox.ini @@ -31,9 +31,11 @@ allowlist_externals = find pip-compile xargs -commands = -; uses 'bash -c' because piping didn't work in regular tox commands - bash -c 'find . -type f -name "requirements*.in" | xargs --replace=\{\} pip-compile --resolver=backtracking \{\}' +commands = + ; we must preserve the order of compilation, since each *.in file depends on some *.txt file. + ; For example, requirements-unit.in depends on requirements.txt and we must compile first + ; requirements.txt to ensure that requirements-unit.txt get the same dependency as the requirements.txt + bash -c 'for pattern in "requirements.in" "requirements-fmt.in" "requirements*.in"; do find . -type f -name "$pattern" -exec bash -c "cd \$(dirname "{}") && pip-compile --resolver=backtracking \$(basename "{}")" \;; done' deps = pip-tools description = Update requirements files by executing pip-compile on all requirements*.in files, including those in subdirs.