deps(python): upgrade CLI dependencies to latest stable#126
Conversation
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.
WalkthroughUpdates the ChangesCLI Dependency and Compatibility Updates
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~5 minutes Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
tools/cli/services/k8s/config_builder.py (1)
12-15: 🩺 Stability & Availability | 🔵 Trivial | ⚡ Quick winUse
Traversablereads directly instead of converting to a string path.Line 12 currently assumes a filesystem path. Using
read_text()(oras_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
⛔ Files ignored due to path filters (1)
tools/poetry.lockis excluded by!**/*.lock
📒 Files selected for processing (3)
tools/cli/services/cloud/azure/azure_sdk.pytools/cli/services/k8s/config_builder.pytools/pyproject.toml
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:
SkuName/Kindfromazure.mgmt.storage.modelspkg_resources→ resolve bundled kubeconfig viaimportlib.resourcesanyio>=4.9for httpx-ws (via kr8s)Verified: lock+install, all subcommands import, flake8, PyInstaller frozen binary builds & resolves its bundled resource.
Summary by CodeRabbit