From 313dc471c86914bbd4aca5b5d30d5beca44d78dc Mon Sep 17 00:00:00 2001 From: Sarah Wooders Date: Thu, 30 Nov 2023 13:30:58 -0800 Subject: [PATCH] Run formatting checks with poetry (#537) * update black version * add workflow dispatch --- .github/workflows/black_format.yml | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/.github/workflows/black_format.yml b/.github/workflows/black_format.yml index b06f1c0c..f4e8dbdf 100644 --- a/.github/workflows/black_format.yml +++ b/.github/workflows/black_format.yml @@ -4,6 +4,7 @@ on: pull_request: paths: - '**.py' + workflow_dispatch: jobs: black-check: @@ -13,15 +14,24 @@ jobs: uses: actions/checkout@v2 - name: Set up Python - uses: actions/setup-python@v2 + uses: actions/setup-python@v4 with: - python-version: 3.10.10 + python-version: "3.11" - - name: Install Black - run: pip install black + - name: Install poetry + run: pip install poetry + + - name: Set Poetry config + run: | + poetry config virtualenvs.in-project false + poetry config virtualenvs.path ~/.virtualenvs + + - name: Install dependencies using Poetry + run: | + poetry install -E dev - name: Run Black - run: black --check . -l 140 + run: poetry run black --check . -l 140 # (Optional) If you want to automatically fix formatting issues # Uncomment the following steps: