-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #33 from tomaroberts/dunamai-production-fix
Fixes issue with pip install related to dunamai implementation
- Loading branch information
Showing
19 changed files
with
428 additions
and
20 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,13 @@ | ||
# Workflow to build nii2dcm and test different command line interface (CLI) options | ||
# Workflow to build nii2dcm, run unit tests and then execute command line interface (CLI) end-to-end | ||
|
||
name: Build nii2dcm | ||
name: Build & Test nii2dcm | ||
|
||
on: | ||
pull_request: | ||
|
||
jobs: | ||
build-and-test: | ||
name: Build | ||
venv-build-and-test: | ||
name: venv + E2E | ||
|
||
runs-on: ${{ matrix.os }} | ||
|
||
|
@@ -57,6 +57,10 @@ jobs: | |
nii2dcm -h | ||
nii2dcm -v | ||
- name: Run unit tests | ||
run: | | ||
pytest tests/ | ||
- name: Test DicomMRISVR creation | ||
run: | | ||
# run nii2dcm | ||
|
@@ -65,3 +69,52 @@ jobs: | |
ls ./output | ||
# assert DICOM files exist | ||
[ -f "./output/IM_0001.dcm" ] && echo "Output DICOM file exists" || exit 1 | ||
- name: Build pytest coverage file | ||
run: | | ||
pytest --junitxml=pytest.xml --cov-report=term-missing:skip-covered --cov=nii2dcm tests/ | tee pytest-coverage.txt ; echo $? | ||
- name: Pytest coverage comment | ||
id: coverageComment | ||
uses: MishaKav/pytest-coverage-comment@main | ||
with: | ||
pytest-coverage-path: ./pytest-coverage.txt | ||
junitxml-path: ./pytest.xml | ||
|
||
- name: Update Coverage Badge | ||
uses: schneegans/[email protected] | ||
with: | ||
auth: ${{ secrets.PYTEST_COVERAGE_COMMENT }} | ||
gistID: 57ef8057d04f67dbe6e64df410b83079 | ||
filename: nii2dcm-pytest-coverage-comment.json | ||
label: Coverage Report | ||
message: ${{ steps.coverageComment.outputs.coverage }} | ||
color: ${{ steps.coverageComment.outputs.color }} | ||
namedLogo: python | ||
|
||
container-build-and-test: | ||
name: Container | ||
|
||
runs-on: ${{ matrix.os }} | ||
|
||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: [ ubuntu-latest ] | ||
python-version: [ '3.9' ] | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Build container | ||
run: | | ||
docker build -t nii2dcm --progress=plain --no-cache . | ||
docker ps | ||
- name: Test nii2dcm container | ||
run: | | ||
docker run nii2dcm -h | ||
echo "nii2dcm version:" | ||
docker run nii2dcm -v |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# Use the official Python image as the base image | ||
FROM python:3.9-slim | ||
|
||
LABEL org.opencontainers.image.source https://github.com/tomaroberts/nii2dcm | ||
|
||
# Setup | ||
COPY . /home/nii2dcm | ||
WORKDIR /home/nii2dcm | ||
|
||
# Install system dependencies | ||
RUN apt-get update && apt-get install -y \ | ||
bash git \ | ||
&& apt-get clean | ||
|
||
# Update base packages | ||
RUN pip install --upgrade pip && \ | ||
pip install setuptools wheel | ||
|
||
# Install nii2dcm requirements | ||
RUN pip install -r requirements.txt | ||
|
||
# Build package from source | ||
RUN pip install . | ||
|
||
# Test nii2dcm install | ||
# To see output locally during build process: docker build -t nii2dcm --progress=plain . | ||
RUN nii2dcm -h | ||
|
||
ENTRYPOINT ["nii2dcm"] |
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
from dunamai import Version, Style | ||
__version__ = Version.from_git().serialize(metadata=False, style=Style.SemVer) | ||
import dunamai as _dunamai | ||
__version__ = _dunamai.get_version("nii2dcm", third_choice=_dunamai.Version.from_any_vcs).serialize() |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
setuptools | ||
wheel | ||
numpy==1.23.2 | ||
matplotlib==3.6.2 | ||
nibabel==5.0.0 | ||
|
This file contains 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
Empty file.
Oops, something went wrong.