Skip to content

Support Python 3.10#250

Merged
jiasli merged 3 commits intomicrosoft:devfrom
jiasli:py310
Nov 3, 2021
Merged

Support Python 3.10#250
jiasli merged 3 commits intomicrosoft:devfrom
jiasli:py310

Conversation

@jiasli
Copy link
Member

@jiasli jiasli commented Oct 13, 2021

Supporting Python 3.10 in Knack is the prerequisite for

pylint==2.7.2
pytest==6.2.2
pylint==2.11.1
pytest==6.2.5
Copy link
Member Author

@jiasli jiasli Oct 13, 2021

Choose a reason for hiding this comment

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

Old pytest fails in Python 3.10: pytest-dev/pytest#8546 (comment)

=============================================== short test summary info ===============================================
ERROR tests/test_cli_scenarios.py - TypeError: required field "lineno" missing from alias
ERROR tests/test_command_registration.py - TypeError: required field "lineno" missing from alias
ERROR tests/test_command_with_configured_defaults.py - TypeError: required field "lineno" missing from alias
ERROR tests/test_completion.py - TypeError: required field "lineno" missing from alias
ERROR tests/test_config.py - TypeError: required field "lineno" missing from alias
ERROR tests/test_deprecation.py - TypeError: required field "lineno" missing from alias
ERROR tests/test_experimental.py - TypeError: required field "lineno" missing from alias
ERROR tests/test_help.py - TypeError: required field "lineno" missing from alias
ERROR tests/test_introspection.py - TypeError: required field "lineno" missing from alias
ERROR tests/test_log.py - TypeError: required field "lineno" missing from alias
ERROR tests/test_output.py - TypeError: required field "lineno" missing from alias
ERROR tests/test_parser.py - TypeError: required field "lineno" missing from alias
ERROR tests/test_preview.py - TypeError: required field "lineno" missing from alias
ERROR tests/test_prompting.py - TypeError: required field "lineno" missing from alias
ERROR tests/test_query.py - TypeError: required field "lineno" missing from alias
ERROR tests/test_util.py - TypeError: required field "lineno" missing from alias

@jiasli jiasli marked this pull request as ready for review October 26, 2021 04:08
def set(self, config):
ensure_dir(self.config_dir)
with open(self.config_path, 'w') as configfile:
with open(self.config_path, 'w', encoding=CONFIG_FILE_ENCODING) as configfile:
Copy link
Member Author

Choose a reason for hiding this comment

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

pylint warns:

knack\config.py:225:13: W1514: Using open without explicitly specifying an encoding (unspecified-encoding)

See https://pylint.pycqa.org/en/latest/technical_reference/features.html#stdlib-checker-messages

Pygments==2.8.1
pylint==2.7.2
pytest==6.2.2
pylint==2.11.1
Copy link
Member Author

Choose a reason for hiding this comment

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

New pylint is more strict on grammar. We need to fix these additional check failures.

@jiasli jiasli mentioned this pull request Oct 26, 2021
6 tasks
@jiasli jiasli requested review from calvinhzy and evelyn-ys October 26, 2021 06:24
# R1717 consider-using-dict-comprehension
disable=W0511,C0111,C0103,C0415,I0011,R0913,R0903,R0401,R0205,R1717,useless-suppression
disable=W0511,C0111,C0103,C0415,I0011,R0913,R0903,R0401,R0205,R1717,useless-suppression,
consider-using-f-string
Copy link
Member Author

Choose a reason for hiding this comment

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

There are countless places where str.format is used. We should allow it.

Copy link
Member

@wangzelin007 wangzelin007 left a comment

Choose a reason for hiding this comment

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

LGTM

@jiasli jiasli merged commit e496c95 into microsoft:dev Nov 3, 2021
@jiasli jiasli deleted the py310 branch November 3, 2021 09:32
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.

3 participants