Skip to content

deps(python): upgrade CLI dependencies to latest stable#126

Closed
oferk0 wants to merge 1 commit into
CloudGeometry:mainfrom
oferk0:deps/python-cli
Closed

deps(python): upgrade CLI dependencies to latest stable#126
oferk0 wants to merge 1 commit into
CloudGeometry:mainfrom
oferk0:deps/python-cli

Conversation

@oferk0

@oferk0 oferk0 commented Jun 23, 2026

Copy link
Copy Markdown

Bumps all Poetry runtime/dev deps to latest and regenerates the lock; Python ceiling raised to <3.14.

Major bumps: kubernetes 27→36, hvac 1→2, PyInstaller 5→6, azure-mgmt-*, google-cloud-storage 2→3, boto3/awscli, flake8 6→7.

Breaking-change fixes:

  • azure-mgmt-storage 25 dropped the pinned API submodule → import SkuName/Kind from azure.mgmt.storage.models
  • setuptools 82 removed pkg_resources → resolve bundled kubeconfig via importlib.resources
  • pin anyio>=4.9 for httpx-ws (via kr8s)

Verified: lock+install, all subcommands import, flake8, PyInstaller frozen binary builds & resolves its bundled resource.

Summary by CodeRabbit

  • Chores
    • Updated Python version constraint to support up to version 3.13.
    • Upgraded multiple dependencies including PyInstaller, setuptools, AWS/GCP/Azure SDKs, and Kubernetes client libraries.
    • Refactored internal template loading and module imports for improved compatibility.

Bump all runtime and dev dependencies in tools/pyproject.toml to latest
stable releases and regenerate poetry.lock. Notable major bumps:
kubernetes 27->36, hvac 1->2, PyInstaller 5->6, azure-mgmt-* (storage/
compute/containerservice), configparser 6->7, google-cloud-storage 2->3,
boto3/awscli to 1.43/1.45, flake8 6->7. Raise Python ceiling to <3.14 and
migrate dev-dependencies to the [tool.poetry.group.dev] table.

Fix breaking changes surfaced by the upgrade:
- azure-mgmt-storage 25 removed the pinned v2021_04_01 API module; import
  SkuName/Kind from azure.mgmt.storage.models instead.
- setuptools 82 removed pkg_resources; resolve the bundled kubeconfig.yaml
  via importlib.resources (verified in the PyInstaller frozen binary).
- pin anyio >=4.9 so httpx-ws (via kr8s) finds AsyncContextManagerMixin.

Verified: poetry lock/install, cgdevxcli + all subcommands import, flake8
runs, PyInstaller build produces a working frozen binary that resolves the
bundled resource.
@coderabbitai

coderabbitai Bot commented Jun 23, 2026

Copy link
Copy Markdown

Review Change Stack

Walkthrough

Updates the cgdevxcli Python tooling project: bumps the Python version ceiling from <3.13 to <3.14, upgrades and normalizes dependency version pins in pyproject.toml, moves dev dependencies to the modern Poetry group format, and fixes two compatibility issues in source files (Azure SDK versioned import path and pkg_resourcesimportlib.resources migration).

Changes

CLI Dependency and Compatibility Updates

Layer / File(s) Summary
Python version and dependency version updates
tools/pyproject.toml
Python upper bound raised to <3.14; core, Azure, GCP, AWS, and Kubernetes dependencies upgraded with many pins normalized to caret ranges; dev dependencies relocated from [tool.poetry.dev-dependencies] to [tool.poetry.group.dev.dependencies] with updated versions.
Azure SDK import and importlib.resources migration
tools/cli/services/cloud/azure/azure_sdk.py, tools/cli/services/k8s/config_builder.py
SkuName/Kind import changed from azure.mgmt.storage.v2021_04_01.models to azure.mgmt.storage.models; kubeconfig template resolution switched from pkg_resources.resource_filename to importlib.resources.files(...) / "kubeconfig.yaml".

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~5 minutes

Poem

🐇 A hop through the versions, a skip past the old,
pkg_resources retired, importlib enrolled.
The Azure path shortened, no version in sight,
The Python ceiling lifted — 3.14 in flight!
These small tidy changes keep the warren just right. 🌿

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main change: upgrading CLI dependencies to their latest stable versions, which encompasses the Python version ceiling update, major dependency bumps, and breaking change fixes across multiple packages.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
tools/cli/services/k8s/config_builder.py (1)

12-15: 🩺 Stability & Availability | 🔵 Trivial | ⚡ Quick win

Use Traversable reads directly instead of converting to a string path.

Line 12 currently assumes a filesystem path. Using read_text() (or as_file) keeps resource loading robust across loaders/packaging modes.

Proposed refactor
-    template_file_path = str(resources.files('services.k8s') / "kubeconfig.yaml")
-
-    with open(template_file_path, "r") as file:
-        kubeconf = yaml.safe_load(file.read())
+    template_text = (resources.files("services.k8s") / "kubeconfig.yaml").read_text(encoding="utf-8")
+    kubeconf = yaml.safe_load(template_text)
         kubeconf["users"][0]["user"]["exec"]["command"] = command
         kubeconf["users"][0]["user"]["exec"]["args"] = command_args
         envs = []
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@tools/cli/services/k8s/config_builder.py` around lines 12 - 15, The current
code in the config_builder.py file converts the resource path to a string and
then opens it as a file, which assumes a traditional filesystem path and may
break with certain packaging modes. Instead of converting template_file_path to
a string and using the open() function, use the Traversable API directly by
calling read_text() on the resource object to read the kubeconfig.yaml file
content, then pass that content to yaml.safe_load(). This approach is more
robust across different loaders and packaging scenarios.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@tools/cli/services/k8s/config_builder.py`:
- Around line 12-15: The current code in the config_builder.py file converts the
resource path to a string and then opens it as a file, which assumes a
traditional filesystem path and may break with certain packaging modes. Instead
of converting template_file_path to a string and using the open() function, use
the Traversable API directly by calling read_text() on the resource object to
read the kubeconfig.yaml file content, then pass that content to
yaml.safe_load(). This approach is more robust across different loaders and
packaging scenarios.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: eaea98bc-260d-4ba9-92f2-87131019d603

📥 Commits

Reviewing files that changed from the base of the PR and between eaa528a and e2932d6.

⛔ Files ignored due to path filters (1)
  • tools/poetry.lock is excluded by !**/*.lock
📒 Files selected for processing (3)
  • tools/cli/services/cloud/azure/azure_sdk.py
  • tools/cli/services/k8s/config_builder.py
  • tools/pyproject.toml

@oferk0

oferk0 commented Jun 23, 2026

Copy link
Copy Markdown
Author

Superseded: re-pointed at the deps/modernization integration branch instead of main directly. See umbrella PR #131 (per-layer review preserved as oferk0#1–5).

@oferk0 oferk0 closed this Jun 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant