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

[Packaging] Support Python 3.10 #20195

Merged
merged 6 commits into from
Nov 5, 2021
Merged

[Packaging] Support Python 3.10 #20195

merged 6 commits into from
Nov 5, 2021

Conversation

jiasli
Copy link
Member

@jiasli jiasli commented Nov 4, 2021

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
Collaborator

yonzhan commented Nov 4, 2021

Packaging

@@ -132,7 +132,7 @@ scp==0.13.2
semver==2.13.0
six==1.14.0
sshtunnel==0.1.5
tabulate==0.8.3
tabulate==0.8.9
Copy link
Member Author

@jiasli jiasli Nov 4, 2021

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.

@jiasli jiasli mentioned this pull request Nov 4, 2021
3 tasks
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

@Azure Azure deleted a comment from jiasli Nov 5, 2021
Comment on lines -95 to -96
if enable_color:
message = Style.BRIGHT + message + Style.RESET_ALL
Copy link
Member 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.

@jiasli jiasli merged commit 8264073 into Azure:dev Nov 5, 2021
@jiasli jiasli deleted the py310-2 branch November 5, 2021 06:33
@@ -136,6 +137,7 @@
'azure-synapse-managedprivateendpoints~=0.3.0',
'azure-synapse-spark~=0.2.0',
'chardet~=3.0.4',
'colorama~=0.4.4',
Copy link
Member 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
Member Author

jiasli commented Nov 17, 2021

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

@jiasli
Copy link
Member Author

jiasli commented Nov 26, 2021

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