From 6bb55364f821b244f7b2d5439d2008f6d36c1961 Mon Sep 17 00:00:00 2001 From: Wil Thieme Date: Mon, 12 Aug 2024 11:41:56 -0400 Subject: [PATCH 01/14] remove mac-specific action yml --- .github/workflows/tests-mac.yml | 46 --------------------------------- 1 file changed, 46 deletions(-) delete mode 100644 .github/workflows/tests-mac.yml diff --git a/.github/workflows/tests-mac.yml b/.github/workflows/tests-mac.yml deleted file mode 100644 index c895701836..0000000000 --- a/.github/workflows/tests-mac.yml +++ /dev/null @@ -1,46 +0,0 @@ -name: tests for mac -# test mac on single python version as mac tests use 10x minutes/storage - -on: - pull_request: - branches: ["main", "major-release"] - push: - branches: ["main", "major-release"] - -env: - TESTING: 1 - -jobs: - build: - strategy: - matrix: - python-version: ['3.8', '3.11', '3.12'] - limited-dependencies: ['','TRUE'] - - runs-on: macos-latest - - steps: - - - uses: actions/checkout@v4 - - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v5 - with: - python-version: ${{ matrix.python-version }} - cache: "pip" - - - name: Install dependencies - env: - PARSONS_LIMITED_DEPENDENCIES: ${{ matrix.limited-dependencies }} - run: | - python -m pip install -U pip - python -m pip install .[all] - python -m pip install -r requirements-dev.txt - - - name: Run tests - run: pytest - - - name: Check linting - run: | - ruff check parsons/ test/ useful_resources/ - ruff format --diff test/ useful_resources/ From fd87618874927b6c654baf3cff6fad3f50c211f1 Mon Sep 17 00:00:00 2001 From: Wil Thieme Date: Mon, 12 Aug 2024 11:42:22 -0400 Subject: [PATCH 02/14] rename test action yml --- .github/workflows/{test-linux-windows.yml => test.yml} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename .github/workflows/{test-linux-windows.yml => test.yml} (100%) diff --git a/.github/workflows/test-linux-windows.yml b/.github/workflows/test.yml similarity index 100% rename from .github/workflows/test-linux-windows.yml rename to .github/workflows/test.yml From 4c22162103087fc0eec75f02a9225d8bda6f21ae Mon Sep 17 00:00:00 2001 From: Wil Thieme Date: Mon, 12 Aug 2024 11:47:14 -0400 Subject: [PATCH 03/14] add mac testing to test action --- .github/workflows/test.yml | 83 ++++++++++++++++++++++++-------------- 1 file changed, 52 insertions(+), 31 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index ec191b7f8a..49831cc89e 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -1,46 +1,67 @@ -name: tests +name: Pytest, Ruff on: pull_request: - branches: ["main", "major-release"] + paths: + - .github/workflows/test.yml + - requirements*.txt + - "**.py" push: - branches: ["main", "major-release"] + paths: + - .github/workflows/test.yml + - requirements*.txt + - "**.py" + workflow_dispatch: env: TESTING: 1 jobs: - build: + test_and_lint: strategy: matrix: - python-version: ['3.8', '3.9', '3.10', '3.11', '3.12'] - limited-dependencies: ['','TRUE'] - os: [ubuntu-latest] # add in windows-latest to add windows testing + python-version: + - "3.12" + - "3.11" + - "3.10" + - "3.9" + - "3.8" + limited-dependencies: + - "" + - "TRUE" + os: + - ubuntu-latest + include: + - os: macos-latest + python-version: "3.12" + - os: macos-latest + python-version: "3.12" + limited-dependencies: true + - os: macos-latest + python-version: "3.8" + - os: macos-latest + python-version: "3.8" + limited-dependencies: true runs-on: ${{ matrix.os }} steps: - - - uses: actions/checkout@v4 - - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v5 - with: - python-version: ${{ matrix.python-version }} - cache: "pip" - - - name: Install dependencies - env: - PARSONS_LIMITED_DEPENDENCIES: ${{ matrix.limited-dependencies }} - run: | - python -m pip install -U pip - python -m pip install .[all] - python -m pip install -r requirements-dev.txt - - - name: Run tests - run: pytest -rf test/ - - - name: Check linting - run: | - ruff check parsons/ test/ useful_resources/ - ruff format --diff parsons/ test/ useful_resources/ + - uses: actions/checkout@v4 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v5 + with: + python-version: ${{ matrix.python-version }} + cache: pip + - name: Install dependencies + env: + PARSONS_LIMITED_DEPENDENCIES: ${{ matrix.limited-dependencies }} + run: | + pip install -U pip + pip install -r requirements.txt + pip install -r requirements-dev.txt + - name: Run tests + run: pytest -rf test/ + - name: Check linting + run: | + ruff check parsons/ test/ useful_resources/ + ruff format --diff parsons/ test/ useful_resources/ From 14f70d47b73af1e63a0098847bd740e6c2484f96 Mon Sep 17 00:00:00 2001 From: Wil Thieme Date: Mon, 12 Aug 2024 11:47:42 -0400 Subject: [PATCH 04/14] use UV for faster lint+test action --- .github/workflows/test.yml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 49831cc89e..3042423d70 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -52,13 +52,15 @@ jobs: with: python-version: ${{ matrix.python-version }} cache: pip + - name: Install uv + run: | + pip install -U pip uv - name: Install dependencies env: PARSONS_LIMITED_DEPENDENCIES: ${{ matrix.limited-dependencies }} run: | - pip install -U pip - pip install -r requirements.txt - pip install -r requirements-dev.txt + uv pip install --system -e .[all] + uv pip install --system -r requirements-dev.txt - name: Run tests run: pytest -rf test/ - name: Check linting From 14d7965d7bc9c08e40ee1ca816fe9a61f96c5886 Mon Sep 17 00:00:00 2001 From: Wil Thieme Date: Mon, 12 Aug 2024 11:50:29 -0400 Subject: [PATCH 05/14] consistent order of matrix variables in job names --- .github/workflows/test.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 3042423d70..fa1d49fe38 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -20,6 +20,8 @@ jobs: test_and_lint: strategy: matrix: + os: + - ubuntu-latest python-version: - "3.12" - "3.11" @@ -29,8 +31,6 @@ jobs: limited-dependencies: - "" - "TRUE" - os: - - ubuntu-latest include: - os: macos-latest python-version: "3.12" From 41e19c9bed4f483d1927783cf51a1ca2aa9dd9fe Mon Sep 17 00:00:00 2001 From: Wil Thieme Date: Mon, 12 Aug 2024 11:52:49 -0400 Subject: [PATCH 06/14] use identical form for limited-dependencies TRUE --- .github/workflows/test.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index fa1d49fe38..3dcb022033 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -36,12 +36,12 @@ jobs: python-version: "3.12" - os: macos-latest python-version: "3.12" - limited-dependencies: true + limited-dependencies: "TRUE" - os: macos-latest python-version: "3.8" - os: macos-latest python-version: "3.8" - limited-dependencies: true + limited-dependencies: "TRUE" runs-on: ${{ matrix.os }} From 248d1e56066fe89c1e8812e21a51be04a9d8f329 Mon Sep 17 00:00:00 2001 From: Wil Thieme Date: Mon, 12 Aug 2024 11:55:38 -0400 Subject: [PATCH 07/14] add pip intall verification --- .github/workflows/pip-intall.yml | 61 ++++++++++++++++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 .github/workflows/pip-intall.yml diff --git a/.github/workflows/pip-intall.yml b/.github/workflows/pip-intall.yml new file mode 100644 index 0000000000..707274cb36 --- /dev/null +++ b/.github/workflows/pip-intall.yml @@ -0,0 +1,61 @@ +name: Pytest, Ruff + +on: + pull_request: + paths: + - .github/workflows/pip-install.yml + - requirements.txt + - setup.py + push: + paths: + - .github/workflows/pip-install.yml + - requirements.txt + - setup.py + workflow_dispatch: + +env: + TESTING: 1 + +jobs: + test_and_lint: + strategy: + matrix: + os: + - ubuntu-latest + python-version: + - "3.12" + - "3.11" + - "3.10" + - "3.9" + - "3.8" + limited-dependencies: + - "" + - "TRUE" + include: + - os: macos-latest + python-version: "3.12" + - os: macos-latest + python-version: "3.12" + limited-dependencies: "TRUE" + - os: macos-latest + python-version: "3.8" + - os: macos-latest + python-version: "3.8" + limited-dependencies: "TRUE" + + runs-on: ${{ matrix.os }} + + steps: + - uses: actions/checkout@v4 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v5 + with: + python-version: ${{ matrix.python-version }} + cache: pip + - name: Install dependencies + - env: + PARSONS_LIMITED_DEPENDENCIES: ${{ matrix.limited-dependencies }} + run: | + pip install -r requirements-dev.txt + pip install -e .[all] + \ No newline at end of file From ea0ed260c2afd965bc1431fe7206ec387fdcdafa Mon Sep 17 00:00:00 2001 From: Wil Thieme Date: Mon, 12 Aug 2024 11:56:55 -0400 Subject: [PATCH 08/14] rename actions --- .github/workflows/pip-intall.yml | 3 +-- .github/workflows/test.yml | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/pip-intall.yml b/.github/workflows/pip-intall.yml index 707274cb36..122a19e662 100644 --- a/.github/workflows/pip-intall.yml +++ b/.github/workflows/pip-intall.yml @@ -1,4 +1,4 @@ -name: Pytest, Ruff +name: Install with pip on: pull_request: @@ -58,4 +58,3 @@ jobs: run: | pip install -r requirements-dev.txt pip install -e .[all] - \ No newline at end of file diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 3dcb022033..2d7da3913a 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -1,4 +1,4 @@ -name: Pytest, Ruff +name: Pytest and ruff on: pull_request: From 14f8eadaa56a42ceed4e371d816b8e6c4c5854bb Mon Sep 17 00:00:00 2001 From: Wil Thieme Date: Mon, 12 Aug 2024 11:58:32 -0400 Subject: [PATCH 09/14] fix name of pip install yml --- .github/workflows/{pip-intall.yml => pip-install.yml} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename .github/workflows/{pip-intall.yml => pip-install.yml} (100%) diff --git a/.github/workflows/pip-intall.yml b/.github/workflows/pip-install.yml similarity index 100% rename from .github/workflows/pip-intall.yml rename to .github/workflows/pip-install.yml From 4503e31637f9c4ea4e442f265cb5b8487db58b53 Mon Sep 17 00:00:00 2001 From: Wil Thieme Date: Mon, 12 Aug 2024 12:01:58 -0400 Subject: [PATCH 10/14] fix syntax error in pip-install.yml --- .github/workflows/pip-install.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pip-install.yml b/.github/workflows/pip-install.yml index 122a19e662..576b6fe3bf 100644 --- a/.github/workflows/pip-install.yml +++ b/.github/workflows/pip-install.yml @@ -53,7 +53,7 @@ jobs: python-version: ${{ matrix.python-version }} cache: pip - name: Install dependencies - - env: + env: PARSONS_LIMITED_DEPENDENCIES: ${{ matrix.limited-dependencies }} run: | pip install -r requirements-dev.txt From ab7916701988782e543c60d4b822e338e293758b Mon Sep 17 00:00:00 2001 From: Wil Thieme Date: Mon, 12 Aug 2024 12:03:05 -0400 Subject: [PATCH 11/14] unique job name for pip-install --- .github/workflows/pip-install.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pip-install.yml b/.github/workflows/pip-install.yml index 576b6fe3bf..99fe3c184a 100644 --- a/.github/workflows/pip-install.yml +++ b/.github/workflows/pip-install.yml @@ -17,7 +17,7 @@ env: TESTING: 1 jobs: - test_and_lint: + pip-install: strategy: matrix: os: From be0e735eb1b63a9df78ab80f4f166ec83513d734 Mon Sep 17 00:00:00 2001 From: Wil Thieme Date: Mon, 12 Aug 2024 12:19:46 -0400 Subject: [PATCH 12/14] track lint/format pass/fail separately --- .github/workflows/test.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 2d7da3913a..78e0b0eb26 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -66,4 +66,6 @@ jobs: - name: Check linting run: | ruff check parsons/ test/ useful_resources/ + - name: Check formatting + run: | ruff format --diff parsons/ test/ useful_resources/ From 0413e38da6493915c2d787d3065c3e6d6201a5be Mon Sep 17 00:00:00 2001 From: Wil Thieme Date: Mon, 12 Aug 2024 12:21:51 -0400 Subject: [PATCH 13/14] re-order tests for faster failing --- .github/workflows/test.yml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 78e0b0eb26..46e461200d 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -61,11 +61,12 @@ jobs: run: | uv pip install --system -e .[all] uv pip install --system -r requirements-dev.txt - - name: Run tests - run: pytest -rf test/ - - name: Check linting + - name: Lint run: | ruff check parsons/ test/ useful_resources/ - - name: Check formatting + - name: Tests + run: pytest -rf test/ + - name: Format run: | ruff format --diff parsons/ test/ useful_resources/ + \ No newline at end of file From dbb61c2da460965a6fb75df1700074cb0271341c Mon Sep 17 00:00:00 2001 From: Wil T Date: Mon, 12 Aug 2024 16:09:12 -0400 Subject: [PATCH 14/14] use ruff format --check flag --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 46e461200d..b8d06b9692 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -68,5 +68,5 @@ jobs: run: pytest -rf test/ - name: Format run: | - ruff format --diff parsons/ test/ useful_resources/ + ruff format --check --diff parsons/ test/ useful_resources/ \ No newline at end of file