diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1eb28dc51..102c679dd 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -217,9 +217,8 @@ 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 }}) # multiple flags is marked as an error in codecov UI, but is actually fine # https://github.com/codecov/feedback/issues/567 @@ -281,6 +280,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 @@ -289,9 +292,8 @@ 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 }}) flags: Ubuntu,${{ matrix.python }} fail_ci_if_error: false @@ -332,9 +334,8 @@ 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 }}) flags: macOS,${{ matrix.python }} fail_ci_if_error: false @@ -353,7 +354,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`, `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 @@ -378,9 +380,8 @@ jobs: f.write("\n") - if: always() - uses: codecov/codecov-action@v3 + uses: codecov/codecov-action@v5 with: - directory: empty name: Alpine flags: Alpine,${{ steps.get-version.outputs.version }} fail_ci_if_error: false diff --git a/ci.sh b/ci.sh index f414d94a2..07797937e 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. @@ -142,8 +137,10 @@ echo "::endgroup::" echo "::group::Coverage" coverage combine --rcfile ../pyproject.toml -coverage report -m --rcfile ../pyproject.toml -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 +coverage xml --rcfile ./pyproject.toml # Remove the LSP again; again we want to do this ASAP to avoid # accidentally breaking other stuff. diff --git a/pyproject.toml b/pyproject.toml index 2e88ed3e4..f712c105d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -292,18 +292,13 @@ show_contexts = true skip_covered = false [tool.coverage.paths] -_site-packages-to-src-mapping = [ +source = [ "src", - "*/src", - '*\src', - "*/lib/pypy*/site-packages", - "*/lib/python*/site-packages", - '*\Lib\site-packages', + "**/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 +314,7 @@ omit = [ parallel = true plugins = [] relative_files = true -source = ["."] +source = ["trio"] [tool.coverage.report] precision = 1