liormizr / s3path

s3path is a pathlib extension for AWS S3 Service
Apache License 2.0
206 stars 39 forks source link

Add typing to the public interface #128

Closed gabrieldemarmiesse closed 1 year ago

gabrieldemarmiesse commented 1 year ago

Hi!

We want to replace an internal too by this lib. One issue we see is that our internal tool has the public interface typed and it's very useful when working in an IDE. The autocompletion is much better.

I can give you a very simple example that doesn't work with pycharm:

from s3path import S3Path
for bucket in S3Path("/").iterdir():
    bucket.

here pycharm can't autocomplete because it doesn't know the type of bucket. Specifying S3Path as a return type should be enough in this situation.

I can provide pull requests to add types to the public api (only, typing the internal codebase doesn't help the users). Would you be open to such pull requests?

EDIT: To make full use of the power of typing, we should bump the minimum version of python required for s3path. Ideally set it to 3.8 instead of 3.6 (currently it's 3.6 in the setup.py). Here are the end-of-life for the different python versions: https://endoflife.date/python

liormizr commented 1 year ago

Hi @gabrieldemarmiesse

That is a great idea I'm open for a PR like this.

Thanks you and I'm happy to here that s3path solve your needs

liormizr commented 1 year ago

Merged the PR's We will update here when deploying the new version

liormizr commented 1 year ago

Deployed in version 0.5.0