Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/main'
Browse files Browse the repository at this point in the history
  • Loading branch information
cavit99 committed Feb 3, 2025
2 parents 15f5c81 + 3aeec71 commit 9b1068e
Show file tree
Hide file tree
Showing 85 changed files with 17,054 additions and 6,307 deletions.
35 changes: 35 additions & 0 deletions .github/workflows/pre-commit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Pre-commit Checks

permissions:
contents: read
pull-requests: write

on:
pull_request:
branches: [ main ]

jobs:
pre-commit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
with:
python-version: '3.11'
- uses: pre-commit/[email protected]
id: precommit
continue-on-error: true
- name: Comment on PR if pre-commit failed
if: steps.precommit.outcome == 'failure'
uses: actions/github-script@v7
with:
script: |
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: '❌ Pre-commit checks failed. Please run `pre-commit run --all-files` locally and fix the issues.'
})
- name: Exit with pre-commit status
if: steps.precommit.outcome == 'failure'
run: exit 1
34 changes: 34 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Tests

on:
pull_request:
branches: [ main ]
push:
branches: [ main ]

jobs:
test:
runs-on: ubuntu-latest
permissions:
contents: read
issues: write
pull-requests: write
strategy:
matrix:
python-version: ["3.11", "3.12"]

steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install ".[test]"
- name: Run tests
run: |
pytest
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,5 @@ ENV/
htmlcov/
.pytest_cache/

.DS_Store
# OSX
.DS_Store
1 change: 1 addition & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,4 @@ repos:
hooks:
- id: isort
name: isort (python)
exclude: GALLERY.md
Loading

0 comments on commit 9b1068e

Please sign in to comment.