Skip to content

Commit

Permalink
Merge pull request #2478 from Trusted-AI/development_pytest_flake8
Browse files Browse the repository at this point in the history
Update style checks
  • Loading branch information
beat-buesser authored Aug 26, 2024
2 parents 6410aa1 + d75ec05 commit be31bd8
Show file tree
Hide file tree
Showing 367 changed files with 4,139 additions and 4,189 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci-deepspeech-v3.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ on:
- cron: '0 8 * * 0'

jobs:
test_deepspeech_v3_torch_1_10:
test_deepspeech_v3_torch_2_1_1:
name: PyTorchDeepSpeech v3 / PyTorch 2.1.1
runs-on: ubuntu-latest
container: adversarialrobustnesstoolbox/art_testing_envs:deepspeech_v3_torch_2_1_1
Expand Down
45 changes: 12 additions & 33 deletions .github/workflows/ci-lingvo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,14 @@ jobs:
fail-fast: false
matrix:
include:
- name: TensorFlow+Lingvo 2.1.0v1 (Keras 2.3.1 Python 3.6)
framework: tensorflow2v1
python: 3.6
tensorflow: 2.1.0
- name: TensorFlow+Lingvo 0.13.1 (Python 3.10)
framework: tensorflow
python: '3.10'
lingvo: 0.13.1
tensorflow: 2.14.0
tf_version: v2
keras: 2.3.1
lingvo: 0.6.4
keras: 2.14.0
tf_addons: 0.21.0

