Skip to content

apply Black 2024 style in fbcode (8/16) #367

apply Black 2024 style in fbcode (8/16)

apply Black 2024 style in fbcode (8/16) #367

# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
name: Python package
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
tests-and-coverage-pip:
name: Tests and coverage (pip, Python ${{ matrix.python-version }}, ${{ matrix.os }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: ["ubuntu-latest", "macos-latest", "windows-latest"]
python-version: ['3.7', '3.8', '3.9']
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -e .[dev]
- name: Check copyright headers
run: |
python scripts/copyright_headers.py --check flowtorch tests scripts examples
- name: Check formatting with black
run: |
black --check flowtorch tests scripts examples
- name: Check imports with usort
run: |
usort check flowtorch tests scripts examples
- name: Lint with flake8
run: |
flake8 . --count --show-source --statistics
- name: Check types with mypy
run: |
mypy --disallow-untyped-defs flowtorch
- name: Test with pytest
run: |
pytest --cov=tests --cov-report=xml -W ignore::DeprecationWarning tests/