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

Possible to release a patch version with fixes to mypy types? #251

Closed
rahuliyer95 opened this issue Aug 20, 2024 · 2 comments · Fixed by #255
Closed

Possible to release a patch version with fixes to mypy types? #251

rahuliyer95 opened this issue Aug 20, 2024 · 2 comments · Fixed by #255
Assignees
Labels
release ✨ Tracks new releases of universal-pathlib

Comments

@rahuliyer95
Copy link
Contributor

rahuliyer95 commented Aug 20, 2024

I am trying v0.2.2 and mypy is complaining about the type when / (__truediv__) is used to create a path with --warn-return-any flag with mypy. e.g.:

test.py
from typing_extensions import reveal_type
from upath import UPath


def foo() -> UPath:
    foo = UPath("s3://bucket/")
    bar = foo / "bar.json"
    reveal_type(bar)
    return bar
❯ mypy --warn-return-any test.py
test.py:8: note: Revealed type is "Any"
test.py:9: error: Returning Any from function declared to return "UPath"  [no-any-return]
Found 1 error in 1 file (checked 1 source file)

❯ python -m pip show universal_pathlib
Name: universal_pathlib
Version: 0.2.2
Summary: pathlib api extended to use fsspec backends
Home-page: https://github.com/fsspec/universal_pathlib
Author: 
Author-email: 
License: MIT
Location: /Users/rahuliyer/workspace/.venv/lib/python3.10/site-packages
Requires: fsspec
Required-by:

I believe this is because __truediv__ is defined in upath/_compat.py in v0.2.2 which got fixed with #212.

I was wondering if we can have a patch release which can fix the type checks? If not, I am okay waiting for v0.3.0 (#223)

@ap--
Copy link
Collaborator

ap-- commented Aug 20, 2024

Hi @rahuliyer95

I'll release an intermediate version this week, before working on v0.3.0

I'm a bit busy at work right now, but have time allocated for Thursday and Friday 😃

@rahuliyer95
Copy link
Contributor Author

Thank you very much 🙏🏽

@ap-- ap-- self-assigned this Aug 20, 2024
@ap-- ap-- added the release ✨ Tracks new releases of universal-pathlib label Aug 20, 2024
@ap-- ap-- closed this as completed in #255 Aug 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release ✨ Tracks new releases of universal-pathlib
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants