tomaroberts / nii2dcm

nii2dcm: NIfTI to DICOM creation with Python
Other
53 stars 13 forks source link

Bugfix: fix versioning for user pip install #33

Closed tomaroberts closed 5 months ago

tomaroberts commented 5 months ago

As per #30 and #31, pip install was failing because of issues with dunamai implementation.

In short: when users pip installed nii2dcm it would fail in __init__.py because dunamai was attempting to determine a version based on the assumption that the files underneath are in a Git repo. However, on a user's computer, it was unlikely they were working in a local version of the nii2dcm repo, hence dunamai would fail.

Reading more, the dunamai instructions imply here and in this issue that it is incompatible with Python sdist builds and wheels/bdist should be used.

This PR:

tomaroberts commented 5 months ago

@jcohen02 – I think I've fixed the dunamai issue. I've tested in a fresh venv using this TestPyPI version outside of my local nii2dcm repo folder and it worked for me. Any chance you could test locally? Can add you as PR reviewer even.

I'm going to build a nii2dcm Docker container as well, which ought to help with build testing too.

PS: I always find the TestPyPI install instruction fails, so I tend to use the following: pip install --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple/ nii2dcm==0.1.2-post.11

jcohen02 commented 5 months ago

Thanks for the update @tomaroberts, happy to review/test.

github-actions[bot] commented 5 months ago

Coverage

Coverage Report
FileStmtsMissCoverMissing
nii2dcm
   __main__.py34340%5–68
   dcm.py93298%165–166
   dcm_writer.py33682%89–95
   nii.py35294%34–35
   run.py30293%57, 66
   utils.py770%8–36
nii2dcm/modules
   mr_image.py59297%39–40
TOTAL4315587% 

Tests Skipped Failures Errors Time
18 0 :zzz: 0 :x: 0 :fire: 4.987s :stopwatch:
github-actions[bot] commented 5 months ago

Coverage

Coverage Report
FileStmtsMissCoverMissing
nii2dcm
   __main__.py34340%5–68
   dcm.py93298%165–166
   dcm_writer.py33682%89–95
   nii.py35294%34–35
   run.py30293%57, 66
   utils.py770%8–36
nii2dcm/modules
   mr_image.py59297%39–40
TOTAL4315587% 

Tests Skipped Failures Errors Time
18 0 :zzz: 0 :x: 0 :fire: 4.931s :stopwatch:
tomaroberts commented 5 months ago

@jcohen02 – I've test this quite a bit now and fairly sure it's fixed. Going to do a release soon – if it's still broken somehow I will reinvestigate (!)