-
Notifications
You must be signed in to change notification settings - Fork 43
Do not import boto3 when using PureS3Path #164
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
Comments
Hi @iamthebot In any case I'll think when kind of lazy can we do, maybe we can solve issue #122 at the same time
|
@liormizr yeah, boto3 is totally fine as a requirement/dependency. That's totally reasonable. I guess if you wanted to address #122 technically boto3 could be an optional requirement (and if it's not available only What would be nice to do is delay boto3 import/initialization until it's needed for eg; I believe we can do this only for Python 3.12 onwards. I don't think this needs to be backported, tbh. |
@iamthebot how much time boto3 adds? |
@liormizr that initialization is variable but between 100-300ms last I tested it. P99 of 500ms but that's fairly rare. |
@iamthebot I learned something new 😊 BTW smart-open also imported boto3 so it need's to be lazy as well. PR is ready You are more then welcome to review |
Thank you @liormizr! Happy to test it on Friday (pretty busy today and tomorrow) if that's not too late. |
This LGTM! |
Version 0.5.3 deployed |
@iamthebot we found an issue with our laze import |
0.5.5 was deployed with the fix. |
@iamthebot conda-forge package was deployed |
This is different from #122 -- basically, we're using
PureS3Path
in a CLI. Currently, as written, importings3path
also imports boto3, does some initialization, etc. This is relatively slow which impacts the CLI responsiveness. We've made the import lazy as a workaround but this means not being able to eg; usePureS3Path
for type hints.Rather than making boto3 an optional dependency, can we make the boto3 import/initialization not occur for PureS3Path?
The text was updated successfully, but these errors were encountered: