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

Mypy syntax error in depthai/__init__.pyi #450

Closed
nrgsy opened this issue Dec 9, 2021 · 4 comments
Closed

Mypy syntax error in depthai/__init__.pyi #450

nrgsy opened this issue Dec 9, 2021 · 4 comments

Comments

@nrgsy
Copy link

nrgsy commented Dec 9, 2021

In a project that uses mypy type checking, I am seeing the following error when running mypy on a file that imports depthai:

/usr/local/lib/python3.8/dist-packages/depthai/__init__.pyi:7: error: invalid syntax  [syntax]
    import Calculation method used to obtain spatial locations
                        ^
Found 1 error in 1 file (errors prevented further checking)

That does indeed look like a syntax error, as if that line was supposed to be a comment but somehow the "#" got removed. I'm not really sure how the depthai package is working for me with a syntax error like this, but it does.

This situation looks similar to this mypy issue, and the solution they came up with was to simply get the syntax error fixed rather than find a way to ignore it.

Mypy's follow-imports=skip was supposedly another way to avoid the syntax error, but I had a hard time getting that to work and would like to avoid using that option anyway.

This occurred on depthai version 2.13.0.0. I reverted to depthai version 2.11.0.0 for now since that version doesn't seem to have this issue. I'm not sure where the source code is that results in the generation of this __init__.pyi, but it would be very much appreciated if the comment causing the error (and line below it with a similar syntax error) was removed or changed.

@Luxonis-Brandon
Copy link
Contributor

Thanks for the report. Will circle back tomorrow.

@themarpe
Copy link
Collaborator

themarpe commented Dec 9, 2021

Hi @nrgsy - thanks for report. I'll check it out and let you know.

@themarpe
Copy link
Collaborator

@nrgsy will be fixed soon - opened a PR for it:)

@nrgsy
Copy link
Author

nrgsy commented Dec 10, 2021

Thank you @themarpe !

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

No branches or pull requests

3 participants