Skip to content

Commit

Permalink
Fix dandi release action (#459)
Browse files Browse the repository at this point in the history
* fix dandi release action

* limit matrix
  • Loading branch information
CodyCBakerPhD authored May 5, 2024
1 parent 26425a7 commit 0871442
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 26 deletions.
65 changes: 39 additions & 26 deletions .github/workflows/dandi_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 2 additions & 0 deletions src/nwbinspector/nwbinspector.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down

0 comments on commit 0871442

Please sign in to comment.