diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 09582eed9..76438ec73 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -26,6 +26,7 @@ jobs: fail-fast: false matrix: os: ["ubuntu-latest", "windows-2022"] + python: ${{ (github.event_name == 'pull_request' && fromJSON('["3.8", "3.11"]')) || fromJSON('["3.8", "3.9", "3.10", "3.11"]') }} type: ["cli", "dapp", "data_dependency", @@ -53,10 +54,10 @@ jobs: type: truffle steps: - uses: actions/checkout@v3 - - name: Set up Python 3.8 + - name: Set up Python ${{ matrix.python }} uses: actions/setup-python@v3 with: - python-version: 3.8 + python-version: ${{ matrix.python }} - name: Install dependencies run: | pip install ".[test]" diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index a003eb168..b3754bfd7 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -25,12 +25,13 @@ jobs: matrix: os: ["ubuntu-latest", "windows-2022"] type: ["unit", "integration", "tool"] + python: ${{ (github.event_name == 'pull_request' && fromJSON('["3.8", "3.11"]')) || fromJSON('["3.8", "3.9", "3.10", "3.11"]') }} steps: - uses: actions/checkout@v3 - - name: Set up Python 3.8 + - name: Set up Python ${{ matrix.python }} uses: actions/setup-python@v4 with: - python-version: 3.8 + python-version: ${{ matrix.python }} cache: "pip" cache-dependency-path: setup.py @@ -74,7 +75,7 @@ jobs: uses: ./.github/actions/upload-coverage # only aggregate test coverage over linux-based tests to avoid any OS-specific filesystem information stored in # coverage metadata. - if: ${{ matrix.os == 'ubuntu-latest' }} + if: ${{ matrix.os == 'ubuntu-latest' && matrix.python == '3.8' }} coverage: needs: diff --git a/slither/utils/loc.py b/slither/utils/loc.py index 0e51dfa46..dde91578b 100644 --- a/slither/utils/loc.py +++ b/slither/utils/loc.py @@ -1,4 +1,4 @@ -from dataclasses import dataclass +from dataclasses import dataclass, field from pathlib import Path from typing import List, Tuple @@ -19,9 +19,9 @@ class LoCInfo: @dataclass class LoC: - src: LoCInfo = LoCInfo() - dep: LoCInfo = LoCInfo() - test: LoCInfo = LoCInfo() + src: LoCInfo = field(default_factory=LoCInfo) + dep: LoCInfo = field(default_factory=LoCInfo) + test: LoCInfo = field(default_factory=LoCInfo) def to_pretty_table(self) -> MyPrettyTable: table = MyPrettyTable(["", "src", "dep", "test"])