Skip to content

Commit

Permalink
GitHub Action to lint Python code (#36)
Browse files Browse the repository at this point in the history
  • Loading branch information
cclauss authored Jul 6, 2021
1 parent 1c68a1a commit 06d6ae2
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 3 deletions.
21 changes: 21 additions & 0 deletions .github/workflows/lint_python.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: lint_python
on: [pull_request, push]
jobs:
lint_python:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
- run: pip install bandit black codespell flake8 isort mypy pytest pyupgrade safety
- run: bandit --recursive --skip B101 . || true # B101 is assert statements
- run: black --check . || true
- run: codespell
- run: flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
- run: flake8 . --count --exit-zero --max-complexity=19 --max-line-length=245 --show-source --statistics
- run: isort --check-only --profile black . || true
- run: pip install -r requirements.txt
- run: mypy --ignore-missing-imports . || true
- run: pytest . || true
- run: pytest --doctest-modules . || true
- run: shopt -s globstar && pyupgrade --py36-plus **/*.py || true
- run: safety check
8 changes: 5 additions & 3 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
numpy~=1.19.5
transformers~=4.4.2
transformers~=4.8.2
tqdm~=4.45.0
setuptools~=51.3.3
wandb~=0.10.22
Expand All @@ -9,12 +9,14 @@ fabric~=2.6.0
optax==0.0.6
git+https://github.com/deepmind/dm-haiku
git+https://github.com/EleutherAI/lm-evaluation-harness/
ray~=1.2.0
ray~=1.4.1
jax~=0.2.12
Flask~=1.1.2
cloudpickle~=1.3.0
tensorflow-cpu~=2.4.1
tensorflow-cpu~=2.5.0
google-cloud-storage~=1.36.2
smart_open[gcs]
func_timeout
ftfy
fastapi
uvicorn

0 comments on commit 06d6ae2

Please sign in to comment.