Skip to content

chore: add type annotations to cloudinit.distros.azurelinux - #7117

Open
wanjinhao1 wants to merge 1 commit into
canonical:mainfrom
wanjinhao1:agent/fix-5445-azurelinux-typing
Open

wanjinhao1 wants to merge 1 commit into
canonical:mainfrom
wanjinhao1:agent/fix-5445-azurelinux-typing

Conversation

@wanjinhao1

Copy link
Copy Markdown

Proposed Commit Message

chore: add type annotations to cloudinit.distros.azurelinux

Enable mypy check_untyped_defs for cloudinit.distros.azurelinux by
moving the distro attributes (network_conf_dir, systemd_locale_conf_fn,
resolve_conf_fn, network_conf_fn, renderer_configs) to class-level
attributes, matching the style already used by
cloudinit.distros.mariner, so their types are statically known. The
assigned values are unchanged, so runtime behavior is identical.

Refs GH-5445

Additional Context

Part of GH-5445 (check_untyped_defs mypy enablement). Per the tracking issue I left a comment claiming cloudinit.distros.azurelinux before starting.

network_conf_fn needs a # type: ignore[assignment] because the parent cloudinit.distros.rhel.Distro declares it as a str, while this distro (like debian/mariner) uses a dict for per-renderer paths.

No functional change, so no new unit tests and no doc updates are needed.

Test Steps

  • python3 -m mypy cloudinit/distros/azurelinux.py tests/unittests/distros/test_azurelinux.py → Success: no issues found
  • python3 -m pytest tests/unittests/distros/test_azurelinux.py → 2 passed
  • python3 -m ruff check, python3 -m black --check, python3 -m isort --check-only on the changed file → all pass

Merge type

  • Squash merge using "Proposed Commit Message"
  • Rebase and merge unique commits. Requires commit messages per-commit each referencing the pull request number (#<PR_NUM>)

AI assistance disclosure: this PR was prepared with AI coding assistance by the account owner (@wanjinhao1), who reviewed and verified the changes.

@holmanb

holmanb commented Oct 22, 2026

Copy link
Copy Markdown
Member

@wanjinhao1 please sign the CLA

@holmanb

holmanb commented Oct 22, 2026

Copy link
Copy Markdown
Member

Please sign the CLA and resolve conflicts

Enable mypy check_untyped_defs for cloudinit.distros.azurelinux by
moving distro attributes to class-level (matching the style used by
cloudinit.distros.mariner) so their types are statically known.

Refs canonicalGH-5445
@wanjinhao1
wanjinhao1 force-pushed the agent/fix-5445-azurelinux-typing branch from b3b8f3b to 86aaa4a Compare November 2, 2026 04:45
@wanjinhao1

Copy link
Copy Markdown
Author

Signed the CLA via ubuntu.com/legal/contributors, and rebased this branch onto current main (resolved the pyproject.toml mypy-override conflict: alpine stays on the ignore list, azurelinux is removed since this PR adds its type annotations). The cla check should be green on the new head — happy to take another look when you have a chance.

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.

2 participants