From aa95d4c702ec2fa000a18be8c8e973cb6ba0d6fe Mon Sep 17 00:00:00 2001 From: A5rocks Date: Wed, 11 Jun 2025 11:20:54 -0400 Subject: [PATCH 01/14] Switch from installing in `ci.sh` to GHA --- .github/workflows/ci.yml | 4 ++++ ci.sh | 5 ----- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1eb28dc516..2baf0d38d5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -281,6 +281,10 @@ jobs: run: python -m pip install tox && tox -m check + - name: Install python3-apport + run: + sudo apt update + sudo apt install -q python3-apport - name: Run tests if: matrix.check_formatting == '0' run: ./ci.sh diff --git a/ci.sh b/ci.sh index f414d94a2c..8b23ad279f 100755 --- a/ci.sh +++ b/ci.sh @@ -58,11 +58,6 @@ else flags="" fi -# So we can run the test for our apport/excepthook interaction working -if [ -e /etc/lsb-release ] && grep -q Ubuntu /etc/lsb-release; then - sudo apt install -q python3-apport -fi - # If we're testing with a LSP installed, then it might break network # stuff, so wait until after we've finished setting everything else # up. From 1cc8f523bc0dfdd604771efc1baeb08d08696dae Mon Sep 17 00:00:00 2001 From: A5rocks Date: Wed, 11 Jun 2025 11:25:46 -0400 Subject: [PATCH 02/14] Actually use a multiline string --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2baf0d38d5..f47e7ab07e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -282,7 +282,7 @@ jobs: python -m pip install tox && tox -m check - name: Install python3-apport - run: + run: | sudo apt update sudo apt install -q python3-apport - name: Run tests From 3548ed789d811e63e60be9454d267eea8632b4cb Mon Sep 17 00:00:00 2001 From: A5rocks Date: Wed, 11 Jun 2025 11:35:27 -0400 Subject: [PATCH 03/14] Switch over to Codecov v5 --- .github/workflows/ci.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1eb28dc516..1b699980ba 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -217,7 +217,7 @@ jobs: LSP: '${{ matrix.lsp }}' LSP_EXTRACT_FILE: '${{ matrix.lsp_extract_file }}' - if: always() - uses: codecov/codecov-action@v3 + uses: codecov/codecov-action@v5 with: directory: empty name: Windows (${{ matrix.python }}, ${{ matrix.arch }}${{ matrix.extra_name }}) @@ -289,7 +289,7 @@ jobs: - if: >- always() && matrix.check_formatting != '1' - uses: codecov/codecov-action@v3 + uses: codecov/codecov-action@v5 with: directory: empty name: Ubuntu (${{ matrix.python }}${{ matrix.extra_name }}) @@ -332,7 +332,7 @@ jobs: - name: Run tests run: ./ci.sh - if: always() - uses: codecov/codecov-action@v3 + uses: codecov/codecov-action@v5 with: directory: empty name: macOS (${{ matrix.python }}) @@ -378,7 +378,7 @@ jobs: f.write("\n") - if: always() - uses: codecov/codecov-action@v3 + uses: codecov/codecov-action@v5 with: directory: empty name: Alpine From 4cf75273aa12f413d4c958d7c6f2ebba525a9a3c Mon Sep 17 00:00:00 2001 From: A5rocks Date: Wed, 11 Jun 2025 15:50:41 +0000 Subject: [PATCH 04/14] Add `git` for codecov in Alpine --- .github/workflows/ci.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index df98feee5f..f8218ae17e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -357,7 +357,8 @@ jobs: # `python3-dev` (rather than `python:alpine`) for some ctypes reason, # `nodejs` for pyright (`node-env` pulls in nodejs but that takes a while and can time out the test). # `perl` for a platform independent `sed -i` alternative - run: apk update && apk add python3-dev bash nodejs perl + # `git` for codecov + run: apk update && apk add python3-dev bash nodejs perl git - name: Retrieve the project source from an sdist inside the GHA artifact # must be after `apk add` because it relies on `bash` existing From cf753b0c6924cfb5ffa84ea2829cba9259f10874 Mon Sep 17 00:00:00 2001 From: A5rocks Date: Wed, 11 Jun 2025 15:56:43 +0000 Subject: [PATCH 05/14] Add more codecov deps --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f8218ae17e..378e651011 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -357,8 +357,8 @@ jobs: # `python3-dev` (rather than `python:alpine`) for some ctypes reason, # `nodejs` for pyright (`node-env` pulls in nodejs but that takes a while and can time out the test). # `perl` for a platform independent `sed -i` alternative - # `git` for codecov - run: apk update && apk add python3-dev bash nodejs perl git + # `git`, `curl`, `gpg` for codecov + run: apk update && apk add python3-dev bash nodejs perl git curl gpg - name: Retrieve the project source from an sdist inside the GHA artifact # must be after `apk add` because it relies on `bash` existing From 31d7cf76e88dd611301f388d078c0f93c32345e5 Mon Sep 17 00:00:00 2001 From: A5rocks Date: Wed, 11 Jun 2025 16:44:03 +0000 Subject: [PATCH 06/14] Try to simplify coverage configuration --- pyproject.toml | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 2e88ed3e4d..6955791b53 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -291,19 +291,8 @@ showcontent = true show_contexts = true skip_covered = false -[tool.coverage.paths] -_site-packages-to-src-mapping = [ - "src", - "*/src", - '*\src', - "*/lib/pypy*/site-packages", - "*/lib/python*/site-packages", - '*\Lib\site-packages', -] - [tool.coverage.run] branch = true -source_pkgs = ["trio"] omit = [ # Omit the generated files in trio/_core starting with _generated_ "*/trio/_core/_generated_*", @@ -319,7 +308,7 @@ omit = [ parallel = true plugins = [] relative_files = true -source = ["."] +source = ["trio"] [tool.coverage.report] precision = 1 From 06d40f7692102fa8fbedeeef3598eca1c7b5f5ad Mon Sep 17 00:00:00 2001 From: A5rocks Date: Wed, 11 Jun 2025 17:11:26 +0000 Subject: [PATCH 07/14] Try some basic reporting tricks --- pyproject.toml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pyproject.toml b/pyproject.toml index 6955791b53..352394f4d5 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -291,6 +291,12 @@ showcontent = true show_contexts = true skip_covered = false +[tool.coverage.paths] +source = [ + "src/", + "/**/site-packages/" +] + [tool.coverage.run] branch = true omit = [ From 6554e6a04450ba476581979fba7f3072403e2a35 Mon Sep 17 00:00:00 2001 From: A5rocks Date: Wed, 11 Jun 2025 17:17:05 +0000 Subject: [PATCH 08/14] Try more --- ci.sh | 2 +- pyproject.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ci.sh b/ci.sh index 8b23ad279f..a7c8ec787b 100755 --- a/ci.sh +++ b/ci.sh @@ -137,7 +137,7 @@ echo "::endgroup::" echo "::group::Coverage" coverage combine --rcfile ../pyproject.toml -coverage report -m --rcfile ../pyproject.toml +coverage report -m --rcfile ../pyproject.toml --debug=pathmap coverage xml --rcfile ../pyproject.toml # Remove the LSP again; again we want to do this ASAP to avoid diff --git a/pyproject.toml b/pyproject.toml index 352394f4d5..1d1a61a05a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -294,7 +294,7 @@ skip_covered = false [tool.coverage.paths] source = [ "src/", - "/**/site-packages/" + "**/site-packages" ] [tool.coverage.run] From 5c73c530d87d5f06df20eafe8d250da247fb298a Mon Sep 17 00:00:00 2001 From: A5rocks Date: Wed, 11 Jun 2025 17:23:32 +0000 Subject: [PATCH 09/14] Debug missing folder --- .github/workflows/ci.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 378e651011..4daee3438d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -381,6 +381,10 @@ jobs: with open(os.environ["GITHUB_OUTPUT"], "a") as f: f.write("version=" + ".".join(map(str, sys.version_info[:2]))) f.write("\n") + - run: | + ls + ls src + ls trio - if: always() uses: codecov/codecov-action@v5 From f963f269494f84deb9b6ea3b43ef5ae1b73dc768 Mon Sep 17 00:00:00 2001 From: A5rocks Date: Wed, 11 Jun 2025 17:29:50 +0000 Subject: [PATCH 10/14] This is confusing... --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 1d1a61a05a..f712c105d5 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -293,7 +293,7 @@ skip_covered = false [tool.coverage.paths] source = [ - "src/", + "src", "**/site-packages" ] From 0338ee9f8b7612e63808f606a53e715d4fcfecaf Mon Sep 17 00:00:00 2001 From: A5rocks Date: Wed, 11 Jun 2025 17:35:03 +0000 Subject: [PATCH 11/14] More debugging... --- .github/workflows/ci.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4daee3438d..84f02daa59 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -383,8 +383,7 @@ jobs: f.write("\n") - run: | ls - ls src - ls trio + ls src/trio - if: always() uses: codecov/codecov-action@v5 From 384b1e07777f93f71df133fc1cab5bd443b08d86 Mon Sep 17 00:00:00 2001 From: A5rocks Date: Wed, 11 Jun 2025 18:25:19 +0000 Subject: [PATCH 12/14] Try some cwd stuff --- .github/workflows/ci.yml | 3 --- ci.sh | 6 ++++-- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 84f02daa59..378e651011 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -381,9 +381,6 @@ jobs: with open(os.environ["GITHUB_OUTPUT"], "a") as f: f.write("version=" + ".".join(map(str, sys.version_info[:2]))) f.write("\n") - - run: | - ls - ls src/trio - if: always() uses: codecov/codecov-action@v5 diff --git a/ci.sh b/ci.sh index a7c8ec787b..07552c7fb6 100755 --- a/ci.sh +++ b/ci.sh @@ -137,8 +137,10 @@ echo "::endgroup::" echo "::group::Coverage" coverage combine --rcfile ../pyproject.toml -coverage report -m --rcfile ../pyproject.toml --debug=pathmap -coverage xml --rcfile ../pyproject.toml +cd .. # coverage needs to be in the folder containing src/trio +cp empty/.coverage . +coverage report -m --rcfile ./pyproject.toml --debug=pathmap +coverage xml --rcfile ./pyproject.toml # Remove the LSP again; again we want to do this ASAP to avoid # accidentally breaking other stuff. From ff54777b81a1c5e453d9712c40053f248c42b3d5 Mon Sep 17 00:00:00 2001 From: A5rocks Date: Wed, 11 Jun 2025 18:29:26 +0000 Subject: [PATCH 13/14] More cwd stuff --- .github/workflows/ci.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 378e651011..102c679dd4 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -219,7 +219,6 @@ jobs: - if: always() uses: codecov/codecov-action@v5 with: - directory: empty name: Windows (${{ matrix.python }}, ${{ matrix.arch }}${{ matrix.extra_name }}) # multiple flags is marked as an error in codecov UI, but is actually fine # https://github.com/codecov/feedback/issues/567 @@ -295,7 +294,6 @@ jobs: && matrix.check_formatting != '1' uses: codecov/codecov-action@v5 with: - directory: empty name: Ubuntu (${{ matrix.python }}${{ matrix.extra_name }}) flags: Ubuntu,${{ matrix.python }} fail_ci_if_error: false @@ -338,7 +336,6 @@ jobs: - if: always() uses: codecov/codecov-action@v5 with: - directory: empty name: macOS (${{ matrix.python }}) flags: macOS,${{ matrix.python }} fail_ci_if_error: false @@ -385,7 +382,6 @@ jobs: - if: always() uses: codecov/codecov-action@v5 with: - directory: empty name: Alpine flags: Alpine,${{ steps.get-version.outputs.version }} fail_ci_if_error: false From a31d5364a83ccdaf955f7921446faa083644cd99 Mon Sep 17 00:00:00 2001 From: A5rocks Date: Wed, 11 Jun 2025 18:38:07 +0000 Subject: [PATCH 14/14] Final change --- ci.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci.sh b/ci.sh index 07552c7fb6..07797937e9 100755 --- a/ci.sh +++ b/ci.sh @@ -139,7 +139,7 @@ echo "::group::Coverage" coverage combine --rcfile ../pyproject.toml cd .. # coverage needs to be in the folder containing src/trio cp empty/.coverage . -coverage report -m --rcfile ./pyproject.toml --debug=pathmap +coverage report -m --rcfile ./pyproject.toml coverage xml --rcfile ./pyproject.toml # Remove the LSP again; again we want to do this ASAP to avoid