From 621709b610e2506db1265931b9d2d2077714a123 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Luis=20Cano=20Rodr=C3=ADguez?= Date: Wed, 17 Dec 2025 10:20:40 +0100 Subject: [PATCH 1/3] Adopt packaging standards --- kubernetes/poetry.lock | 4 +- kubernetes/pyproject.toml | 95 +++++++++++++++++++++------------------ machines/poetry.lock | 4 +- machines/pyproject.toml | 91 ++++++++++++++++++++----------------- 4 files changed, 104 insertions(+), 90 deletions(-) diff --git a/kubernetes/poetry.lock b/kubernetes/poetry.lock index 718ac4f9..0b047f93 100644 --- a/kubernetes/poetry.lock +++ b/kubernetes/poetry.lock @@ -1,4 +1,4 @@ -# This file is automatically @generated by Poetry 2.1.4 and should not be changed by hand. +# This file is automatically @generated by Poetry 2.2.1 and should not be changed by hand. [[package]] name = "allure-pytest" @@ -2885,4 +2885,4 @@ type = ["pytest-mypy"] [metadata] lock-version = "2.1" python-versions = "^3.10" -content-hash = "d11a27c4b815cc5df25f70c8a04ecef3262f4550b47fad9aa5f926497a74090d" +content-hash = "715e825ba99e24606a3cfa7e7439763b124c27d9047af4a48c0338dac838757b" diff --git a/kubernetes/pyproject.toml b/kubernetes/pyproject.toml index 2ba2a5b2..8817cd98 100644 --- a/kubernetes/pyproject.toml +++ b/kubernetes/pyproject.toml @@ -1,6 +1,57 @@ # Copyright 2022 Canonical Ltd. # See LICENSE file for licensing details. +[project] +name = "mysql-router-k8s-operator" +version = "0.0.1" +dynamic = ["dependencies", "requires-python"] + +[dependency-groups] +charm-libs = [ + # data_platform_libs/v0/data_interfaces.py + "ops>=2.0.0", + # grafana_k8s/grafana_dashboard.py + "cosl>= 0.0.50", + # tempo_coordinator_k8s/v0/charm_tracing.py + "opentelemetry-exporter-otlp-proto-http==1.21.0", + # tempo_coordinator_k8s/v0/tracing.py + "pydantic", + # tls_certificates_interface/v1/tls_certificates.py + "cryptography", + "jsonschema", +] +format = [ + "ruff>=0.12.11,<0.13", +] +lint = [ + "ruff>=0.12.11,<0.13", + "codespell>=2.4.1,<3", +] +unit = [ + "pytest>=8.4.1,<9", + "pytest-xdist>=3.8.0,<4", + "pytest-forked>=1.6.0,<2", # Workaround to deal with memory leaks in scenario tests + "pytest-cov>=6.2.1,<7", + "ops-scenario>=6.0.3,<7,<6.0.4", # 6.0.4 requires ops >= 2.12 + "ops>=2.9.0,<3", +] +integration = [ + "pytest>=8.4.1,<9", + "pytest-operator>=0.43.1,<0.44", + "requests>=2.32.5,<3", + "juju>=3.6.0.0,<4", + "mysql-connector-python>=9.5.0,<10", + "pyyaml>=6.0.2,<7", + "tenacity>=9.1.2,<10", + "allure-pytest>=2.15.0,<3", + "allure-pytest-default-results>=0.1.3,<0.2", + "tomli>=2.2.1,<3", + "tomli-w>=1.2.0,<2", +] +build-refresh-version = [ + "charm-refresh-build-version>=0.4.0,<0.5", +] + [tool.poetry] package-mode = false requires-poetry = ">=2.0.0" @@ -14,59 +65,15 @@ lightkube = "^0.17.2" tenacity = "^9.1.2" charm-refresh = "^3.1.0.2" -[tool.poetry.group.charm-libs.dependencies] -# data_platform_libs/v0/data_interfaces.py -ops = ">=2.0.0" -# grafana_k8s/grafana_dashboard.py -cosl = ">= 0.0.50" -# tempo_coordinator_k8s/v0/charm_tracing.py -opentelemetry-exporter-otlp-proto-http = "1.21.0" -# tempo_coordinator_k8s/v0/tracing.py -pydantic = "*" -# tls_certificates_interface/v1/tls_certificates.py -cryptography = "*" -jsonschema = "*" - [tool.poetry.group.format] optional = true -[tool.poetry.group.format.dependencies] -ruff = "^0.12.11" - [tool.poetry.group.lint] optional = true -[tool.poetry.group.lint.dependencies] -ruff = "^0.12.11" -codespell = "^2.4.1" - -[tool.poetry.group.unit.dependencies] -pytest = "^8.4.1" -pytest-xdist = "^3.8.0" -pytest-forked = "^1.6.0" # Workaround to deal with memory leaks in scenario tests -pytest-cov = "^6.2.1" -ops-scenario = "^6.0.3, <6.0.4" # 6.0.4 requires ops >= 2.12 -ops = "^2.9.0" - -[tool.poetry.group.integration.dependencies] -pytest = "^8.4.1" -pytest-operator = "^0.43.1" -requests = "^2.32.5" -juju = "^3.6.0.0" -mysql-connector-python = "^9.5.0" -pyyaml = "^6.0.2" -tenacity = "^9.1.2" -allure-pytest = "^2.15.0" -allure-pytest-default-results = "^0.1.3" -tomli = "^2.2.1" -tomli-w = "^1.2.0" - [tool.poetry.group.build-refresh-version] optional = true -[tool.poetry.group.build-refresh-version.dependencies] -charm-refresh-build-version = "^0.4.0" - [tool.coverage.run] branch = true diff --git a/machines/poetry.lock b/machines/poetry.lock index 5a6a904f..4f67ef1f 100644 --- a/machines/poetry.lock +++ b/machines/poetry.lock @@ -1,4 +1,4 @@ -# This file is automatically @generated by Poetry 2.1.4 and should not be changed by hand. +# This file is automatically @generated by Poetry 2.2.1 and should not be changed by hand. [[package]] name = "allure-pytest" @@ -2868,4 +2868,4 @@ type = ["pytest-mypy"] [metadata] lock-version = "2.1" python-versions = "^3.10" -content-hash = "dd49f88f78b722bea2beec95b4a8c188308ae218ea23c5d716b7c703d103eff4" +content-hash = "7f2957db652dbcd04f396dc21fbbc690f68037ee83b74f7946e808caf152da89" diff --git a/machines/pyproject.toml b/machines/pyproject.toml index 9367c4b2..6e1411fe 100644 --- a/machines/pyproject.toml +++ b/machines/pyproject.toml @@ -1,9 +1,57 @@ # Copyright 2022 Canonical Ltd. # See LICENSE file for licensing details. +[project] +name = "mysql-router-operator" +version = "0.0.1" +dynamic = ["dependencies", "requires-python"] + +[dependency-groups] +charm-libs = [ + # data_platform_libs/v0/data_interfaces.py + "ops>=2.0.0", + # tls_certificates_interface/v2/tls_certificates.py + # tls_certificates lib v2 uses a feature only available in cryptography >=42.0.5 + "cryptography>=42.0.5", + "jsonschema", + # grafana_agent/v0/cos_agent.py + "pydantic", + "cosl>=0.0.50", + # tempo_coordinator_k8s/v0/charm_tracing.py + "opentelemetry-exporter-otlp-proto-http==1.21.0", +] +format = [ + "ruff>=0.12.11,<0.13", +] +lint = [ + "ruff>=0.12.11,<0.13", + "codespell>=2.4.1,<3", +] +unit = [ + "pytest>=8.4.1,<9", + "pytest-xdist>=3.8.0,<4", + "pytest-cov>=6.2.1,<7", + "ops-scenario>=6.0.3,<7,<6.0.4", # 6.0.4 requires ops >= 2.12 +] +integration = [ + "pytest>=8.4.1,<9", + "pytest-operator>=0.43.1,<0.44", + "requests>=2.32.5,<3", + "juju>=3.6.0.0,<4", + "mysql-connector-python~=8.0.33", + "tenacity>=9.1.2,<10", + "ops>=2.9.0,<3", + "allure-pytest-default-results>=0.1.3,<0.2", + "tomli>=2.2.1,<3", + "tomli-w>=1.2.0,<2", +] +build-refresh-version = [ + "charm-refresh-build-version>=0.4.0,<0.5", +] + [tool.poetry] package-mode = false -requires-poetry = ">=2.0.0" +requires-poetry = ">=2.2.0" [tool.poetry.dependencies] python = "^3.10" @@ -13,56 +61,15 @@ ops = "^2.9.0, <2.10" tenacity = "^9.1.2" charm-refresh = "^3.1.0.2" -[tool.poetry.group.charm-libs.dependencies] -# data_platform_libs/v0/data_interfaces.py -ops = ">=2.0.0" -# tls_certificates_interface/v2/tls_certificates.py -# tls_certificates lib v2 uses a feature only available in cryptography >=42.0.5 -cryptography = ">=42.0.5" -jsonschema = "*" -# grafana_agent/v0/cos_agent.py -pydantic = "*" -cosl = ">=0.0.50" -# tempo_coordinator_k8s/v0/charm_tracing.py -opentelemetry-exporter-otlp-proto-http = "1.21.0" - [tool.poetry.group.format] optional = true -[tool.poetry.group.format.dependencies] -ruff = "^0.12.11" - [tool.poetry.group.lint] optional = true -[tool.poetry.group.lint.dependencies] -ruff = "^0.12.11" -codespell = "^2.4.1" - -[tool.poetry.group.unit.dependencies] -pytest = "^8.4.1" -pytest-xdist = "^3.8.0" -pytest-cov = "^6.2.1" -ops-scenario = "^6.0.3, <6.0.4" # 6.0.4 requires ops >= 2.12 - -[tool.poetry.group.integration.dependencies] -pytest = "^8.4.1" -pytest-operator = "^0.43.1" -requests = "^2.32.5" -juju = "^3.6.0.0" -mysql-connector-python = "~8.0.33" -tenacity = "^9.1.2" -ops = "^2.9.0" -allure-pytest-default-results = "^0.1.3" -tomli = "^2.2.1" -tomli-w = "^1.2.0" - [tool.poetry.group.build-refresh-version] optional = true -[tool.poetry.group.build-refresh-version.dependencies] -charm-refresh-build-version = "^0.4.0" - [tool.coverage.run] branch = true From f5cbe83acec8ace911a590a8457ad73fbfb88b14 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Luis=20Cano=20Rodr=C3=ADguez?= Date: Wed, 17 Dec 2025 16:59:50 +0100 Subject: [PATCH 2/3] Use compatible release specifiers --- kubernetes/pyproject.toml | 42 +++++++++++++++++++-------------------- machines/pyproject.toml | 34 +++++++++++++++---------------- 2 files changed, 38 insertions(+), 38 deletions(-) diff --git a/kubernetes/pyproject.toml b/kubernetes/pyproject.toml index 8817cd98..fc42f8ff 100644 --- a/kubernetes/pyproject.toml +++ b/kubernetes/pyproject.toml @@ -21,35 +21,35 @@ charm-libs = [ "jsonschema", ] format = [ - "ruff>=0.12.11,<0.13", + "ruff~=0.12.11", ] lint = [ - "ruff>=0.12.11,<0.13", - "codespell>=2.4.1,<3", + "ruff~=0.12.11", + "codespell~=2.4", ] unit = [ - "pytest>=8.4.1,<9", - "pytest-xdist>=3.8.0,<4", - "pytest-forked>=1.6.0,<2", # Workaround to deal with memory leaks in scenario tests - "pytest-cov>=6.2.1,<7", - "ops-scenario>=6.0.3,<7,<6.0.4", # 6.0.4 requires ops >= 2.12 - "ops>=2.9.0,<3", + "pytest~=8.4", + "pytest-xdist~=3.8", + "pytest-forked~=1.6", # Workaround to deal with memory leaks in scenario tests + "pytest-cov~=6.2", + "ops-scenario==6.0.3", # 6.0.4 requires ops >= 2.12 + "ops~=2.9", ] integration = [ - "pytest>=8.4.1,<9", - "pytest-operator>=0.43.1,<0.44", - "requests>=2.32.5,<3", - "juju>=3.6.0.0,<4", - "mysql-connector-python>=9.5.0,<10", - "pyyaml>=6.0.2,<7", - "tenacity>=9.1.2,<10", - "allure-pytest>=2.15.0,<3", - "allure-pytest-default-results>=0.1.3,<0.2", - "tomli>=2.2.1,<3", - "tomli-w>=1.2.0,<2", + "pytest~=8.4", + "pytest-operator~=0.43.1", + "requests~=2.32", + "juju~=3.6", + "mysql-connector-python~=9.5", + "pyyaml~=6.0", + "tenacity~=9.1", + "allure-pytest~=2.15", + "allure-pytest-default-results~=0.1.3", + "tomli~=2.2", + "tomli-w~=1.2", ] build-refresh-version = [ - "charm-refresh-build-version>=0.4.0,<0.5", + "charm-refresh-build-version~=0.4.0", ] [tool.poetry] diff --git a/machines/pyproject.toml b/machines/pyproject.toml index 6e1411fe..ead2e9ef 100644 --- a/machines/pyproject.toml +++ b/machines/pyproject.toml @@ -21,32 +21,32 @@ charm-libs = [ "opentelemetry-exporter-otlp-proto-http==1.21.0", ] format = [ - "ruff>=0.12.11,<0.13", + "ruff~=0.12.11", ] lint = [ - "ruff>=0.12.11,<0.13", - "codespell>=2.4.1,<3", + "ruff~=0.12.11", + "codespell~=2.4", ] unit = [ - "pytest>=8.4.1,<9", - "pytest-xdist>=3.8.0,<4", - "pytest-cov>=6.2.1,<7", - "ops-scenario>=6.0.3,<7,<6.0.4", # 6.0.4 requires ops >= 2.12 + "pytest~=8.4", + "pytest-xdist~=3.8", + "pytest-cov~=6.2", + "ops-scenario==6.0.3", # 6.0.4 requires ops >= 2.12 ] integration = [ - "pytest>=8.4.1,<9", - "pytest-operator>=0.43.1,<0.44", - "requests>=2.32.5,<3", - "juju>=3.6.0.0,<4", + "pytest~=8.4", + "pytest-operator~=0.43.1", + "requests~=2.32", + "juju~=3.6", "mysql-connector-python~=8.0.33", - "tenacity>=9.1.2,<10", - "ops>=2.9.0,<3", - "allure-pytest-default-results>=0.1.3,<0.2", - "tomli>=2.2.1,<3", - "tomli-w>=1.2.0,<2", + "tenacity~=9.1", + "ops~=2.9", + "allure-pytest-default-results~=0.1.3", + "tomli~=2.2", + "tomli-w~=1.2", ] build-refresh-version = [ - "charm-refresh-build-version>=0.4.0,<0.5", + "charm-refresh-build-version~=0.4.0", ] [tool.poetry] From 98d5557da18b180e334b5f6193b39daec38beb21 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Luis=20Cano=20Rodr=C3=ADguez?= Date: Thu, 18 Dec 2025 10:28:29 +0100 Subject: [PATCH 3/3] Whitespace MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Juan Luis Cano Rodríguez --- kubernetes/pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kubernetes/pyproject.toml b/kubernetes/pyproject.toml index fc42f8ff..5f4f8cc0 100644 --- a/kubernetes/pyproject.toml +++ b/kubernetes/pyproject.toml @@ -11,7 +11,7 @@ charm-libs = [ # data_platform_libs/v0/data_interfaces.py "ops>=2.0.0", # grafana_k8s/grafana_dashboard.py - "cosl>= 0.0.50", + "cosl>=0.0.50", # tempo_coordinator_k8s/v0/charm_tracing.py "opentelemetry-exporter-otlp-proto-http==1.21.0", # tempo_coordinator_k8s/v0/tracing.py