Skip to content

Commit

Permalink
Add Black linting to CI
Browse files Browse the repository at this point in the history
  • Loading branch information
alexgleith committed Jun 29, 2022
1 parent c695897 commit 4f786ce
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
11 changes: 11 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,19 +15,30 @@ jobs:
python-version: [ '3.5', '3.8' ]
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 "numpy<1.19.0"
pip install -r test_requirements.txt
pip install pytest-cov
- name: Run Black check for formatting
if: ${{ matrix.python-version != '3.5' }}
run: |
# Need to manually install Black while we support Python 3.5
pip install black
black --check .
- name: Test with pytest
run: |
pytest --cov=./ --cov-report=xml
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v1
with:
Expand Down
4 changes: 3 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@
]

TESTS_REQUIRE = [
'pytest'
'pytest',
# Need to manually install Black while we support Python 3.5
# 'black'
]

EXTRAS_REQUIRE = {
Expand Down

0 comments on commit 4f786ce

Please sign in to comment.