diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index e0be2de4c..28c32f579 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -69,23 +69,22 @@ jobs: fail-fast: false matrix: include: - - python-version: '3.9' - numpy-version: 1 - - python-version: '3.9' - numpy-version: 2 - python-version: '3.10' - run-expensive-tests: true - report-coverage: true - save-cache: true numpy-version: 1 - python-version: '3.11' numpy-version: 2 - python-version: '3.12' numpy-version: 1 - - python-version: '3.12' - numpy-version: 2 spec-from-main: true - # - python-version: '3.13' + - python-version: '3.13' + numpy-version: 2 + run-expensive-tests: true + report-coverage: true + save-cache: true + # - python-version: '3.14' + # numpy-version: 2 + # spec-from-main: true + # - python-version: '3.15' # numpy-version: 2 steps: @@ -99,6 +98,7 @@ jobs: run: | pip install --upgrade pip pip install -e .[dev,partners] numpy==${{matrix.numpy-version}}.* + pip install git+https://github.com/ilastik/clearscale.git # TODO: remove once clearscale is in dev deps - name: Pyright if: matrix.run-expensive-tests # pyright is not expensive, but we only want to run it once due to otherwise inconsistent typing run: | @@ -173,7 +173,7 @@ jobs: - uses: actions/download-artifact@v4 with: name: coverage.xml - - uses: orgoro/coverage@v3.2 + - uses: orgoro/coverage@v3.3 with: coverageFile: coverage.xml token: ${{ secrets.GITHUB_TOKEN }} @@ -252,7 +252,7 @@ jobs: path: dist - uses: actions/setup-python@v6 with: - python-version: '3.12' + python-version: '3.13' cache: 'pip' - run: pip install -e .[dev,docs,partners] - name: Check doc scripts diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 196c94bfb..b201e40cc 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,15 +1,23 @@ repos: - - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.12.8 - hooks: - - id: ruff-check - args: [--fix, --show-fixes] - repo: local hooks: + - id: ruff-check + name: ruff check + entry: ruff check --fix --show-fixes + language: system + pass_filenames: true + files: ^.*\.py$ + always_run: false + - id: ruff-format + name: ruff format + entry: ruff format + language: system + pass_filenames: true + files: ^.*\.py$ + always_run: false - id: pyright name: pyright entry: pyright language: system - always_run: true + always_run: false pass_filenames: true - files: ^.*\.py$ diff --git a/.vscode/launch.json b/.vscode/launch.json new file mode 100644 index 000000000..7bcab916c --- /dev/null +++ b/.vscode/launch.json @@ -0,0 +1,22 @@ +{ + // Use IntelliSense to learn about possible attributes. + // Hover to view descriptions of existing attributes. + // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 + "version": "0.2.0", + "configurations": [ + { + "name": "Python Debugger: Current File / Tests", + "type": "debugpy", + "request": "launch", + "program": "${file}", + "purpose": [ + "debug-test" + ], + "justMyCode": false, + "env": { + // The monitoring backend skips project files named io.py. + "PYDEVD_USE_SYS_MONITORING": "0" + } + } + ] +} diff --git a/.vscode/settings.json b/.vscode/settings.json index a61bc3d9b..d79e78683 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,25 +1,34 @@ -{ - "window.title": "bioimageio.core", - "python.analysis.languageServerMode": "full", - "python.testing.unittestArgs": [ - "-v", - "-s", - "./tests", - "-p", - "test_*.py" - ], - "python.testing.pytestEnabled": true, - "python.testing.unittestEnabled": false, - "python-envs.pythonProjects": [ - { - "path": "", - "envManager": "ms-python.python:conda", - "packageManager": "ms-python.python:conda" - } - ], - "editor.formatOnSave": true, - "editor.codeActionsOnSave": { - "source.unusedImports": "explicit", - "source.organizeImports": "explicit" - }, -} +{ + "window.title": "bioimageio.core", + "python.languageServer": "Pylance", + "python.analysis.diagnosticMode": "workspace", + "python.testing.unittestArgs": [ + "-v", + "-s", + "./tests", + "-p", + "test_*.py" + ], + "python.testing.pytestEnabled": true, + "python.testing.unittestEnabled": false, + "editor.formatOnSave": true, + "[python]": { + "editor.defaultFormatter": "charliermarsh.ruff", + "editor.codeActionsOnSave": { + "source.unusedImports": "never", + "source.organizeImports": "never", + "source.fixAll.pylance": "never", + "source.fixAll.ruff": "explicit", + "source.organizeImports.ruff": "explicit" + } + }, + "python-envs.defaultEnvManager": "ms-python.python:conda", + "python-envs.defaultPackageManager": "ms-python.python:conda", + "python-envs.pythonProjects": [ + { + "path": ".", + "envManager": "ms-python.python:conda", + "packageManager": "ms-python.python:conda" + } + ], +} diff --git a/README.md b/README.md index 60e26018a..e97b0571d 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@ and compute selected dataset statistics used for preprocessing. [Here you find the bioimageio.core documentation.](https://bioimage-io.github.io/core-bioimage-io-python) -#### Examples +### Examples Notebooks that save and load resource descriptions and validate their format (using bioimageio.spec, a dependency of bioimageio.core)