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

fails to import on a mac/Python 3.5 #12

Closed
amozgovoy opened this issue Aug 12, 2020 · 3 comments
Closed

fails to import on a mac/Python 3.5 #12

amozgovoy opened this issue Aug 12, 2020 · 3 comments

Comments

@amozgovoy
Copy link

$ pip list
Package         Version
--------------- ------------
ansible         2.9.12
awscli          1.18.116
boto3           1.14.39
botocore        1.17.39
botostubs       0.12.1.14.38
cffi            1.14.1
colorama        0.4.3
cryptography    3.0
docutils        0.15.2
Jinja2          2.11.2
jmespath        0.10.0
MarkupSafe      1.1.1
pip             20.2.1
pyasn1          0.4.8
pycparser       2.20
python-dateutil 2.8.1
PyYAML          5.3.1
rsa             4.5
s3transfer      0.3.3
setuptools      28.8.0
six             1.15.0
urllib3         1.25.10
wheel           0.34.2
$ python
Python 3.5.9 (default, Jul  6 2020, 09:15:33)
[GCC 4.2.1 Compatible Apple LLVM 11.0.3 (clang-1103.0.32.62)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import botostubs
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "~/.envs/python3_5/lib/python3.5/site-packages/botostubs/__init__.py", line 15824
    stack_id: str=None
            ^
SyntaxError: invalid syntax

works just fine with Python 3.6

@amozgovoy
Copy link
Author

amozgovoy commented Aug 12, 2020

there is a slight version mismatch between botostubs and boto3, so I've created a fresh virtual environment and installed the versions to match via pip install boto3==1.14.38 botostubs==0.12.1.14.38

$ pip list
Package         Version
--------------- ------------
boto3           1.14.38
botocore        1.17.40
botostubs       0.12.1.14.38
docutils        0.15.2
jmespath        0.10.0
pip             20.2.2
python-dateutil 2.8.1
s3transfer      0.3.3
setuptools      28.8.0
six             1.15.0
urllib3         1.25.10
wheel           0.34.2
$ python
Python 3.5.9 (default, Jul  6 2020, 09:15:33)
[GCC 4.2.1 Compatible Apple LLVM 11.0.3 (clang-1103.0.32.62)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import botostubs
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "~/.envs/p3_5/lib/python3.5/site-packages/botostubs/__init__.py", line 15824
    stack_id: str=None
            ^
SyntaxError: invalid syntax

@jeshan
Copy link
Owner

jeshan commented Aug 12, 2020

Thanks for letting me know, Alex.
My mistake was to enforce python>=3.5 . It should be python>=3.6 instead for PEP 526

We could always make the code compatible with older versions but I don't have time to look into it. Would you like to contribute?

Else, see if the boto3-stubs project works better for you.

P.S: botostubs and boto3 versions do not strictly have to match.

@amozgovoy
Copy link
Author

thank you, I'm ok with using 3.6 in dev. botostubs works better for me as it requires less code change, compared to boto3-stubs. Also it works without mypy and doesn't have a dependency on any other plugin in PyCharm.

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

No branches or pull requests

2 participants