Skip to content

Support Python 3.10 - #250

Merged
Jiashuo Li (jiasli) merged 3 commits into
microsoft:devfrom
jiasli:py310
Nov 3, 2021
Merged

Support Python 3.10#250
Jiashuo Li (jiasli) merged 3 commits into
microsoft:devfrom
jiasli:py310

Conversation

@jiasli

Copy link
Copy Markdown
Contributor

Supporting Python 3.10 in Knack is the prerequisite for

Comment thread requirements.txt
pylint==2.7.2
pytest==6.2.2
pylint==2.11.1
pytest==6.2.5

@jiasli Jiashuo Li (jiasli) Oct 13, 2021

Copy link
Copy Markdown
Contributor Author

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
Jiashuo Li (jiasli) marked this pull request as ready for review October 26, 2021 04:08
Comment thread knack/config.py
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
Copy Markdown
Contributor 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

Comment thread requirements.txt
Pygments==2.8.1
pylint==2.7.2
pytest==6.2.2
pylint==2.11.1

Copy link
Copy Markdown
Contributor 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.

Comment thread .pylintrc
# 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
Copy Markdown
Contributor 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.

@wangzelin007 ZelinWang (wangzelin007) left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM

@jiasli
Jiashuo Li (jiasli) merged commit e496c95 into microsoft:dev Nov 3, 2021
@jiasli
Jiashuo Li (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