-
Notifications
You must be signed in to change notification settings - Fork 181
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #302 from hatemhelal/checks
Adding pre-commit checks and github action runners
- Loading branch information
Showing
8 changed files
with
114 additions
and
12 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
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 |
---|---|---|
@@ -0,0 +1,14 @@ | ||
name: Pre-Commit Checks | ||
|
||
on: | ||
pull_request: | ||
push: | ||
branches: [main] | ||
|
||
jobs: | ||
pre-commit: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-python@v3 | ||
- uses: pre-commit/[email protected] |
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 |
---|---|---|
@@ -0,0 +1,29 @@ | ||
name: unit tests | ||
on: | ||
pull_request: | ||
push: | ||
branches: [main] | ||
|
||
jobs: | ||
pytest-container: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-python@v4 | ||
with: | ||
python-version: "3.10" | ||
cache: "pip" | ||
|
||
- name: Install requirements | ||
run: | | ||
pip install -U pip | ||
pip install .[dev] | ||
- name: Log installed environment | ||
run: | | ||
python3 -m pip freeze | ||
- name: Run unit tests | ||
run: | | ||
pytest tests |
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 |
---|---|---|
@@ -0,0 +1,50 @@ | ||
repos: | ||
- repo: https://github.com/pre-commit/pre-commit-hooks | ||
rev: v4.5.0 | ||
hooks: | ||
- id: end-of-file-fixer | ||
- id: trailing-whitespace | ||
|
||
- repo: https://github.com/psf/black-pre-commit-mirror | ||
rev: 23.12.1 | ||
hooks: | ||
- id: black | ||
name: Black Formating | ||
|
||
- repo: https://github.com/pycqa/isort | ||
rev: 5.13.2 | ||
hooks: | ||
- id: isort | ||
name: Sort imports | ||
|
||
# Failing - to be investigated separately | ||
# - repo: local | ||
# hooks: | ||
# - id: pylint | ||
# name: Pylint Checks | ||
# entry: pylint | ||
# language: system | ||
# types: [python] | ||
# args: | ||
# [ | ||
# "--rcfile=pyproject.toml", | ||
# "mace", | ||
# "tests", | ||
# "scripts" | ||
# ] | ||
|
||
# - repo: local | ||
# hooks: | ||
# - id: mypy | ||
# name: mypy type checks | ||
# entry: mypy | ||
# language: system | ||
# types: [python] | ||
# args: | ||
# [ | ||
# --config-file=.mypy.ini, | ||
# mace, | ||
# tests, | ||
# scripts | ||
# ] | ||
|
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 |
---|---|---|
|
@@ -36,4 +36,4 @@ disable = [ | |
ignore-paths = [ | ||
"^mace/tools/torch_geometric/.*$", | ||
"^mace/tools/scatter.py$", | ||
] | ||
] |
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 |
---|---|---|
|
@@ -36,3 +36,10 @@ console_scripts = | |
|
||
[options.extras_require] | ||
wandb = wandb | ||
dev = | ||
black | ||
isort | ||
mypy | ||
pre-commit | ||
pytest | ||
pylint |
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