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

chore: Export intended public imports #76

Merged
merged 1 commit into from
Sep 4, 2023

Conversation

Jeremiah-England
Copy link
Contributor

It looks like MyPy and Pyright currently require imports like these to be re-exported in order to be used. Doing this raises a lint error for me due to Pyright:

import aw_client

aw_client.ActivityWatchClient()  # "ActivityWatchClient" is not exported from module "aw_client"

Ref: https://github.com/microsoft/pyright/blob/main/docs/typed-libraries.md#library-interface
Ref: microsoft/pyright#3409
Ref: python/mypy#8754 (comment)


I assume the noqa was to handle the ActivityWatchClient symbol not being used. My linter doesn't complain about it being unused anymore because it special cases for the __all__ elements even though they are strings. I'm guessing you're linter is the same way but it not you'll probably want to remove that edit.

It looks like MyPy and Pyright currently require imports like these to
be re-exported in order to be used. Doing this raises a lint error for
me due to Pyright:

```python
import aw_client

aw_client.ActivityWatchClient()  # "ActivityWatchClient" is not exported from module "aw_client"
```

Ref: https://github.com/microsoft/pyright/blob/main/docs/typed-libraries.md#library-interface
Ref: microsoft/pyright#3409
Ref: python/mypy#8754 (comment)
@ErikBjare
Copy link
Member

Ah, you're right about this.

I've learned the same as well since, but not revisited here.

Thanks!

@ErikBjare ErikBjare merged commit 2517cb1 into ActivityWatch:master Sep 4, 2023
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