From 753379c1e78567468b862678725db1d6be95ccf3 Mon Sep 17 00:00:00 2001 From: Todd Leonhardt Date: Fri, 17 Jan 2025 19:30:54 -0500 Subject: [PATCH 1/3] Experiment with using the uv GitHub Action --- .github/workflows/build.yml | 14 +++++--------- .github/workflows/doc.yml | 12 ++++++------ .github/workflows/format.yml | 2 +- .github/workflows/lint.yml | 2 +- .github/workflows/mypy.yml | 13 ++++++++----- 5 files changed, 21 insertions(+), 22 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 5ab971b8..6fe6ae1b 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -20,18 +20,14 @@ jobs: fetch-depth: 0 # Needed for setuptools_scm to work correctly - name: Install uv uses: astral-sh/setup-uv@v5 - - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} - allow-prereleases: true - name: Install the project - run: uv sync --all-extras --dev + run: uv sync --dev - - name: Run tests - run: uv run inv pytest --junit --no-pty --base + - name: Install the project + run: make install - - name: Run isolated tests - run: uv run inv pytest --junit --no-pty --isolated + - name: Run tests + run: make test diff --git a/.github/workflows/doc.yml b/.github/workflows/doc.yml index 1bbb0ddf..e1dd62b3 100644 --- a/.github/workflows/doc.yml +++ b/.github/workflows/doc.yml @@ -12,7 +12,7 @@ jobs: strategy: matrix: os: [ubuntu-latest] - python-version: ["3.12"] + python-version: ["3.13"] fail-fast: false runs-on: ${{ matrix.os }} steps: @@ -21,11 +21,11 @@ jobs: # Only a single commit is fetched by default, for the ref/SHA that triggered the workflow. # Set fetch-depth: 0 to fetch all history for all branches and tags. fetch-depth: 0 # Needed for setuptools_scm to work correctly - - name: Set up Python - uses: actions/setup-python@v5 # https://github.com/actions/setup-python + - name: Install uv and set the python version + uses: astral-sh/setup-uv@v5 with: python-version: ${{ matrix.python-version }} - - name: Install python prerequisites - run: pip install -U --user pip setuptools setuptools-scm griffe_typingdoc mkdocs-include-markdown-plugin mkdocs-macros-plugin mkdocs-material mkdocstrings[python] . plugins/ext_test + - name: Install the project + run: uv sync --docs - name: MkDocs documentation build - run: mkdocs build + run: uv run mkdocs build -s diff --git a/.github/workflows/format.yml b/.github/workflows/format.yml index 64923bb0..70d56586 100644 --- a/.github/workflows/format.yml +++ b/.github/workflows/format.yml @@ -16,5 +16,5 @@ jobs: # Only a single commit is fetched by default, for the ref/SHA that triggered the workflow. # Set fetch-depth: 0 to fetch all history for all branches and tags. fetch-depth: 0 # Needed for setuptools_scm to work correctly - - run: pip install --user ruff + - uses: astral-sh/ruff-action@v3 - run: ruff format --check diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index da02fcba..f2d086d1 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -16,5 +16,5 @@ jobs: # Only a single commit is fetched by default, for the ref/SHA that triggered the workflow. # Set fetch-depth: 0 to fetch all history for all branches and tags. fetch-depth: 0 # Needed for setuptools_scm to work correctly - - run: pip install --user ruff + - uses: astral-sh/ruff-action@v3 - run: ruff check --output-format=github . diff --git a/.github/workflows/mypy.yml b/.github/workflows/mypy.yml index 1754bb63..ff0b752d 100644 --- a/.github/workflows/mypy.yml +++ b/.github/workflows/mypy.yml @@ -12,12 +12,15 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 # https://github.com/actions/checkout - - uses: actions/setup-python@v5 # https://github.com/actions/setup-python with: - python-version: 3.13 - allow-prereleases: true # Only a single commit is fetched by default, for the ref/SHA that triggered the workflow. # Set fetch-depth: 0 to fetch all history for all branches and tags. fetch-depth: 0 # Needed for setuptools_scm to work correctly - - run: pip install -U --user pip mypy - - run: mypy . + - name: Install uv and set the python version + uses: astral-sh/setup-uv@v5 + with: + python-version: 3.13 + - name: Install the project + run: uv sync --validate + - name: Run mypy static type checker + run: uv run mypy . From 4fa65edd369a612234b4c4f519e5317a8cadac84 Mon Sep 17 00:00:00 2001 From: Todd Leonhardt Date: Fri, 17 Jan 2025 19:45:43 -0500 Subject: [PATCH 2/3] Fix build --- .github/workflows/build.yml | 8 ++++---- .github/workflows/doc.yml | 2 +- .github/workflows/mypy.yml | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 6fe6ae1b..efe03268 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -26,8 +26,8 @@ jobs: - name: Install the project run: uv sync --dev - - name: Install the project - run: make install - - name: Run tests - run: make test + run: uv run inv pytest --junit --no-pty --base + + - name: Run isolated tests + run: uv run inv pytest --junit --no-pty --isolated diff --git a/.github/workflows/doc.yml b/.github/workflows/doc.yml index e1dd62b3..c1733df2 100644 --- a/.github/workflows/doc.yml +++ b/.github/workflows/doc.yml @@ -26,6 +26,6 @@ jobs: with: python-version: ${{ matrix.python-version }} - name: Install the project - run: uv sync --docs + run: uv sync --group docs - name: MkDocs documentation build run: uv run mkdocs build -s diff --git a/.github/workflows/mypy.yml b/.github/workflows/mypy.yml index ff0b752d..c24b8a26 100644 --- a/.github/workflows/mypy.yml +++ b/.github/workflows/mypy.yml @@ -21,6 +21,6 @@ jobs: with: python-version: 3.13 - name: Install the project - run: uv sync --validate + run: uv sync --group validate - name: Run mypy static type checker run: uv run mypy . From 1522e428f04f4414df95989bf183e1ffa09320b7 Mon Sep 17 00:00:00 2001 From: Todd Leonhardt Date: Fri, 17 Jan 2025 19:50:29 -0500 Subject: [PATCH 3/3] Try to fix GH Actions tests --- .github/workflows/build.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index efe03268..5ab971b8 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -20,11 +20,15 @@ jobs: fetch-depth: 0 # Needed for setuptools_scm to work correctly - name: Install uv uses: astral-sh/setup-uv@v5 + + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} + allow-prereleases: true - name: Install the project - run: uv sync --dev + run: uv sync --all-extras --dev - name: Run tests run: uv run inv pytest --junit --no-pty --base