Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 43 additions & 0 deletions .github/workflows/python-checks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Python Code Quality Checks

on:
pull_request:
branches:
- main
# Only run the workflow if files in these specific Python directories are changed
paths:
- 'python/agents/**.py'
- 'python/notebooks/**.py'
- 'python/notebooks/**.ipynb'

jobs:
python-checks:
runs-on: ubuntu-latest

steps:
- name: ⬇️ Checkout Repository
uses: actions/checkout@v4

- name: 🐍 Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'

- name: ⚙️ Install Tools (Matching Makefile)
run: pip install black flake8 isort nbqa

# --- Black/iSort Check for .py files ---
- name: 📝 Run Black and iSort Checks
run: |
black --check --diff python/agents/ python/notebooks/
isort --check-only --diff python/agents/ python/notebooks/

# --- Flake8 Check for all .py files ---
- name: 🧹 Run Flake8 Linting
run: flake8 ./python/

# --- Black/iSort Check for .ipynb files (using nbqa) ---
- name: 📓 Check Notebooks (nbqa)
run: |
nbqa black --check --diff python/notebooks/
nbqa isort --check-only --diff python/notebooks/