Skip to content

Update requirements.txt #8

Update requirements.txt

Update requirements.txt #8

Workflow file for this run

# This workflow runs when a commit is pushed to the "main" branch or
# a pull request is opened against the "main" branch.
#
# It uses:
# - Pylint to lint the Python code
# - Black to format the Python code
# - Isort to sort the Python imports
# - Prettier to check for general formatting issues in yaml, json, README, etc.
name: lint
on:
push:
branches:
- main
pull_request:
branches:
- main
permissions:
contents: read
jobs:
lint:
timeout-minutes: 5
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.9', '3.12'] # Always include the latest python version
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install nbqa pylint isort "black[jupyter]"
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Pylint
run: |
pylint $(git ls-files '*.py')
nbqa pylint $(git ls-files '*.ipynb')
- name: isort
run: |
isort --check-only --diff $(git ls-files '*.py')
nbqa isort --check-only --diff $(git ls-files '*.ipynb')
- name: Black
run: |
black --check --diff --line-length=80 $(git ls-files '*.py' '*.ipynb')
prettier:
timeout-minutes: 1
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
- name: Check formatting
run: npx --yes prettier --check .