Skip to content

Comments

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

Merged
blueyed merged 1 commit intopytest-dev:masterfrom
blueyed:lf-typing-fixes
Feb 20, 2020
Merged

cacheprovider: fix typing with Path(py.path.local)#6774
blueyed merged 1 commit intopytest-dev:masterfrom
blueyed:lf-typing-fixes

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