-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
TEMPORARY Introduce pre-commit workflow for consistency
- Loading branch information
1 parent
e5df31c
commit 0561221
Showing
2 changed files
with
63 additions
and
0 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 |
---|---|---|
|
@@ -74,3 +74,17 @@ jobs: | |
run: | | ||
source .venv/bin/activate | ||
pytest --cov-report xml:.coverage.xml --cov-report term --cov=ixmp4 -rsx --benchmark-skip | ||
pre-commit: | ||
name: Code quality | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-python@v4 | ||
|
||
- name: Force recreation of pre-commit virtual environment for mypy | ||
if: github.event_name == 'schedule' # Comment this line to run on a PR | ||
run: gh cache delete $(gh cache list -L 999 | cut -f2 | grep pre-commit) | ||
env: { GH_TOKEN: "${{ github.token }}" } | ||
|
||
- 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,49 @@ | ||
repos: | ||
# - repo: https://github.com/python-poetry/poetry | ||
# rev: 30da950 #update this to next revision that include poetry-install | ||
# hooks: | ||
# - id: poetry-check | ||
# - id: poetry-lock | ||
# - id: poetry-export | ||
# - id: poetry-install | ||
- repo: local | ||
hooks: | ||
- id: mypy | ||
name: mypy | ||
always_run: true | ||
require_serial: true | ||
pass_filenames: false | ||
|
||
language: python | ||
entry: bash -c ". ${PRE_COMMIT_MYPY_VENV:-/dev/null}/bin/activate 2>/dev/null; mypy $0 $@" | ||
# additional_dependencies: | ||
# - alembic | ||
# - black | ||
# - dask | ||
# - fastapi | ||
# - httpx | ||
# - ipykernel | ||
# - mypy | ||
# - nbclient | ||
# - pandas-stubs | ||
# - pandera | ||
# - psycopg[binary] | ||
# - pydantic | ||
# - pydantic-settings | ||
# - pyjwt | ||
# - pytest | ||
# - python-dotenv | ||
# - sphinx | ||
# - sqlalchemy | ||
# - types-toml | ||
# - typer | ||
# - xarray | ||
args: ["."] | ||
- repo: https://github.com/psf/black | ||
rev: 23.9.1 | ||
hooks: | ||
- id: black | ||
- repo: https://github.com/astral-sh/ruff-pre-commit | ||
rev: v0.0.292 | ||
hooks: | ||
- id: ruff |