microsoft / knack

Knack - A Python command line interface framework
https://pypi.python.org/pypi/knack
MIT License
347 stars 95 forks source link

Test Python 3.11 #260

Closed tonybaloney closed 1 year ago

tonybaloney commented 2 years ago

This PR adds Python 3.11 to the test matrix.

3.11 hits release candidate in a few weeks

tonybaloney commented 2 years ago

The Python images for pipelines are out of date and the documentation links are broken :-/

Have you considering switching CI to Github Actions yet?

wangzelin007 commented 2 years ago

/azp list

wangzelin007 commented 1 year ago

/azp run

azure-pipelines[bot] commented 1 year ago
Azure Pipelines successfully started running 1 pipeline(s).
wangzelin007 commented 1 year ago

/azp where

azure-pipelines[bot] commented 1 year ago
Azure DevOps orgs getting events for this repository:
jiasli commented 1 year ago

Azure DevOps pipeline doesn't have Python 3.11 available right now:

image

which is tracked by

So we have to wait until Azure DevOps pipeline has Python 3.11 available.

jiasli commented 1 year ago

/azp run

azure-pipelines[bot] commented 1 year ago
Azure Pipelines successfully started running 1 pipeline(s).
jiasli commented 1 year ago

CI fails:

https://dev.azure.com/azclitools/public/_build/results?buildId=18451&view=logs&jobId=9af7c6b6-85f2-5509-5b39-c09353ced287&j=9af7c6b6-85f2-5509-5b39-c09353ced287&t=5ea479ae-b0a5-5296-d41f-6c93c3232daa

Traceback (most recent call last):
  File "/mnt/vss/_work/1/s/.tox/py311/bin/pylint", line 8, in <module>
    sys.exit(run_pylint())
             ^^^^^^^^^^^^
  File "/mnt/vss/_work/1/s/.tox/py311/lib/python3.11/site-packages/pylint/__init__.py", line 21, in run_pylint
    from pylint.lint import Run as PylintRun
  File "/mnt/vss/_work/1/s/.tox/py311/lib/python3.11/site-packages/pylint/lint/__init__.py", line 76, in <module>
    from pylint.lint.parallel import check_parallel
  File "/mnt/vss/_work/1/s/.tox/py311/lib/python3.11/site-packages/pylint/lint/parallel.py", line 8, in <module>
    from pylint import reporters
  File "/mnt/vss/_work/1/s/.tox/py311/lib/python3.11/site-packages/pylint/reporters/__init__.py", line 26, in <module>
    from pylint import utils
  File "/mnt/vss/_work/1/s/.tox/py311/lib/python3.11/site-packages/pylint/utils/__init__.py", line 46, in <module>
    from pylint.utils.ast_walker import ASTWalker
  File "/mnt/vss/_work/1/s/.tox/py311/lib/python3.11/site-packages/pylint/utils/ast_walker.py", line 7, in <module>
    from astroid import nodes
  File "/mnt/vss/_work/1/s/.tox/py311/lib/python3.11/site-packages/astroid/__init__.py", line 51, in <module>
    from astroid.nodes import node_classes, scoped_nodes
  File "/mnt/vss/_work/1/s/.tox/py311/lib/python3.11/site-packages/astroid/nodes/__init__.py", line 27, in <module>
    from astroid.nodes.node_classes import (  # pylint: disable=redefined-builtin (Ellipsis)
  File "/mnt/vss/_work/1/s/.tox/py311/lib/python3.11/site-packages/astroid/nodes/node_classes.py", line 47, in <module>
    from astroid import decorators, mixins, util
  File "/mnt/vss/_work/1/s/.tox/py311/lib/python3.11/site-packages/astroid/decorators.py", line 27, in <module>
    import wrapt
  File "/mnt/vss/_work/1/s/.tox/py311/lib/python3.11/site-packages/wrapt/__init__.py", line 10, in <module>
    from .decorators import (adapter_factory, AdapterFactory, decorator,
  File "/mnt/vss/_work/1/s/.tox/py311/lib/python3.11/site-packages/wrapt/decorators.py", line 34, in <module>
    from inspect import ismethod, isclass, formatargspec
ImportError: cannot import name 'formatargspec' from 'inspect' (/opt/hostedtoolcache/Python/3.11.0/x64/lib/python3.11/inspect.py)
ERROR: InvocationError for command /mnt/vss/_work/1/s/.tox/py311/bin/pylint knack --rcfile=.pylintrc -r n -d I0013 (exited with code 1)

This could be related to https://github.com/Azure/azure-cli/pull/24111

jiasli commented 1 year ago

Only adding Python 3.11 tests is far from enough. Libraries declared in requirements.txt also need to be upgraded in order to support Python 3.11.

We will continue the work in https://github.com/microsoft/knack/pull/275.