-
-
Notifications
You must be signed in to change notification settings - Fork 32
Add basic scaffolding for distributing the package #4
Conversation
dd6e3c2
to
cd73c4e
Compare
numpy/__init__.pyi
Outdated
class dtype: pass | ||
|
||
def array( | ||
object : object, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: PEP8 suggests not using a space before :
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, it does? Shoot, I've been doing that wrong everywhere in my own code.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See "Function annotations" under http://legacy.python.org/dev/peps/pep-0008/#other-recommendations
@@ -0,0 +1,12 @@ | |||
# very simple, just enough to start running tests | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should add annotations def __getattr__(name) -> Any: ...
to the module and def __getattr__(self, name) -> Any: ...
to ndarray
/dtype
to mark them as flexibly typed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure what you mean about adding it to the module. Is that supported in type stubs? It's certain not supported in normal python,
I think best to leave them absent anyway, so that adding tests forces us to define the missing fields, rather than things passing silently
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, OK, we can leave it out for now. It is indeed valid in stub files (only).
It doesn't appear that the released mypy supports _stub packages right now, so for now we have to add to MYPYPATH manually. Something else to consider is how to sync versions with numpy, but we can deal with that later, if we start our numbers low enough. This adds a very small number of stubs just to verify that installation maybe works. Fixes numpy#2
Updated to address PEP8 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, this looks good to me. Let's get started on this!
It doesn't appear that the released mypy supports _stub packages right now, so for now we have to add to MYPYPATH manually.
Something else to consider is how to sync versions with numpy, but we can deal with that later, if we start our numbers low enough.
This adds a very small number of stubs just to verify that installation maybe works.
Fixes #2.