-
Notifications
You must be signed in to change notification settings - Fork 300
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
Add py.typed file to make CQ PEP-561 compatibile #435
Add py.typed file to make CQ PEP-561 compatibile #435
Conversation
This change signals to mypy that there is type annotations in the files and they should be used to validate type information for cadquery. See: https://mypy.readthedocs.io/en/stable/installed_packages.html#making-pep-561-compatible-packages
Codecov Report
@@ Coverage Diff @@
## master #435 +/- ##
=======================================
Coverage 93.58% 93.58%
=======================================
Files 25 25
Lines 5316 5316
Branches 554 554
=======================================
Hits 4975 4975
Misses 215 215
Partials 126 126 Continue to review full report at Codecov.
|
With this change there is at least one known problem, if a user has installed the OCP-stubs so
Then the my-splitting-and-mypy test fails:
But if you uninstall
I've no idea if this a problem with the OCP-stubs or |
Here is a simple sanity check not related to CQ: import OCP.gp
v = OCP.gp.gp_Vec()
x:int = v.X() running mypy on this code should result in one error being detected:
|
Result of sanity check is as you expected:
|
What do you get if you execute: mypy workplane.py
|
It runs fine for me:
Do you maybe have some uncommitted files in your cq source dir that are interfering? |
Here's some info, what mypy, python and OS versions are you using?
Also. just to be obvious, this has my change ontop of lastest master:
|
Another question, until I used either modified cadquery with "stubs" or added "py.typed" I had to use But apparently, you don't have to, how do you accomplish that? |
Well guess what, if I clone mypy and then I added the
When I use verbose mode there is one HUGE difference between mypy master
Here is a "snippet" of the logs for a second run of mypy 7.8.2
Where as with mypy master "all" files on second and subsequent runs begin with
I'd noticed that anomaly and was going to debug it with mypy master. |
This PR is ready for merging @winksaville , right ? Any thougths @jmwright ? |
I think it looks fine, but I'm relying somewhat on you guys since all of this mypy stuff is very new to me. |
This change signals to mypy that there is type annotations in the files
and they should be used to validate type information for cadquery.
See: https://mypy.readthedocs.io/en/stable/installed_packages.html#making-pep-561-compatible-packages