Skip to content

Commit

Permalink
set up pre-commit on github actions (#312)
Browse files Browse the repository at this point in the history
* fix indentation

* set up github action for pre-commit

* add missing whitespace to comply E226

* formatting

* python 3.9 is no longer run with macos-latest, which uses M1 arch

* manually remove python 3.9 from matrix
  • Loading branch information
Mikejmnez committed Apr 27, 2024
1 parent 15afa3d commit 5674d1c
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 2 deletions.
14 changes: 14 additions & 0 deletions .github/workflows/pre-commit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: pre-commit

on:
pull_request:
push:
branches: [master]

jobs:
pre-commit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v3
- uses: pre-commit/action@v3.0.1
2 changes: 1 addition & 1 deletion .github/workflows/run_tests_macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
runs-on: macos-latest
strategy:
matrix:
python-version: ['3.x', '3.9', '3.10', '3.11']
python-version: ['3.x', '3.10', '3.11']
name: macos-latest Python ${{ matrix.python-version }}
steps:
- uses: actions/checkout@v4
Expand Down
5 changes: 5 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
# https://pre-commit.com/
ci:
autofix_prs: false
autoupdate_branch: 'master'
autoupdate_commit_msg: '[pre-commit.ci] pre-commit autoupdate'
autoupdate_schedule: weekly
skip: []
submodules: false
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
Expand Down
2 changes: 1 addition & 1 deletion src/pydap/tests/dap_4_access/dap4_access_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ def main():
i += 1
print(f"Call {i}")
variable = pydap_ds["sea_ice_fraction"][0, 1700:1799:10, 1800:1900:10]
print(f"Time for request: {time.time()-start}")
print(f"Time for request: {time.time() - start}")
print('A subset of the "sea_ice_fraction" variable')
print(variable.data)

Expand Down

0 comments on commit 5674d1c

Please sign in to comment.