diff --git a/.github/workflows/dandi_release.yml b/.github/workflows/dandi_release.yml index 66a050897..51be35aa2 100644 --- a/.github/workflows/dandi_release.yml +++ b/.github/workflows/dandi_release.yml @@ -4,33 +4,46 @@ on: workflow_call env: DANDI_TESTS_NONETWORK: "1" +defaults: + run: + shell: bash + jobs: - build-and-test: - name: Testing against current DANDI release and dev branch - runs-on: ubuntu-latest + test: + runs-on: ${{ matrix.os }} + env: + NO_ET: 1 + DANDI_ALLOW_LOCALHOST_URLS: "1" + DANDI_PAGINATION_DISABLE_FALLBACK: "1" + DANDI_TESTS_PERSIST_DOCKER_COMPOSE: "1" strategy: fail-fast: false + matrix: + os: + - ubuntu-latest + python: + - '3.11' + steps: - - uses: s-weigand/setup-conda@v1 - with: - update-conda: true - python-version: 3.9 - conda-channels: conda-forge - - uses: actions/checkout@v3 - - run: git fetch --prune --unshallow --tags - - - name: Install virtualenv - run: pip install virtualenv - - - name: Install and test against latest DANDI release - run: | - virtualenv --system-site-packages --python=python3 venvs/dev3 - source venvs/dev3/bin/activate - git clone https://github.com/NeurodataWithoutBorders/nwbinspector - cd nwbinspector - pip install -e . - cd .. - git clone https://github.com/dandi/dandi-cli - cd dandi-cli - pip install dandi[test] - pytest -vv + - name: Set up environment + uses: actions/checkout@v4 + with: + # Fetch all commits so that versioneer will return something compatible + # with semantic-version + fetch-depth: 0 + + - name: Set up Python ${{ matrix.python }} + uses: actions/setup-python@v5 + with: + python-version: ${{ matrix.python }} + + - name: Install latest DANDI release + run: | + python -m pip install --upgrade pip wheel + pip install "dandi[extras,test]" + + - name: Install dev versions of NWB Inspector + run: pip install git+https://github.com/NeurodataWithoutBorders/nwbinspector + + - name: Run all tests + run: python -m pytest -s -v diff --git a/src/nwbinspector/nwbinspector.py b/src/nwbinspector/nwbinspector.py index 2471eb3e7..994ac30df 100644 --- a/src/nwbinspector/nwbinspector.py +++ b/src/nwbinspector/nwbinspector.py @@ -52,6 +52,8 @@ def default(self, o): # noqa D102 return o.__dict__ if isinstance(o, Enum): return o.name + if isinstance(o, Version): + return str(o) else: return super().default(o)