From 3b3a0218b8af005fcb6827a6aeaba721453e727f Mon Sep 17 00:00:00 2001 From: Kevin Turcios Date: Mon, 29 Jun 2026 11:09:25 -0500 Subject: [PATCH 1/5] ci: split quality checks from test matrix --- .github/workflows/pythonpackage.yml | 58 ++++++++++++++++++----------- 1 file changed, 37 insertions(+), 21 deletions(-) diff --git a/.github/workflows/pythonpackage.yml b/.github/workflows/pythonpackage.yml index 87eee0895d..159cc8f4c6 100644 --- a/.github/workflows/pythonpackage.yml +++ b/.github/workflows/pythonpackage.yml @@ -3,6 +3,40 @@ name: Test Rich module on: [pull_request] jobs: + quality: + runs-on: ubuntu-latest + defaults: + run: + shell: bash + steps: + - uses: actions/checkout@v4 + - name: Set up Python 3.11 + uses: actions/setup-python@v5 + with: + python-version: "3.11" + - name: Install and configure Poetry + # TODO: workaround for https://github.com/snok/install-poetry/issues/94 + uses: snok/install-poetry@v1.3.4 + with: + version: 1.3.1 + virtualenvs-in-project: true + - name: Install dependencies + run: poetry install + - name: Format check with black + run: poetry run make format-check + - name: Typecheck with mypy + run: poetry run make typecheck + - name: Test with pytest (with coverage) + run: poetry run pytest tests -v --cov=./rich --cov-report=xml:./coverage.xml --cov-report term-missing + - name: Upload code coverage + uses: codecov/codecov-action@v4 + with: + token: ${{ secrets.CODECOV_TOKEN }} + file: ./coverage.xml + name: rich + flags: unittests + env_vars: OS,PYTHON + build: runs-on: ${{ matrix.os }} strategy: @@ -12,6 +46,7 @@ jobs: python-version: ["3.9", "3.10", "3.11", "3.12", "3.13", "3.14"] exclude: - { os: windows-latest, python-version: "3.13" } + - { os: ubuntu-latest, python-version: "3.11" } defaults: run: shell: bash @@ -30,24 +65,5 @@ jobs: virtualenvs-in-project: true - name: Install dependencies run: poetry install - if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true' - - name: Format check with black - run: | - source $VENV - make format-check - - name: Typecheck with mypy - run: | - source $VENV - make typecheck - - name: Test with pytest (with coverage) - run: | - source $VENV - pytest tests -v --cov=./rich --cov-report=xml:./coverage.xml --cov-report term-missing - - name: Upload code coverage - uses: codecov/codecov-action@v4 - with: - token: ${{ secrets.CODECOV_TOKEN }} - file: ./coverage.xml - name: rich - flags: unittests - env_vars: OS,PYTHON + - name: Test with pytest + run: poetry run pytest tests -v From 62c78fbe36966504dfb4b3151a0ad83703de9976 Mon Sep 17 00:00:00 2001 From: Kevin Turcios Date: Mon, 29 Jun 2026 11:13:08 -0500 Subject: [PATCH 2/5] ci: gate test matrix on quality checks --- .github/workflows/pythonpackage.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/pythonpackage.yml b/.github/workflows/pythonpackage.yml index 159cc8f4c6..fced490ed0 100644 --- a/.github/workflows/pythonpackage.yml +++ b/.github/workflows/pythonpackage.yml @@ -38,6 +38,7 @@ jobs: env_vars: OS,PYTHON build: + needs: quality runs-on: ${{ matrix.os }} strategy: fail-fast: false From 05c671844af4d06d931906a07e3ecd21598c038d Mon Sep 17 00:00:00 2001 From: Kevin Turcios Date: Mon, 29 Jun 2026 11:19:13 -0500 Subject: [PATCH 3/5] ci: install dependencies with uv --- .github/workflows/pythonpackage.yml | 43 +++++++++++++++++------------ 1 file changed, 25 insertions(+), 18 deletions(-) diff --git a/.github/workflows/pythonpackage.yml b/.github/workflows/pythonpackage.yml index fced490ed0..ec1deb0d8c 100644 --- a/.github/workflows/pythonpackage.yml +++ b/.github/workflows/pythonpackage.yml @@ -14,20 +14,25 @@ jobs: uses: actions/setup-python@v5 with: python-version: "3.11" - - name: Install and configure Poetry - # TODO: workaround for https://github.com/snok/install-poetry/issues/94 - uses: snok/install-poetry@v1.3.4 - with: - version: 1.3.1 - virtualenvs-in-project: true + - name: Install uv + uses: astral-sh/setup-uv@v6 - name: Install dependencies - run: poetry install + run: > + uv pip install --system -e . + "attrs==21.4.0" + "black==22.12.0" + "markdown-it-py==3.0.0" + "mypy==1.14.1" + "pygments==2.19.2" + "pytest==7.4.4" + "pytest-cov==3.0.0" + "typing-extensions==4.13.2" - name: Format check with black - run: poetry run make format-check + run: python -m black --check . - name: Typecheck with mypy - run: poetry run make typecheck + run: python -m mypy -p rich --no-incremental - name: Test with pytest (with coverage) - run: poetry run pytest tests -v --cov=./rich --cov-report=xml:./coverage.xml --cov-report term-missing + run: python -m pytest tests -v --cov=./rich --cov-report=xml:./coverage.xml --cov-report term-missing - name: Upload code coverage uses: codecov/codecov-action@v4 with: @@ -58,13 +63,15 @@ jobs: with: python-version: ${{ matrix.python-version }} allow-prereleases: true - - name: Install and configure Poetry - # TODO: workaround for https://github.com/snok/install-poetry/issues/94 - uses: snok/install-poetry@v1.3.4 - with: - version: 1.3.1 - virtualenvs-in-project: true + - name: Install uv + uses: astral-sh/setup-uv@v6 - name: Install dependencies - run: poetry install + run: > + uv pip install --system -e . + "attrs==21.4.0" + "markdown-it-py==3.0.0" + "pygments==2.19.2" + "pytest==7.4.4" + "typing-extensions==4.13.2" - name: Test with pytest - run: poetry run pytest tests -v + run: python -m pytest tests -v From b48571a865ca303c6f6c08cbfde10b93b2a84d26 Mon Sep 17 00:00:00 2001 From: Kevin Turcios Date: Mon, 29 Jun 2026 11:21:43 -0500 Subject: [PATCH 4/5] ci: use dependency group for uv installs --- .github/workflows/pythonpackage.yml | 19 ++----------------- pyproject.toml | 10 ++++++++++ 2 files changed, 12 insertions(+), 17 deletions(-) diff --git a/.github/workflows/pythonpackage.yml b/.github/workflows/pythonpackage.yml index ec1deb0d8c..6fadaf9458 100644 --- a/.github/workflows/pythonpackage.yml +++ b/.github/workflows/pythonpackage.yml @@ -17,16 +17,7 @@ jobs: - name: Install uv uses: astral-sh/setup-uv@v6 - name: Install dependencies - run: > - uv pip install --system -e . - "attrs==21.4.0" - "black==22.12.0" - "markdown-it-py==3.0.0" - "mypy==1.14.1" - "pygments==2.19.2" - "pytest==7.4.4" - "pytest-cov==3.0.0" - "typing-extensions==4.13.2" + run: uv pip install --system -e . --group dev - name: Format check with black run: python -m black --check . - name: Typecheck with mypy @@ -66,12 +57,6 @@ jobs: - name: Install uv uses: astral-sh/setup-uv@v6 - name: Install dependencies - run: > - uv pip install --system -e . - "attrs==21.4.0" - "markdown-it-py==3.0.0" - "pygments==2.19.2" - "pytest==7.4.4" - "typing-extensions==4.13.2" + run: uv pip install --system -e . --group dev - name: Test with pytest run: python -m pytest tests -v diff --git a/pyproject.toml b/pyproject.toml index bc699a0b7c..d4a483cd00 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -44,6 +44,16 @@ attrs = "^21.4.0" pre-commit = "^2.17.0" typing-extensions = ">=4.0.0, <5.0" +[dependency-groups] +dev = [ + "pytest>=7.0.0,<8.0.0", + "black>=22.6,<23.0", + "mypy>=1.11,<2.0", + "pytest-cov>=3.0.0,<4.0.0", + "attrs>=21.4.0,<22.0.0", + "typing-extensions>=4.0.0,<5.0", +] + [build-system] requires = ["poetry-core>=1.0.0"] build-backend = "poetry.core.masonry.api" From 73adfc8fa928ab6875e6dab9d8501a1792fca0b4 Mon Sep 17 00:00:00 2001 From: Kevin Turcios Date: Mon, 29 Jun 2026 11:25:31 -0500 Subject: [PATCH 5/5] ci: use smaller test dependency group --- .github/workflows/pythonpackage.yml | 2 +- pyproject.toml | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/.github/workflows/pythonpackage.yml b/.github/workflows/pythonpackage.yml index 6fadaf9458..79a32523e5 100644 --- a/.github/workflows/pythonpackage.yml +++ b/.github/workflows/pythonpackage.yml @@ -57,6 +57,6 @@ jobs: - name: Install uv uses: astral-sh/setup-uv@v6 - name: Install dependencies - run: uv pip install --system -e . --group dev + run: uv pip install --system -e . --group test - name: Test with pytest run: python -m pytest tests -v diff --git a/pyproject.toml b/pyproject.toml index d4a483cd00..c166afd628 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -45,12 +45,15 @@ pre-commit = "^2.17.0" typing-extensions = ">=4.0.0, <5.0" [dependency-groups] -dev = [ +test = [ "pytest>=7.0.0,<8.0.0", + "attrs>=21.4.0,<22.0.0", +] +dev = [ + { include-group = "test" }, "black>=22.6,<23.0", "mypy>=1.11,<2.0", "pytest-cov>=3.0.0,<4.0.0", - "attrs>=21.4.0,<22.0.0", "typing-extensions>=4.0.0,<5.0", ]