From 5ac2f2c666ae5b438a02b9e356cdc8c2b6db9305 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Robert?= Date: Fri, 1 Nov 2024 11:05:44 +0100 Subject: [PATCH] tentative fix (n) --- .github/workflows/ci.yml | 19 +++++++------------ pyproject.toml | 12 +++--------- 2 files changed, 10 insertions(+), 21 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 31c9fed0..12ed1072 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -27,19 +27,15 @@ jobs: - '3.11' - '3.12' - '3.13' - venv-loc: [bin] include: - os: ubuntu-20.04 python-version: '3.9' - venv-loc: bin deps: minimal install-args: --resolution=lowest-direct - os: macos-latest python-version: '3.13' - venv-loc: bin - os: windows-latest python-version: '3.13' - venv-loc: Scripts runs-on: ${{ matrix.os }} env: @@ -58,8 +54,6 @@ jobs: **/requirements/*.txt **/pyproject.toml - # could in principle be done through uv sync but - # env resolution appears buggy as of uv 0.4.20 - run: | uv venv uv pip install . ${{ matrix.install-args }} @@ -74,13 +68,14 @@ jobs: - run: uv pip list - - name: Run pytest - shell: bash - # could in principle be done through uv run coverage - # but env resolution appears buggy as of uv 0.4.20 + - name: Run pytest (without coverage) + if: ${{ !startsWith(matrix.os, 'ubuntu') }} + run: uv run --no-project pytest --color=yes + + - name: Run pytest (with coverage) + if: startsWith(matrix.os, 'ubuntu') run: | - source .venv/${{matrix.venv-loc}}/activate - coverage run --parallel-mode -m pytest --color=yes + uv run --no-project coverage run --parallel-mode -m pytest --color=yes - name: Upload coverage data # only using reports from ubuntu because diff --git a/pyproject.toml b/pyproject.toml index 8761609f..93199d9a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -71,6 +71,7 @@ combine-as-imports = true known-first-party = ["nonos"] [tool.pytest.ini_options] +addopts = "-ra" filterwarnings = [ "error", 'ignore:datetime\.datetime\.utcfromtimestamp\(\) is deprecated:DeprecationWarning', # https://github.com/dateutil/dateutil/pull/1285 @@ -87,14 +88,8 @@ show_error_context = true disallow_untyped_defs = false # TODO: add missing annotations and switch this option to true ignore_missing_imports = true -[tool.coverage.paths] -source = [ - "src", - "*/site-packages", -] - [tool.coverage.run] -branch = true +# branch = true source = [ "src/nonos", "tests", @@ -105,8 +100,7 @@ omit = [ [tool.coverage.report] show_missing = true -precision = 2 -skip_covered = true +skip_covered = false exclude_lines = [ # a stricter default pragma "\\# pragma: no cover\\b",