Adopt deepcell-auth for model/data downloads #54
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: CI | |
| on: | |
| push: | |
| branches: [master] | |
| pull_request: | |
| branches: [master] | |
| workflow_dispatch: | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| inference-only: | |
| # Guards the inference / [train] dep boundary. The whole point of the | |
| # [train] extra is that ``pip install deepcell-types`` (no extras) | |
| # pulls only the runtime deps needed to call ``predict()``. The | |
| # ``tests/test_inference_deps.py`` subprocess probe asserts no | |
| # training-only module ends up in sys.modules after the inference | |
| # imports; if it ever does, this job goes red. | |
| name: inference-only / py${{ matrix.python }} | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| python: ["3.11", "3.12"] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| submodules: false | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: ${{ matrix.python }} | |
| cache: pip | |
| - name: Install (inference-only) + dev tools | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install -e . | |
| pip install pytest ruff | |
| - name: Pytest (inference-only — train-only tests skip via conftest) | |
| run: pytest -q | |
| full: | |
| # Full suite with the [train] extra installed. Catches drift between | |
| # training-side code and the tests that exercise it. | |
| name: full / py${{ matrix.python }} | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| python: ["3.11", "3.12"] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| submodules: false | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: ${{ matrix.python }} | |
| cache: pip | |
| - name: Install [train] + dev tools | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install -e ".[train]" | |
| pip install pytest ruff | |
| - name: Pytest (full) | |
| # Data-gated tests (TissueNet archive, gold-standard CSVs) skip | |
| # cleanly when DATA_DIR is not set on a hosted runner. | |
| run: pytest -q | |
| lint: | |
| name: ruff | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| submodules: false | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.12" | |
| cache: pip | |
| - name: Install ruff | |
| run: pip install ruff | |
| - name: ruff check | |
| run: ruff check deepcell_types scripts tests | |
| wheel: | |
| # Builds the wheel and installs it into a clean env, then imports the | |
| # public API and touches package data (vocab.json, channel_mapping.yaml). | |
| # An editable install (-e .) hides missing package-data globs; this job | |
| # catches a wheel that ships without the YAML/JSON the runtime needs. | |
| name: wheel build + install smoke | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| submodules: false | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.12" | |
| cache: pip | |
| - name: Build wheel | |
| run: | | |
| python -m pip install --upgrade pip build | |
| python -m build --wheel | |
| - name: Install wheel into a clean venv and import | |
| run: | | |
| python -m venv /tmp/wheelenv | |
| /tmp/wheelenv/bin/pip install --upgrade pip | |
| /tmp/wheelenv/bin/pip install dist/*.whl | |
| /tmp/wheelenv/bin/python -c "import deepcell_types; from deepcell_types import predict, make_preprocessor, DCTConfig; from deepcell_types.utils import download_model, list_model_versions; DCTConfig().marker2idx; print('wheel OK', deepcell_types.__version__)" | |
| baselines-smoke: | |
| # Installs the FULL [all] extra (train + every baseline, incl. the | |
| # nimbus-inference==0.0.5 pin) and imports each baseline package. Pinned to | |
| # Python 3.11 ONLY: nimbus-inference==0.0.5 requires Python <3.12, so the | |
| # `python_version < '3.12'` markers in [baseline-nimbus] keep [all] | |
| # resolvable on 3.12 (nimbus dropped there) but the runnable Nimbus stack is | |
| # only exercised here on 3.11. Without this job the [baselines]/[all] Docker | |
| # profiles ship untested. | |
| name: baselines [all] import smoke / py3.11 | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| submodules: false | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.11" | |
| cache: pip | |
| - name: Install [all] (train + baselines, incl. nimbus on py3.11) | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install -e ".[all]" | |
| - name: Import baseline packages | |
| run: | | |
| python -c "import xgboost, optuna, nimbus_inference; import deepcell_types.baselines.xgb, deepcell_types.baselines.nimbus, deepcell_types.baselines.maps, deepcell_types.baselines.cellsighter; print('baselines import OK')" |