Unverified Commit 2a79a9ff authored by Paul Fultz II's avatar Paul Fultz II Committed by GitHub
Browse files

Add python type annotations to api.py (#1061)

This will also check the types using mypy on the CI.
parent 7e7ef0b8
...@@ -142,10 +142,12 @@ jobs: ...@@ -142,10 +142,12 @@ jobs:
with: with:
python-version: 3.6 python-version: 3.6
- name: Install pyflakes - name: Install pyflakes
run: pip install pyflakes==2.3.1 run: pip install pyflakes==2.3.1 mypy==0.931
- name: Run pyflakes - name: Run pyflakes
run: pyflakes examples/ tools/ src/ test/ doc/ run: |
pyflakes examples/ tools/ src/ test/ doc/
mypy tools/api.py
linux: linux:
......
This diff is collapsed.
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
SRC_DIR=$DIR/../src SRC_DIR=$DIR/../src
ls -1 $DIR/include/ | xargs -n 1 -P $(nproc) -I{} -t bash -c "python3.6 $DIR/te.py $DIR/include/{} | clang-format-5.0 -style=file > $SRC_DIR/include/migraphx/{}" PYTHON=python3
if type -p python3.6 > /dev/null ; then
PYTHON=python3.6
fi
if type -p python3.8 > /dev/null ; then
PYTHON=python3.8
fi
ls -1 $DIR/include/ | xargs -n 1 -P $(nproc) -I{} -t bash -c "$PYTHON $DIR/te.py $DIR/include/{} | clang-format-5.0 -style=file > $SRC_DIR/include/migraphx/{}"
function api { function api {
python3.6 $DIR/api.py $SRC_DIR/api/migraphx.py $1 | clang-format-5.0 -style=file > $2 $PYTHON $DIR/api.py $SRC_DIR/api/migraphx.py $1 | clang-format-5.0 -style=file > $2
} }
api $DIR/api/migraphx.h $SRC_DIR/api/include/migraphx/migraphx.h api $DIR/api/migraphx.h $SRC_DIR/api/include/migraphx/migraphx.h
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment