Open alexlukas opened 5 months ago
Hi, appreciate you opening this issue here! I can definitely see about adding this tomorrow. Since this is new to me, would you know how I can test to make sure it works before I publish the change to the package?
Hey @MylesMor — here's a possible way of testing this kind of thing in a GitHub Actions workflow:
jobs:
check-pep561-compliance:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
path: invoke
- uses: actions/setup-python@v4
with:
python-version: "3.11"
- run: |
pip install mypy
pip install ./nanoleafapi
mkdir newdir
cd newdir
mypy -c "import nanoleafapi"
The job should fail with mypy errors without the py.typed file, but pass if the py.typed file has been properly added (including the packaging changes @alexlukas mentioned above, which are necessary to ensure that the file gets included in the wheel)
Thanks, appreciate this! Unfortunately was super busy today but will hopefully get around to this tomorrow.
I was a little too fast and created some stubs for the typeshed project in order to allow for type checking code using this library according to PEP 561 (see here for the pull request). However, I was made aware that most of this library is already typed, so to enable type checking for nanoleafapi, all one has to do is
py.typed
filesetup.py
This would explicitly allow type checking for nanoleafapi, e.g. in VS Code.