diff --git a/.github/workflows/pytest.yaml b/.github/workflows/pytest.yaml index 677f9ca81..61cae33a5 100644 --- a/.github/workflows/pytest.yaml +++ b/.github/workflows/pytest.yaml @@ -28,7 +28,6 @@ jobs: uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} - architecture: 'x64' - name: Install liblsl (linux) if: ${{ matrix.os == 'ubuntu' }} run: | @@ -40,8 +39,12 @@ jobs: - name: Install liblsl (macOS) if: ${{ matrix.os == 'macos' }} run: | - brew update - brew install labstreaminglayer/tap/lsl + curl -L https://github.com/sccn/liblsl/releases/download/v1.16.0/liblsl-1.16.0-OSX_arm64.tar.bz2 -o liblsl-1.16.0-OSX_arm64.tar.bz2 + tar -xf liblsl-1.16.0-OSX_arm64.tar.bz2 + mv lib/liblsl.1.16.0.dylib . + echo "MNE_LSL_LIB=$PWD/liblsl.1.16.0.dylib" >> $GITHUB_ENV + rm -R lib include bin + rm liblsl-1.16.0-OSX_arm64.tar.bz2 - name: Install liblsl (windows) if: ${{ matrix.os == 'windows' }} run: | @@ -71,58 +74,6 @@ jobs: token: ${{ secrets.CODECOV_TOKEN }} verbose: true # optional (default = false) - pytest-arm64: - timeout-minutes: 30 - strategy: - fail-fast: false - matrix: - python-version: ["3.11"] - name: macos-arm64 - py${{ matrix.python-version }} - runs-on: macos-14 - defaults: - run: - shell: bash - steps: - - name: Checkout repository - uses: actions/checkout@v4 - - name: Setup Python ${{ matrix.python-version }} - uses: actions/setup-python@v5 - with: - python-version: ${{ matrix.python-version }} - architecture: 'x64' - - name: Install liblsl - run: | - curl -L https://github.com/sccn/liblsl/releases/download/v1.16.0/liblsl-1.16.0-OSX_arm64.tar.bz2 -o liblsl-1.16.0-OSX_arm64.tar.bz2 - tar -xf liblsl-1.16.0-OSX_arm64.tar.bz2 - mv lib/liblsl.1.16.0.dylib . - rm -R lib include bin - rm liblsl-1.16.0-OSX_arm64.tar.bz2 - - name: Install dependencies - run: | - python -m pip install --progress-bar off --upgrade pip setuptools - python -m pip install --progress-bar off .[test] - - name: Display system information - run: mne_lsl-sys_info --developer - env: - MNE_LSL_LIB: ${{ github.workspace }}/liblsl.1.16.0.dylib - - name: Run pytest - uses: nick-fields/retry@v3 - with: - timeout_minutes: 10 - max_attempts: 3 - command: pytest mne_lsl --cov=mne_lsl --cov-report=xml --cov-config=pyproject.toml -s - env: - MNE_LSL_LIB: ${{ github.workspace }}/liblsl.1.16.0.dylib - - name: Upload to codecov - uses: codecov/codecov-action@v4 - with: - files: ./coverage.xml - flags: unittests # optional - name: codecov-umbrella # optional - fail_ci_if_error: false # optional (default = false) - token: ${{ secrets.CODECOV_TOKEN }} - verbose: true # optional (default = false) - pytest-pip-pre: timeout-minutes: 30 strategy: @@ -141,7 +92,6 @@ jobs: uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} - architecture: 'x64' - name: Install liblsl & linux dependencies run: | curl -L https://github.com/sccn/liblsl/releases/download/v1.16.2/liblsl-1.16.2-jammy_amd64.deb -o liblsl-1.16.2-jammy_amd64.deb @@ -193,7 +143,6 @@ jobs: uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} - architecture: 'x64' - name: Install liblsl (linux) run: | curl -L https://github.com/sccn/liblsl/releases/download/v1.16.2/liblsl-1.16.2-jammy_amd64.deb -o liblsl-1.16.2-jammy_amd64.deb diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 234a0d6f2..63c1336d2 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -6,7 +6,7 @@ repos: files: mne_lsl - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.4.1 + rev: v0.4.2 hooks: - id: ruff name: ruff linter diff --git a/mne_lsl/utils/_checks.py b/mne_lsl/utils/_checks.py index 6c24431b3..4f71aced9 100644 --- a/mne_lsl/utils/_checks.py +++ b/mne_lsl/utils/_checks.py @@ -35,7 +35,7 @@ def ensure_int(item: Any, item_name: Optional[str] = None) -> int: raise TypeError item = int(operator.index(item)) except TypeError: - item_name = "Item" if item_name is None else "'%s'" % item_name + item_name = "Item" if item_name is None else f"'{item_name}'" raise TypeError(f"{item_name} must be an integer, got {type(item)} instead.") return item @@ -114,7 +114,7 @@ def check_type(item: Any, types: tuple, item_name: Optional[str] = None) -> None else: type_name[-1] = "or " + type_name[-1] type_name = ", ".join(type_name) - item_name = "Item" if item_name is None else "'%s'" % item_name + item_name = "Item" if item_name is None else f"'{item_name}'" raise TypeError( f"{item_name} must be an instance of {type_name}, got {type(item)} instead." ) @@ -145,7 +145,7 @@ def check_value( When the value of the item is not one of the valid options. """ if item not in allowed_values: - item_name = "" if item_name is None else " '%s'" % item_name + item_name = "" if item_name is None else f" '{item_name}'" extra = "" if extra is None else " " + extra msg = ( "Invalid value for the{item_name} parameter{extra}. " @@ -153,7 +153,7 @@ def check_value( ) allowed_values = tuple(allowed_values) # e.g., if a dict was given if len(allowed_values) == 1: - options = "The only allowed value is %s" % repr(allowed_values[0]) + options = f"The only allowed value is {repr(allowed_values[0])}" elif len(allowed_values) == 2: options = ( f"Allowed values are {repr(allowed_values[0])} "