Skip to content

cacheprovider: fix typing with Path(py.path.local) #6774

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

Merged
merged 1 commit into from
Feb 20, 2020

Conversation

blueyed
Copy link
Contributor

@blueyed blueyed commented Feb 20, 2020

Fixes:

Argument 1 to "Path" has incompatible type "Union[local, Any]";
expected "Union[str, _PathLike[str]]" [arg-type]

Ref: pytest-dev/py#232 (review)

Fixes:

> Argument 1 to "Path" has incompatible type "Union[local, Any]";
> expected "Union[str, _PathLike[str]]"  [arg-type]

Ref: pytest-dev/py#232 (review)
@blueyed blueyed requested a review from bluetech February 20, 2020 09:59
@bluetech
Copy link
Member

Is it possible you are not using the latest version of the py PR? The latest has

_PathType = Union[bytes, Text, _PathLike[Any], local]

class local:
     def __init__(self, path: _PathType = ..., expanduser: bool = ...) -> None: ...

so this error should not happen.

@blueyed

This comment has been minimized.

@blueyed blueyed closed this Feb 20, 2020
@blueyed blueyed deleted the lf-typing-fixes branch February 20, 2020 11:05
@blueyed blueyed restored the lf-typing-fixes branch February 20, 2020 11:08
@blueyed
Copy link
Contributor Author

blueyed commented Feb 20, 2020

@bluetech
No, it does not work - the issue is with py.path.local put into Path().

Sorry for the extra noise, I've only tried tox -e mypy on master, which does not use the stubs.. ;)

@blueyed blueyed reopened this Feb 20, 2020
Copy link
Member

@bluetech bluetech left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh I got confused. Yeah this LGTM.

@blueyed blueyed merged commit 4d633a2 into pytest-dev:master Feb 20, 2020
@blueyed blueyed deleted the lf-typing-fixes branch February 20, 2020 12:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants