forked from numpy/numpy-stubs
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add basic scaffolding for distributing the package
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
- Loading branch information
1 parent
88818fe
commit 5961287
Showing
5 changed files
with
44 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# very simple, just enough to start running tests | ||
|
||
class ndarray: pass | ||
|
||
class dtype: pass | ||
|
||
def array( | ||
object: object, | ||
dtype: dtype = ..., | ||
copy: bool = ..., | ||
subok: bool = ..., | ||
ndmin: int = ...) -> ndarray: ... |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
from setuptools import setup, find_packages | ||
|
||
setup( | ||
name='numpy_stubs', | ||
maintainer="NumPy Developers", | ||
maintainer_email="numpy-discussion@python.org", | ||
description="PEP 561 type stubs for numpy", | ||
url="http://www.numpy.org", | ||
license='BSD', | ||
version="0.0.1", | ||
packages=find_packages(), | ||
|
||
# PEP 561 requires these | ||
install_requires=['numpy~=1.13.0'], | ||
package_data={ | ||
'numpy': 'py.typed' | ||
}, | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
Testing | ||
======= | ||
|
||
To run these tests: | ||
|
||
export MYPYPATH='..' | ||
mypy test_simple.py | ||
|
||
In future, this should change to use the test framework used by mypy. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import numpy as np | ||
|
||
def foo(a: np.ndarray): pass | ||
|
||
foo(np.array(1)) |