Skip to content

Commit

Permalink
Fix yaml and add linting
Browse files Browse the repository at this point in the history
Signed-off-by: Adam Li <[email protected]>
  • Loading branch information
adam2392 committed Oct 31, 2023
1 parent 004ecc6 commit a071f1e
Show file tree
Hide file tree
Showing 7 changed files with 267 additions and 176 deletions.
4 changes: 2 additions & 2 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ jobs:

- python/install-packages:
pkg-manager: poetry
cache-version: "v2" # change to clear cache
cache-version: "v2" # change to clear cache
args: "--with docs --extras viz --extras sims"
- run:
name: Check poetry package versions
Expand Down Expand Up @@ -162,7 +162,7 @@ jobs:
cat $BASH_ENV
- python/install-packages:
pkg-manager: poetry
cache-version: "v1" # change to clear cache
cache-version: "v1" # change to clear cache
args: "--with docs"
- run:
name: make linkcheck
Expand Down
32 changes: 16 additions & 16 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@ concurrency:
on:
pull_request:
paths:
- '**.py'
- '**.yml'
- '**.toml'
- "**.py"
- "**.yml"
- "**.toml"
push:
branches: [main]
paths:
- '**.py'
- "**.py"
tags:
- 'v*.*.*'
- "v*.*.*"
workflow_dispatch:

jobs:
Expand All @@ -22,25 +22,25 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
poetry-version: [1.6.1]
poetry-version: [1.6.1]
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup Python 3.9
uses: actions/setup-python@v4
with:
python-version: '3.9'
architecture: 'x64'
python-version: "3.9"
architecture: "x64"
- name: Install Poetry ${{ matrix.poetry-version }}
uses: abatilo/[email protected]
with:
poetry-version: ${{ matrix.poetry-version }}
- name: Install Poetry Dynamic Versioning Plugin
run: pip install poetry-dynamic-versioning

- name: Install dependencies
run: poetry install --only style

# check formatting of the code style
- name: Check code formatting
run: poetry run poe format_check
Expand Down Expand Up @@ -72,7 +72,7 @@ jobs:
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
architecture: 'x64'
architecture: "x64"
- name: Install Poetry ${{ matrix.poetry-version }}
uses: abatilo/[email protected]
with:
Expand Down Expand Up @@ -130,7 +130,7 @@ jobs:
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
architecture: 'x64'
architecture: "x64"
- name: Install Poetry ${{ matrix.poetry-version }}
uses: abatilo/[email protected]
with:
Expand All @@ -143,19 +143,19 @@ jobs:
run: |
poetry install --with test
- name: Install Networkx (main)
if: "matrix.networkx == 'main'"
if: "matrix.networkx == 'main'"
run: |
pip uninstall -yq networkx
git clone https://github.com/networkx/networkx.git
cd networkx
pip install .[default]
- name: Setup torch for pgmpy
if: "matrix.os == 'ubuntu'"
shell: bash
run: |
sudo apt-get install nvidia-cuda-toolkit nvidia-cuda-toolkit-gcc
- name: Run pytest # headless via Xvfb on linux
run: poetry run poe unit_test
- name: Upload coverage stats to codecov
Expand All @@ -179,7 +179,7 @@ jobs:
uses: actions/setup-python@v4
with:
python-version: 3.9
architecture: 'x64'
architecture: "x64"
- name: Install dependencies
run: |
python -m pip install --progress-bar off --upgrade pip setuptools wheel
Expand Down
9 changes: 4 additions & 5 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@

repos:
- repo: https://github.com/floatingpurr/sync_with_poetry
rev: "0.4.0" # the revision or tag to clone at
rev: "0.4.0" # the revision or tag to clone at
hooks:
- id: sync_with_poetry
args: ["--all"] # optional args
args: ["--all"] # optional args
- repo: https://github.com/psf/black
rev: 22.12.0
hooks:
Expand All @@ -27,18 +27,17 @@ repos:
rev: "6.0.0"
hooks:
- id: flake8
- repo: https://github.com/pre-commit/mirrors-mypy
- repo: https://github.com/pre-commit/mirrors-mypy
rev: "v0.971"
hooks:
- id: mypy
name: mypy (dodiscover)
args: ["--config-file", "pyproject.toml"]
files: ^dodiscover/
- repo: https://github.com/pre-commit/mirrors-mypy
- repo: https://github.com/pre-commit/mirrors-mypy
rev: "v0.971"
hooks:
- id: mypy
name: mypy (tests)
args: ["--config-file", "pyproject.toml"]
files: ^tests/

6 changes: 6 additions & 0 deletions .yamllint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
extends: default

rules:
line-length: disable
document-start: disable
truthy: disable
71 changes: 70 additions & 1 deletion poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit a071f1e

Please sign in to comment.