liormizr / s3path

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

Missing types available to mypy? (as far as I can tell) #155

Closed alexjbuck closed 6 months ago

alexjbuck commented 6 months ago

I'm getting lots of Return type becomes "Any" due to an unfollowed import errors from MyPy related to using the S3Path class.

I'm not sure why, my MyPy configuration should be following imports to get type annotation (it does for all my other dependencies).

here is an MVP that throws the mypy error in my setup:

def make_path(uri: str) -> S3Path:
    return S3Path.from_uri(uri)

Return type becomes "Any" due to an unfollowed import mypy[no-any-unimported]

alexjbuck commented 6 months ago

If this is something wrong with my local config, unrelated to s3path, apologies. Its not an issue I see with other libraries though.

rggjan commented 2 months ago

I think this is a real issue due to a missing py.typed file, see https://mypy.readthedocs.io/en/stable/installed_packages.html#creating-pep-561-compatible-packages and https://peps.python.org/pep-0561/

rggjan commented 2 months ago

mypy will ignore all typing information when that file is missing... cc @liormizr

liormizr commented 1 month ago

@rggjan I opened a dedicated issue for your request #176 Thanks