diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 49e8d19e8f..d9abb1efb0 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -24,15 +24,22 @@ env: BUILDIFIER_SHA256SUM: '4c985c883eafdde9c0e8cf3c8595b8bfdf32e77571c369bf8ddae83b042028d6' jobs: - lint-python: + lint-python-flake8: runs-on: ubuntu-16.04 + strategy: + fail-fast: false + matrix: + # flake8 should run on each Python version that we target, + # because the errors and warnings can differ due to language + # changes, and we want to catch them all. + python_version: ['3.5', '3.7'] steps: - uses: actions/checkout@v1 - uses: actions/setup-python@v1 with: - python-version: '3.6' + python-version: ${{ matrix.python_version }} architecture: 'x64' - - name: 'Install black and flake8' + - name: 'Install flake8' run: | python -m pip install -U pip pip install -r ./tensorboard/pip_package/requirements_dev.txt @@ -41,6 +48,20 @@ jobs: # See: http://flake8.pycqa.org/en/3.7.8/user/error-codes.html # Use the comment '# noqa: ' to suppress. run: flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics + + lint-python: + runs-on: ubuntu-16.04 + steps: + - uses: actions/checkout@v1 + - uses: actions/setup-python@v1 + with: + python-version: '3.6' + architecture: 'x64' + - name: 'Install black' + run: | + python -m pip install -U pip + pip install -r ./tensorboard/pip_package/requirements_dev.txt + - run: pip freeze --all - name: 'Lint Python code for style with Black' # You can run `black .` to fix all Black complaints. run: black --check . diff --git a/pyproject.toml b/pyproject.toml index c73ad6175e..cc5891c6fb 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,3 +1,5 @@ [tool.black] line-length = 80 -target-version = ["py27", "py36", "py37", "py38"] +# TODO(@wchargin): Drop `py35` here once we drop support for Python 3.5 +# and aren't affected by . +target-version = ["py27", "py35", "py36", "py37", "py38"] diff --git a/tensorboard/data/provider.py b/tensorboard/data/provider.py index f60c944a89..e2b2b478dd 100644 --- a/tensorboard/data/provider.py +++ b/tensorboard/data/provider.py @@ -428,7 +428,7 @@ def __init__( max_wall_time, plugin_content, description, - display_name, + display_name ): self._max_step = max_step self._max_wall_time = max_wall_time @@ -705,7 +705,7 @@ def __init__( max_length, plugin_content, description, - display_name, + display_name ): super(BlobSequenceTimeSeries, self).__init__( max_step=max_step,