|
| 1 | +# Copyright (C) 2018 Google Inc. |
| 2 | +# |
| 3 | +# Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | +# you may not use this file except in compliance with the License. |
| 5 | +# You may obtain a copy of the License at |
| 6 | +# |
| 7 | +# http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | +# |
| 9 | +# Unless required by applicable law or agreed to in writing, software |
| 10 | +# distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | +# See the License for the specific language governing permissions and |
| 13 | +# limitations under the License. |
| 14 | + |
| 15 | +#!/usr/bin/env bash |
| 16 | + |
| 17 | +PYTHON_VERSION=${PYTHON_VERSION:-2.7} |
| 18 | + |
| 19 | +pip install --upgrade setuptools pip |
| 20 | +pip install --upgrade pylint pytest pytest-pylint pytest-runner |
| 21 | +pip install termcolor |
| 22 | +pip install hypothesis python-Levenshtein |
| 23 | +python setup.py develop |
| 24 | +python -m pytest # Run the tests without IPython. |
| 25 | +pip install ipython |
| 26 | +python -m pytest # Now run the tests with IPython. |
| 27 | +pylint fire --ignore=test_components_py3.py,parser_fuzz_test.py,console |
| 28 | +if [[ ${PYTHON_VERSION} == 2.7 || ${PYTHON_VERSION} == 3.7 ]]; then |
| 29 | + pip install pytype; |
| 30 | +fi |
| 31 | +# Run type-checking, excluding files that define or use py3 features in py2. |
| 32 | +if [[ ${PYTHON_VERSION} == 2.7 ]]; then |
| 33 | + pytype -x \ |
| 34 | + fire/fire_test.py \ |
| 35 | + fire/inspectutils_test.py \ |
| 36 | + fire/test_components_py3.py; |
| 37 | +elif [[ ${PYTHON_VERSION} == 3.7 ]]; then |
| 38 | + pytype; |
| 39 | +fi |
| 40 | + |
0 commit comments