Update GitHub URLs to pattern-causality org #40
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Lint | |
| on: [push, pull_request] | |
| jobs: | |
| lint: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - name: Set up Python | |
| uses: actions/setup-python@v4 | |
| with: | |
| python-version: "3.8" | |
| - name: Cache pip | |
| uses: actions/cache@v3 | |
| with: | |
| path: ~/.cache/pip | |
| key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt', 'setup.py', 'pyproject.toml') }} | |
| restore-keys: | | |
| ${{ runner.os }}-pip- | |
| - name: Install system dependencies | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y g++ python3-dev libomp-dev build-essential | |
| - name: Install Python dependencies | |
| run: | | |
| python -m pip install --upgrade pip setuptools wheel | |
| python -m pip install numpy pandas | |
| python -m pip install black isort flake8 mypy typing-extensions | |
| python -m pip install build | |
| - name: Set up compiler environment | |
| run: | | |
| python_include=$(python3 -c 'import sysconfig; print(sysconfig.get_path("include"))') | |
| numpy_include=$(python3 -c 'import numpy; print(numpy.get_include())') | |
| echo "CFLAGS=-I${python_include} -I${numpy_include}" >> $GITHUB_ENV | |
| echo "CXXFLAGS=-I${python_include} -I${numpy_include} -fopenmp -std=c++11 -O3 -Wall -fPIC" >> $GITHUB_ENV | |
| echo "LDFLAGS=-fopenmp" >> $GITHUB_ENV | |
| echo "NPY_NO_DEPRECATED_API=NPY_1_7_API_VERSION" >> $GITHUB_ENV | |
| echo "CC=gcc" >> $GITHUB_ENV | |
| echo "CXX=g++" >> $GITHUB_ENV | |
| - name: Create directories | |
| run: | | |
| mkdir -p pattern_causality/utils | |
| mkdir -p pattern_causality/cpp | |
| mkdir -p utils | |
| touch pattern_causality/__init__.py | |
| touch pattern_causality/utils/__init__.py | |
| touch pattern_causality/cpp/__init__.py | |
| touch utils/__init__.py | |
| - name: Build package | |
| run: | | |
| python -m pip install -v -e . | |
| - name: Format with Black | |
| run: | | |
| black . --check --diff | |
| continue-on-error: true | |
| - name: Check imports with isort | |
| run: | | |
| isort . --check-only --diff | |
| continue-on-error: true | |
| - name: Lint with flake8 | |
| run: | | |
| flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics | |
| flake8 . --count --exit-zero --max-complexity=10 --statistics | |
| continue-on-error: true | |
| - name: Type check with mypy | |
| run: | | |
| mypy pattern_causality --ignore-missing-imports | |
| continue-on-error: true |