Skip to content
This repository has been archived by the owner on Jun 10, 2020. It is now read-only.

Add basic scaffolding for distributing the package #4

Merged
merged 1 commit into from
Jan 17, 2018

Conversation

eric-wieser
Copy link
Member

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.

@eric-wieser eric-wieser force-pushed the scaffold branch 4 times, most recently from dd6e3c2 to cd73c4e Compare December 6, 2017 07:00
class dtype: pass

def array(
object : object,
Copy link
Member

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 :

Copy link
Member Author

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.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@@ -0,0 +1,12 @@
# very simple, just enough to start running tests

Copy link
Member

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.

Copy link
Member Author

@eric-wieser eric-wieser Dec 13, 2017

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

Copy link
Member

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
@eric-wieser
Copy link
Member Author

Updated to address PEP8

Copy link
Member

@shoyer shoyer left a 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!

@shoyer shoyer merged commit c66c165 into numpy:master Jan 17, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants