Skip to content

[Packaging] Support Python 3.10 - #20195

Merged
Jiashuo Li (jiasli) merged 6 commits into
Azure:devfrom
jiasli:py310-2
Nov 5, 2021
Merged

[Packaging] Support Python 3.10#20195
Jiashuo Li (jiasli) merged 6 commits into
Azure:devfrom
jiasli:py310-2

Conversation

@jiasli

@jiasli Jiashuo Li (jiasli) commented Nov 4, 2021

Copy link
Copy Markdown
Contributor

Description

Close #19857

Python 3.10 has been released on 2021-10-04: https://www.python.org/downloads/

Azure CLI needs to support Python 3.10 like how we supported 3.9.

References

@yonzhan

Copy link
Copy Markdown
Collaborator

Packaging

six==1.14.0
sshtunnel==0.1.5
tabulate==0.8.3
tabulate==0.8.9

@jiasli Jiashuo Li (jiasli) Nov 4, 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 tabulate uses string to compare version, resulting in "10" < "3", which is certainly wrong.

    if python_version_tuple() >= ("3", "3", "0"):
        from collections.abc import Iterable
    else:
>       from collections import Iterable
E       ImportError: cannot import name 'Iterable' from 'collections' (/opt/hostedtoolcache/Python/3.10.0/x64/lib/python3.10/collections/__init__.py)

env/lib/python3.10/site-packages/tabulate.py:16: ImportError

This is fixed by astanin/python-tabulate#105.

@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

Comment on lines -95 to -96
if enable_color:
message = Style.BRIGHT + message + Style.RESET_ALL

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.

We remove the color here as it outshines whole original help messages and examples.

Comment thread src/azure-cli/setup.py
'azure-synapse-managedprivateendpoints~=0.3.0',
'azure-synapse-spark~=0.2.0',
'chardet~=3.0.4',
'colorama~=0.4.4',

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.

colorama was removed from Knack for non-Windows systems (microsoft/knack#249), but azure-cli still needs it.

@jiasli

Copy link
Copy Markdown
Contributor Author

Still seeing DeprecationWarnings from pywin32. Reported at mhammond/pywin32#1802.

@jiasli

Jiashuo Li (jiasli) commented Nov 26, 2021

Copy link
Copy Markdown
Contributor Author

Installing psutil fails without Microsoft Visual C++, and there is no fix yet.

  ERROR: Command errored out with exit status 1:
   command: 'D:\test-envs\test310\Scripts\python.exe' -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\jiasli\\AppData\\Local\\Temp\\pip-install-ds9qtdad\\psutil_edc519ddccee4418ba33c3e0ff32ce49\\setup.py'"'"'; __file__='"'"'C:\\Users\\jiasli\\AppData\\Local\\Temp\\pip-install-ds9qtdad\\psutil_edc519ddccee4418ba33c3e0ff32ce49\\setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d 'C:\Users\jiasli\AppData\Local\Temp\pip-wheel-2caa_k7a'
       cwd: C:\Users\jiasli\AppData\Local\Temp\pip-install-ds9qtdad\psutil_edc519ddccee4418ba33c3e0ff32ce49\
  Complete output (38 lines):
  ...
  copying psutil\tests\__main__.py -> build\lib.win-amd64-3.10\psutil\tests
  running build_ext
  building 'psutil._psutil_windows' extension
  error: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/
  ----------------------------------------
  ERROR: Failed building wheel for psutil
  Running setup.py clean for psutil

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.

Support Python 3.10

4 participants