name: Run ${{ matrix.name }} Tests
steps:
Expand All @@ -45,39 +46,17 @@ jobs:
with:
python-version: ${{ matrix.python }}
- name: Pre-install Lingvo ASR
# scipy beyond 1.6.0 is not available on Python 3.6, therefore we adapt the installation of requirements_test.txt
run: |
sudo apt-get update
sudo apt-get -y -q install ffmpeg libavcodec-extra
python -m pip install --upgrade pip setuptools wheel
pip install -q -r <(sed '/^scipy/d;/^matplotlib/d;/^pandas/d;/^statsmodels/d;/^numba/d;/^jax/d;/^h5py/d;/^Pillow/d;/^pytest/d;/^pytest-mock/d;/^torch/d;/^torchaudio/d;/^torchvision/d;/^xgboost/d;/^requests/d;/^tensorflow/d;/^keras/d;/^kornia/d;/^librosa/d;/^tqdm/d;/^timm/d;/^catboost/d;/^scikit-learn/d;/^GPy/d;/^lief/d;/^ultralytics/d;/^ipython/d' requirements_test.txt)
pip install scipy==1.5.4
pip install matplotlib==3.3.4
pip install pandas==1.1.5
pip install statsmodels==0.12.2
pip install numba==0.53.1
pip install -q -r requirements_test.txt
pip install -q -r <(sed '/^tensorflow/d;/^keras/d;/^tensorflow-addons/d;/^lingvo/d;/^Pillow/d' requirements_test.txt)
pip install tensorflow==${{ matrix.tensorflow }}
pip install keras==${{ matrix.keras }}
pip install lingvo==${{ matrix.lingvo }}
pip install tensorflow-addons==0.9.1
pip install model-pruning-google-research==0.0.3
pip install h5py==2.10.0
pip install pytest~=7.0.1
pip install pytest-flake8~=1.1.0
pip install pytest-mock
pip install pytest-cov~=3.0.0
pip install torch==1.10.2+cpu --find-links https://download.pytorch.org/whl/cpu/torch_stable.html
pip install torchaudio==0.10.2+cpu --find-links https://download.pytorch.org/whl/cpu/torch_stable.html
pip install torchvision==0.11.3+cpu --find-links https://download.pytorch.org/whl/cpu/torch_stable.html
pip install xgboost==1.5.2
pip install requests==2.27.1
pip install kornia==0.6.8
pip install librosa==0.9.2
pip install tqdm==4.64.1
pip install catboost==1.1.1
pip install scikit-learn==0.24.2
pip install GPy==1.10.0
pip install lief==0.12.3
pip install tensorflow-addons==${{ matrix.tf_addons }}
pip install lingvo==0.13.1
pip install Pillow==10.0.0
pip list
- name: Run ${{ matrix.name }} Tests
run: pytest --cov-report=xml --cov=art --cov-append -q -vv tests/estimators/speech_recognition/test_tensorflow_lingvo.py --framework=${{ matrix.framework }} --durations=0
Expand Down
15 changes: 5 additions & 10 deletions .github/workflows/ci-style-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,28 +39,23 @@ jobs:
- name: Install Dependencies
run: |
python -m pip install --upgrade pip setuptools wheel
pip install -q pylint==2.12.2 mypy==1.7.1 pycodestyle==2.8.0 black==21.12b0
pip install -q -r <(sed '/^numpy/d;/^pluggy/d;/^tensorflow/d;/^keras/d' requirements_test.txt)
pip install -q pylint==3.2.6 mypy==1.11.1 pycodestyle==2.12.0 black==24.4.2 ruff==0.5.5
pip install -q -r <(sed '/^numpy/d;/^tensorflow/d;/^keras/d' requirements_test.txt)
pip install numpy==1.22.4
pip install pluggy==0.13.1
pip install tensorflow==2.13.1
pip install keras==2.13.1
pip install types-six
pip install types-PyYAML
pip install types-setuptools
pip install click==8.0.2
pip list
- name: pycodestyle
run: pycodestyle --ignore=C0330,C0415,E203,E231,W503 --max-line-length=120 art
- name: pylint
if: ${{ always() }}
run: pylint --disable=C0330,C0415,E203,E1136,E0401,E1102 -rn art
run: pylint --fail-under=9.67 art/
- name: mypy
if: ${{ always() }}
run: mypy art
- name: pytest-flake8
- name: ruff
if: ${{ always() }}
run: pytest --flake8 -v -m flake8 --ignore=contrib
run: ruff check art/ tests/ examples/
- name: black
if: ${{ always() }}
run: |
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/ci-tensorflow-v1.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ jobs:
sudo apt-get update
sudo apt-get -y -q install ffmpeg libavcodec-extra
python -m pip install --upgrade pip setuptools wheel
pip install -q -r <(sed '/^pandas/d;/^scipy/d;/^matplotlib/d;/^xgboost/d;/^tensorflow/d;/^keras/d;/^jax/d;/^torch/d;/^Pillow/d;/^h5py/d;/^kornia/d;/^scikit-learn/d;/^pytest-mock/d;/^GPy/d;/^lief/d;/^statsmodels/d;/^ultralytics/d;/^ipython/d' requirements_test.txt)
pip install -q -r <(sed '/^pandas/d;/^scipy/d;/^matplotlib/d;/^xgboost/d;/^tensorflow/d;/^keras/d;/^jax/d;/^torch/d;/^Pillow/d;/^h5py/d;/^kornia/d;/^scikit-learn/d;/^pytest-mock/d;/^GPy/d;/^lief/d;/^statsmodels/d;/^ultralytics/d;/^ipython/d;/^numba/d;/^pytest/d;/^pylint/d;/^mypy/d;/^pycodestyle/d;/^black/d;/^types-PyYAML/d;/^types-setuptools/d' requirements_test.txt)
pip install pandas==1.3.5
pip install scipy==1.7.2
pip install matplotlib==3.5.3
Expand All @@ -68,6 +68,9 @@ jobs:
pip install GPy~=1.10.0
pip install lief==0.12.3
pip install statsmodels==0.13.5
pip install numba==0.56.4
pip install pytest==7.4.4
pip install pytest-cov
pip list
- name: Run Tests
run: ./run_tests.sh ${{ matrix.framework }}
Expand Down
Loading

0 comments on commit be31bd8

Please sign in to comment.