devopsarr / prowlarr-py

python SDK for Prowlarr
Mozilla Public License 2.0
4 stars 1 forks source link

No `py.typed` marker file in the package #10

Closed Callum027 closed 8 months ago

Callum027 commented 1 year ago

Hi there,

I'm looking to use this library in one of my projects. I use type hinting extensively within it, and while the type hints for prowlarr-py seem to work properly when read using Pylance, Mypy complains it cannot read type hints from the package (and probably the other API packages) because there is no py.typed file, or stubs package.

Here is the resulting error when trying to run Mypy on a test file when the prowlarr-py package is installed:

import prowlarr

prowlarr.ApiClient()

Mypy output:

$ mypy test.py
test.py:1: error: Skipping analyzing "prowlarr": module is installed, but missing library stubs or py.typed marker  [import]
test.py:1: note: See https://mypy.readthedocs.io/en/stable/running_mypy.html#missing-imports
Found 1 error in 1 file (checked 1 source file)

For more information on what the py.typed file does, refer to PEP-561.

Fuochi commented 1 year ago

Hi @Callum027, I can add the py.typed to packages if that will help you. However, I'm not confident that everything has been typed properly. Still, will this work for you?

Callum027 commented 1 year ago

py.typed is basically the same thing as advertising that your package supports type hints, and you are reasonably sure they are correct.

I've been able to continue on without py.typed being there as well, so I think there's no need to put it in prematurely.

For more context, here is where I'm using your library: https://github.com/buildarr/buildarr-prowlarr

Fuochi commented 1 year ago

ok, cool project. On next library change I'll go a bit further in type hinting to se if I can enable the same. I'll keep this issue open as a reminder! Thanks

Fuochi commented 8 months ago

Added in v1.0.0