ARMmbed / mbed-os

Arm Mbed OS is a platform operating system designed for the internet of things
https://mbed.com
Other
4.67k stars 2.98k forks source link

mbed dm - SyntaxError as async keyword being #8143

Closed MarceloSalazar closed 6 years ago

MarceloSalazar commented 6 years ago

Description

Evaluating 5.10 (RC2) and the Pelion device management feature. I'm seeing Python errors as the keyword 'async' is being used:

$ mbed dm init -d "arm.com" --model-name "mbed" -v
[mbed] WARNING: If you're using Python 3 with Mbed OS 5.8 and earlier versions, Python errors will occur when compiling, testing and exporting
---
[mbed] Working path "/Users/ms/mbed/OOB/5.10/mbed-cloud-client-example-sources-internal" (program)
[mbed] Auto-installing missing Python modules...
[mbed] Exec "/usr/local/opt/python/bin/python3.7 -u /Users/ms/mbed/OOB/5.10/mbed-cloud-client-example-sources-internal/mbed-os/tools/device_management.py init -d arm.com --model-name mbed" in "/Users/ms/mbed/OOB/5.10/mbed-cloud-client-example-sources-internal"
Traceback (most recent call last):
  File "/Users/ms/mbed/OOB/5.10/mbed-cloud-client-example-sources-internal/mbed-os/tools/device_management.py", line 30, in <module>
    from mbed_cloud import AccountManagementAPI, CertificatesAPI
  File "/usr/local/lib/python3.7/site-packages/mbed_cloud/__init__.py", line 22, in <module>
    from mbed_cloud.account_management import AccountManagementAPI
  File "/usr/local/lib/python3.7/site-packages/mbed_cloud/account_management/__init__.py", line 1, in <module>
    from .account_management import AccountManagementAPI
  File "/usr/local/lib/python3.7/site-packages/mbed_cloud/account_management/account_management.py", line 29, in <module>
    from mbed_cloud._backends import iam
  File "/usr/local/lib/python3.7/site-packages/mbed_cloud/_backends/iam/__init__.py", line 53, in <module>
    from .apis.account_admin_api import AccountAdminApi
  File "/usr/local/lib/python3.7/site-packages/mbed_cloud/_backends/iam/apis/__init__.py", line 4, in <module>
    from .account_admin_api import AccountAdminApi
  File "/usr/local/lib/python3.7/site-packages/mbed_cloud/_backends/iam/apis/account_admin_api.py", line 137
    async=params.get('async'),
        ^
SyntaxError: invalid syntax
[mbed] ERROR: "/usr/local/opt/python/bin/python3.7" returned error.
       Code: 1
       Path: "/Users/ms/mbed/OOB/5.10/mbed-cloud-client-example-sources-internal"
       Command: "/usr/local/opt/python/bin/python3.7 -u /Users/ms/mbed/OOB/5.10/mbed-cloud-client-example-sources-internal/mbed-os/tools/device_management.py init -d arm.com --model-name mbed"
       Tip: You could retry the last command with "-v" flag for verbose output

Environment OSX El Capital Mbed CLI 1.8.1 Python 3.7

Environement [ ] Question
[ ] Enhancement
[X] Bug

teetak01 commented 6 years ago

Its possible that this is fixed in SDK version 2.0.1

MarceloSalazar commented 6 years ago

@teetak01 you're correct. We should update this line https://github.com/ARMmbed/mbed-os/blob/mbed-os-5.10/requirements.txt#L19

ciarmcom commented 6 years ago

ARM Internal Ref: MBOTRIAGE-1663

cmonr commented 6 years ago

Will be fixed with https://github.com/ARMmbed/mbed-os/pull/8160