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

Commit c66c165

Browse files
authored
Merge pull request #4 from eric-wieser/scaffold
Add basic scaffolding for distributing the package
2 parents bb979b2 + 5961287 commit c66c165

File tree

5 files changed

+44
-0
lines changed

5 files changed

+44
-0
lines changed

numpy/__init__.pyi

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# very simple, just enough to start running tests
2+
3+
class ndarray: pass
4+
5+
class dtype: pass
6+
7+
def array(
8+
object: object,
9+
dtype: dtype = ...,
10+
copy: bool = ...,
11+
subok: bool = ...,
12+
ndmin: int = ...) -> ndarray: ...

numpy/py.typed

Whitespace-only changes.

setup.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
from setuptools import setup, find_packages
2+
3+
setup(
4+
name='numpy_stubs',
5+
maintainer="NumPy Developers",
6+
maintainer_email="numpy-discussion@python.org",
7+
description="PEP 561 type stubs for numpy",
8+
url="http://www.numpy.org",
9+
license='BSD',
10+
version="0.0.1",
11+
packages=find_packages(),
12+
13+
# PEP 561 requires these
14+
install_requires=['numpy~=1.13.0'],
15+
package_data={
16+
'numpy': 'py.typed'
17+
},
18+
)

tests/README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
Testing
2+
=======
3+
4+
To run these tests:
5+
6+
export MYPYPATH='..'
7+
mypy test_simple.py
8+
9+
In future, this should change to use the test framework used by mypy.

tests/test_simple.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import numpy as np
2+
3+
def foo(a: np.ndarray): pass
4+
5+
foo(np.array(1))

0 commit comments

Comments
 (0)