From 1d441f89acc7c4d17ecda1fb41ca0a2310ef2a57 Mon Sep 17 00:00:00 2001 From: Scott McKay Date: Sat, 30 May 2020 09:10:05 +1000 Subject: [PATCH] Re-enable PEP8 check in Win CI build (#4075) * Add flake8 to Win CI build so it's re-enabled. It was in the static analysis build that is currently disabled so checks are not running. Fix build.py to be compliant again. Add prefix to flake8 output so it's (hopefully) easier to identify the errors in build output. * Add to all builds in Windows CPU CI so they all fail quickly if there's an issue. --- .flake8 | 1 + tools/ci_build/build.py | 8 +++++--- tools/ci_build/github/azure-pipelines/win-ci-pipeline.yml | 8 ++++---- 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/.flake8 b/.flake8 index 4ca86f22ff..bd1c971b62 100644 --- a/.flake8 +++ b/.flake8 @@ -2,3 +2,4 @@ max-line-length = 120 per-file-ignores = __init__.py:F401 +format = [flake8 PEP8 ERROR] %(path)s:%(row)d:%(col)d: %(code)s %(text)s diff --git a/tools/ci_build/build.py b/tools/ci_build/build.py index e8955db5fb..5b6877948e 100755 --- a/tools/ci_build/build.py +++ b/tools/ci_build/build.py @@ -1036,11 +1036,13 @@ def run_training_python_frontend_e2e_tests(args, cwd): # frontend tests are to be added here: log.info("Running python frontend e2e tests.") - # with orttraining_run_glue.py. + # with orttraining_run_glue.py. # 1. we like to force to use single GPU (with CUDA_VISIBLE_DEVICES) for fine-tune tests. # 2. need to run test separately (not to mix between fp16 and full precision runs. this need to be investigated). - run_subprocess([sys.executable, 'orttraining_run_glue.py', 'ORTGlueTest.test_bert_with_mrpc', '-v'], cwd=cwd, env={'CUDA_VISIBLE_DEVICES': '0'}) - run_subprocess([sys.executable, 'orttraining_run_glue.py', 'ORTGlueTest.test_bert_fp16_with_mrpc', '-v'], cwd=cwd, env={'CUDA_VISIBLE_DEVICES': '0'}) + run_subprocess([sys.executable, 'orttraining_run_glue.py', 'ORTGlueTest.test_bert_with_mrpc', '-v'], + cwd=cwd, env={'CUDA_VISIBLE_DEVICES': '0'}) + run_subprocess([sys.executable, 'orttraining_run_glue.py', 'ORTGlueTest.test_bert_fp16_with_mrpc', '-v'], + cwd=cwd, env={'CUDA_VISIBLE_DEVICES': '0'}) run_subprocess([sys.executable, 'orttraining_test_transformers.py'], cwd=cwd) diff --git a/tools/ci_build/github/azure-pipelines/win-ci-pipeline.yml b/tools/ci_build/github/azure-pipelines/win-ci-pipeline.yml index 0f206ed32f..6bebe760bc 100644 --- a/tools/ci_build/github/azure-pipelines/win-ci-pipeline.yml +++ b/tools/ci_build/github/azure-pipelines/win-ci-pipeline.yml @@ -38,7 +38,7 @@ jobs: workingFolder: '$(Build.BinariesDirectory)' - script: | - python -m pip install -q pyopenssl setuptools wheel numpy scipy + python -m pip install -q pyopenssl setuptools wheel numpy scipy flake8 workingDirectory: '$(Build.BinariesDirectory)' displayName: 'Install python modules' @@ -176,7 +176,7 @@ jobs: workingFolder: '$(Build.BinariesDirectory)' - script: | - python -m pip install -q pyopenssl setuptools wheel numpy scipy + python -m pip install -q pyopenssl setuptools wheel numpy scipy flake8 workingDirectory: '$(Build.BinariesDirectory)' displayName: 'Install python modules' @@ -304,7 +304,7 @@ jobs: workingFolder: '$(Build.BinariesDirectory)' - script: | - python -m pip install -q pyopenssl setuptools wheel numpy scipy + python -m pip install -q pyopenssl setuptools wheel numpy scipy flake8 workingDirectory: '$(Build.BinariesDirectory)' displayName: 'Install python modules' @@ -421,7 +421,7 @@ jobs: workingFolder: '$(Build.BinariesDirectory)' - script: | - python -m pip install -q pyopenssl setuptools wheel numpy scipy + python -m pip install -q pyopenssl setuptools wheel numpy scipy flake8 workingDirectory: '$(Build.BinariesDirectory)' displayName: 'Install python modules'