chore: add type annotation to cloudinit.net.network_manager - #7120
Open
anujsingh-cse wants to merge 1 commit into
Open
anujsingh-cse wants to merge 1 commit into
anujsingh-cse wants to merge 1 commit into
Conversation
Removing cloudinit.net.network_manager from the mypy override list in pyproject.toml surfaces two errors on the same line. __init__ assigns the builtin str as the optionxform transform, the documented configparser idiom for preserving option name case. mypy cannot express assigning a class to a method, so it is ignored with a comment explaining why, matching the comment added in cloudinit/sources/helpers/vmware/imc/config_file.py. Refs canonicalGH-5445
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Proposed Commit Message
Additional Context
Refs GH-5445. Claimed in #5445 (comment).
Removing the module from the override list surfaces two errors:
self.config.optionxform = stris the documented configparser patternfor preserving option name case (NM requires it). mypy cannot express
assigning a class to a method, so the line is ignored — with a comment
documenting why, per the review feedback on #7098.
Test Steps
tox -e py3andtox -e check_formatto be confirmed by CI(developed on Windows where the full tox suite cannot run).
Merge type