forked from biocommons/biocommons.seqrepo
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
style: apply style black, flake8, isort (biocommons#108)
Also includes this as a check in CI.
- Loading branch information
Showing
38 changed files
with
534 additions
and
427 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,7 +17,45 @@ jobs: | |
env: | ||
GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN }}' | ||
|
||
linting: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v1 | ||
|
||
- name: Install Python | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: "3.8" | ||
|
||
- name: Install dependencies | ||
run: | | ||
# Install / update package management tools | ||
pip install -U pip setuptools | ||
# Test dependencies | ||
pip install -U pytest pytest-cov pytest-vcr black==23.3.0 flake8>=6.0,<7.0 isort>=5.0,<6.0 | ||
# Dump installed packages and versions | ||
pip freeze | ||
- name: Run linting tools | ||
run: | | ||
black -l 120 --check --diff . | ||
isort --profile=black --check --diff . | ||
flake8 src tests docs setup.py | ||
- name: Comment PR | ||
if: github.event_name == 'pull_request' && failure() | ||
uses: marocchino/[email protected] | ||
with: | ||
message: | | ||
- Please format your Python code with [black](https://black.readthedocs.io): `make black` | ||
- Please organize your imports [isorts](https://isort.readthedocs.io): `make isort` | ||
- Please ensure that your code passes [flake8](https://flake8.pycqa.org/en/latest/): `make flake8` | ||
You can trigger all lints locally by running `black -l 120 --check . && isort --profile=black --check . && flake8 src tests docs setup.py` | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
testing: | ||
needs: linting | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
|
@@ -36,12 +74,17 @@ jobs: | |
with: | ||
python-version: ${{ matrix.python-version }} | ||
|
||
- name: Install system dependencies | ||
- name: Install dependencies | ||
run: | | ||
sudo apt install libhts-dev libhts3 libhtscodecs-dev libhtscodecs2 tabix | ||
# Install / update package management tools. | ||
pip install -U pip setuptools | ||
pip install -U pytest pytest-cov pytest-vcr | ||
# Test dependencies | ||
pip install -U pytest pytest-cov pytest-vcr black==23.3.0 flake8>=6.0,<7.0 isort>=5.0,<6.0 | ||
# Install the local package itself in editable mode. | ||
pip install -e . | ||
# Dump installed packages and versions | ||
pip freeze | ||
- name: Run tests | ||
run: | | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,7 @@ | ||
# Editors | ||
.*.sw? | ||
*~ | ||
|
||
# Byte-compiled / optimized / DLL files | ||
__pycache__/ | ||
*.py[cod] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
from setuptools import setup | ||
|
||
setup(use_scm_version=True) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
# pragma: nocover | ||
import pkg_resources | ||
|
||
pkg_resources.declare_namespace(__name__) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,3 @@ | ||
import logging | ||
|
||
class DuplicateFilter: | ||
""" | ||
Filters away duplicate log messages. | ||
|
Oops, something went wrong.