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

types-aiobotocore[s3] requires boto3 #337

Closed
dmkulazhenko opened this issue Dec 27, 2024 · 3 comments
Closed

types-aiobotocore[s3] requires boto3 #337

dmkulazhenko opened this issue Dec 27, 2024 · 3 comments
Labels
🐞 bug Something isn't working 🎉 released Changes were included to the latest release 👋 response needed Awaiting response from a reporter

Comments

@dmkulazhenko
Copy link

Describe the bug
Generated types_aiobotocore_s3/client.py on line 27 looks like:

from boto3.s3.transfer import TransferConfig

which obviously leads to ImportError as far as boto3 is not required for either aiobotocore or types-aiobotocore packages.
(seems to be it's accidental import as far as none of boto3 should be used here 🤔)

To Reproduce
Steps to reproduce the behavior:

~/.pyenv/versions/3.12.4/bin/python -m venv venv
source venv/bin/activate

pip install types-aiobotocore[s3] aiobotocore

python -c "import types_aiobotocore_s3"

Actual output

Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/home/.../Temp/venv/lib/python3.12/site-packages/types_aiobotocore_s3/__init__.py", line 49, in <module>
    from .client import S3Client
  File "/home/.../Temp/venv/lib/python3.12/site-packages/types_aiobotocore_s3/client.py", line 27, in <module>
    from boto3.s3.transfer import TransferConfig
ModuleNotFoundError: No module named 'boto3'

Additional context
Your OS, types-boto3 installation method, boto3 version, etc.
Os: 6.1.112-1-MANJARO / Ubuntu 22/23/24 / Amazon Linux 2
Installation method: pip / uv
Pip freeze:

aiobotocore==2.16.1
aiohappyeyeballs==2.4.4
aiohttp==3.11.11
aioitertools==0.12.0
aiosignal==1.3.2
attrs==24.3.0
botocore==1.35.88
botocore-stubs==1.35.88
frozenlist==1.5.0
idna==3.10
jmespath==1.0.1
multidict==6.1.0
propcache==0.2.1
python-dateutil==2.9.0.post0
six==1.17.0
types-aiobotocore==2.16.1
types-aiobotocore-s3==2.16.1
types-awscrt==0.23.6
urllib3==2.3.0
wrapt==1.17.0
yarl==1.18.3
@dmkulazhenko dmkulazhenko added the 🐞 bug Something isn't working label Dec 27, 2024
@dmkulazhenko dmkulazhenko changed the title types-aiobotocore-s3 requires boto3 without listing in requirements types-aiobotocore[s3] requires boto3 Dec 27, 2024
@vemel
Copy link
Collaborator

vemel commented Dec 27, 2024

Thank you for the bug report. Yes, imports in client.pyi/py should use try-expect fallback. I will fix it in the upcoming release.

@vemel vemel added 👋 response needed Awaiting response from a reporter 🎉 released Changes were included to the latest release labels Dec 28, 2024
@vemel
Copy link
Collaborator

vemel commented Dec 28, 2024

Fixed in the latest release: https://github.com/youtype/mypy_boto3_builder/releases/tag/8.7.1

Please update and let me know if it works as expected.

@dmkulazhenko
Copy link
Author

@vemel, it works for me, thanks for quick fix ❤️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐞 bug Something isn't working 🎉 released Changes were included to the latest release 👋 response needed Awaiting response from a reporter
Projects
None yet
Development

No branches or pull requests

2 participants