Skip to content

Commit d303ced

Browse files
authored
Added PEP 561 compliance (#945) (#946)
* Added PEP 561 compliance (#945) * FIX: mypy test dependancy * FIX: mypy test dependancy (#945) * FIX: Added mypy to CI list of test packages
1 parent 3d85fa7 commit d303ced

File tree

4 files changed

+14
-2
lines changed

4 files changed

+14
-2
lines changed

ci_scripts/install.sh

100644100755
Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ python --version
3838

3939
if [[ "$TEST_DIST" == "true" ]]; then
4040
pip install twine nbconvert jupyter_client matplotlib pyarrow pytest pytest-xdist pytest-timeout \
41-
nbformat oslo.concurrency flaky
41+
nbformat oslo.concurrency flaky mypy
4242
python setup.py sdist
4343
# Find file which was modified last as done in https://stackoverflow.com/a/4561987
4444
dist=`find dist -type f -printf '%T@ %p\n' | sort -n | tail -1 | cut -f2- -d" "`
@@ -52,6 +52,7 @@ fi
5252
python -c "import numpy; print('numpy %s' % numpy.__version__)"
5353
python -c "import scipy; print('scipy %s' % scipy.__version__)"
5454

55+
5556
if [[ "$DOCPUSH" == "true" ]]; then
5657
conda install --yes gxx_linux-64 gcc_linux-64 swig
5758
pip install -e '.[examples,examples_unix]'
@@ -64,6 +65,15 @@ if [[ "$RUN_FLAKE8" == "true" ]]; then
6465
pre-commit install
6566
fi
6667

68+
# PEP 561 compliance check
69+
# Assumes mypy relies solely on the PEP 561 standard
70+
if ! python -m mypy -c "import openml"; then
71+
echo "Failed: PEP 561 compliance"
72+
exit 1
73+
else
74+
echo "Success: PEP 561 compliant"
75+
fi
76+
6777
# Install scikit-learn last to make sure the openml package installation works
6878
# from a clean environment without scikit-learn.
6979
pip install scikit-learn==$SKLEARN_VERSION

doc/progress.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ Changelog
1818
* MAINT #865: OpenML no longer bundles test files in the source distribution.
1919
* MAINT #897: Dropping support for Python 3.5.
2020
* ADD #894: Support caching of datasets using feather format as an option.
21+
* ADD #945: PEP 561 compliance for distributing Type information
2122

2223
0.10.2
2324
~~~~~~

openml/py.typed

Whitespace-only changes.

setup.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
packages=setuptools.find_packages(
4343
include=["openml.*", "openml"], exclude=["*.tests", "*.tests.*", "tests.*", "tests"],
4444
),
45-
package_data={"": ["*.txt", "*.md"]},
45+
package_data={"": ["*.txt", "*.md", "py.typed"]},
4646
python_requires=">=3.6",
4747
install_requires=[
4848
"liac-arff>=2.4.0",
@@ -68,6 +68,7 @@
6868
"pyarrow",
6969
"pre-commit",
7070
"pytest-cov",
71+
"mypy",
7172
],
7273
"examples": [
7374
"matplotlib",

0 commit comments

Comments
 (0)