Skip to content

fix environment for output generation #756

fix environment for output generation

fix environment for output generation #756

name: Clean Up and Format
on:
push:
branches-ignore:
- 'main'
- 'dev'
permissions:
contents: write
jobs:
clean-up:
name: Clean Up Python Notebooks
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
token: ${{ secrets.GH_PAT || github.token }}
- name: Set up Python 3.10
uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Cleanup ipynb output
run: |
pip install --upgrade pip
pip install nbconvert
python -m jupyter nbconvert --clear-output --inplace *.ipynb */*.ipynb */*/*.ipynb */*/*/*.ipynb
- name: Commit clean up changes
run: ./scripts/commit-and-push.sh "[CI] cleanup python notebooks"
format:
name: Format
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
token: ${{ secrets.GH_PAT || github.token }}
- name: Set up Python 3.10
uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Install Dependencies
run: |
pip install --upgrade pip
pip install autoflake autopep8 black isort flake8
- name: Fix lint with autoflake
run: python -m autoflake spatialyze
- name: Fix lint with autopep8
run: python -m autopep8 spatialyze
- name: Format with black
run: python -m black --config pyproject.toml spatialyze
- name: Sort imports with isort
run: python -m isort spatialyze
- name: Commit formatted changes
run: ./scripts/commit-and-push.sh "[CI] format"