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

Commit 2a5d512

Browse files
emmatypingshoyer
authored andcommitted
Update to be PEP 561 compliant (#18)
* Update to be PEP 561 compliant * Remove unneeded sys import * Remove unused setuptools import * Use numpy-stubs everywhere
1 parent f0cb9ff commit 2a5d512

File tree

8 files changed

+18
-9
lines changed

8 files changed

+18
-9
lines changed

.travis.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ notifications:
66

77
install:
88
- pip install -r test-requirements.txt
9+
- pip install .
910

1011
script:
1112
- flake8

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
# numpy_stubs: experimental typing stubs for NumPy
1+
# numpy-stubs: experimental typing stubs for NumPy
22

33
[![Build Status](https://travis-ci.org/numpy/numpy_stubs.svg?branch=master)](https://travis-ci.org/numpy/numpy_stubs)
44

55
This repository exists for developing [PEP 484](https://www.python.org/dev/peps/pep-0484/)
66
compatible typing annotations for [NumPy](https://github.com/numpy/numpy).
77

8-
It will be released as a separate "numpy_stubs" package on PyPI per [PEP
8+
It will be released as a separate "numpy-stubs" package on PyPI per [PEP
99
561](https://www.python.org/dev/peps/pep-0561/). This will let us iterate
1010
rapidly on experimental type annotations without coupling to NumPy's release
1111
cycle.
File renamed without changes.
File renamed without changes.
File renamed without changes.

numpy/py.typed

Whitespace-only changes.

setup.py

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,15 @@
1-
from setuptools import setup, find_packages
1+
from setuptools import setup
2+
import os
3+
4+
5+
def find_stubs(package):
6+
stubs = []
7+
for root, dirs, files in os.walk(package):
8+
for file in files:
9+
path = os.path.join(root, file).replace(package + os.sep, '', 1)
10+
stubs.append(path)
11+
return {package: stubs}
12+
213

314
setup(
415
name='numpy-stubs',
@@ -8,11 +19,8 @@
819
url="http://www.numpy.org",
920
license='BSD',
1021
version="0.0.1",
11-
packages=find_packages(),
12-
22+
packages=['numpy-stubs'],
1323
# PEP 561 requires these
1424
install_requires=['numpy~=1.14.0'],
15-
package_data={
16-
'numpy': 'py.typed'
17-
},
25+
package_data=find_stubs('numpy-stubs'),
1826
)

test-requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
flake8==3.3.0
22
flake8-pyi==17.3.0
33
pytest==3.4.2
4-
mypy==0.580.0
4+
mypy==0.590

0 commit comments

Comments
 (0)