]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
scrips/run_mypy: add .gitignore
authorSebastian Wagner <sebastian.wagner@suse.com>
Fri, 22 Mar 2019 09:46:52 +0000 (10:46 +0100)
committerSebastian Wagner <sebastian.wagner@suse.com>
Tue, 26 Mar 2019 08:58:42 +0000 (09:58 +0100)
Co-Authored-by: Patrick Nawracay <pnawracay@suse.com>
Signed-off-by: Sebastian Wagner <sebastian.wagner@suse.com>
src/.gitignore
src/script/run_mypy.sh

index 6020b701ee74aa5c76d1b27372bd9a4c11e4d295..f5e891bcd39f6030f513edbb65e159944894e568 100644 (file)
@@ -2,3 +2,6 @@
 /.git_version
 /ceph_ver.h
 /gf_vect_dot_prod_avx2.o
+mypy_report.txt
+.mypy_venv/
+.mypy_cache/
index 3d13532891b8bde88f804270e6e01137be3f9a1b..8bd1b202b7ca342f3d9fa493c960c765e7475282 100755 (executable)
@@ -1,15 +1,16 @@
 #!/usr/bin/env bash
 
-# needs to be executed form the src directory.
+# needs to be executed from the src directory.
 # generates a report at src/mypy_report.txt
 
-python3 -m venv venv
+python3 -m venv .mypy_venv
 
-. venv/bin/activate
+. .mypy_venv/bin/activate
 
-pip install $(find * -name requirements.txt | awk '{print "-r  " $0}') mypy
+pip install $(find * -name requirements.txt | grep -v node_modules | awk '{print "-r  " $0}')
+pip install mypy
 
-cat <<EOF > ./mypy.ini
+MYPY_INI=$(cat <<-EOF
 [mypy]
 strict_optional = True
 no_implicit_optional = True
@@ -18,20 +19,22 @@ warn_incomplete_stub = True
 check_untyped_defs = True
 show_error_context = True
 EOF
+)
 
+export MYPYPATH="$PWD/pybind/rados:$PWD/pybind/rbd:$PWD/pybind/cephfs"
 
 echo "pybind:" > mypy_report.txt
 pushd pybind
-mypy --config-file=../mypy.ini  *.py | awk '{print "pybind/" $0}' >> ../mypy_report.txt
+mypy --config-file=<(echo "$MYPY_INI")  *.py | awk '{print "pybind/" $0}' >> ../mypy_report.txt
 popd
 
 echo "MGR Modules:" >> mypy_report.txt
 pushd pybind/mgr
-mypy --config-file=../../mypy.ini  $(find * -name '*.py' | grep -v -e venv -e tox -e env -e gyp -e node_modules) | awk '{print "pybind/mgr/" $0}' >> ../../mypy_report.txt
+mypy --config-file=<(echo "$MYPY_INI")  $(find * -name '*.py' | grep -v -e venv -e tox -e env -e gyp -e node_modules) | awk '{print "pybind/mgr/" $0}' >> ../../mypy_report.txt
 popd
 
 echo "ceph-volume:" >> mypy_report.txt
 pushd ceph-volume/ceph_volume
-mypy --config-file=../../mypy.ini   $(find * -name '*.py' | grep -v -e venv -e tox -e env -e gyp -e node_modules -e tests) | awk '{print "ceph-volume/ceph_volume/" $0}' >> ../../mypy_report.txt
+mypy --config-file=<(echo "$MYPY_INI")   $(find * -name '*.py' | grep -v -e venv -e tox -e env -e gyp -e node_modules -e tests) | awk '{print "ceph-volume/ceph_volume/" $0}' >> ../../mypy_report.txt
 popd