Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support Python 3.10 #250

Merged
merged 3 commits into from
Nov 3, 2021
Merged

Support Python 3.10 #250

merged 3 commits into from
Nov 3, 2021

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
@@ -220,7 +222,7 @@ def getboolean(self, section, option):

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

jmespath==0.10.0
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.

@@ -10,7 +10,8 @@
# R0401 cyclic-import
# R0205 useless-object-inheritance
# 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