tomaroberts / nii2dcm

nii2dcm: NIfTI to DICOM creation with Python
Other
56 stars 14 forks source link

Adds GitHub Action to automatically publish to TestPyPI #25

Closed tomaroberts closed 1 year ago

tomaroberts commented 1 year ago

WIP

tomaroberts commented 1 year ago

fetch-depth 0 was key to unlocking this PR working on GHAs. Without this, the checkout step in the GHA did not clone the repo sufficiently, therefore setuptools-scm thought the most recent tag was 0.1, hence created 0.1.dev1 version number every time, which caused the GHA to crash because when it pushed to TestPyPI, there was already an existing 0.1.dev1 version.

With fetch-depth 0, the GHA clones the repo such that it finds the latest tag, e.g. 0.1.2 and all the commits since then, so setuptools-scm is able to create a version label with accurate guessing, e.g. 0.1.2.dev37

This was v confusing on the whole...

See here for other users experiencing similar: https://github.com/pypa/setuptools_scm/issues/480

tomaroberts commented 1 year ago

Mild pain in the ass, but in the end...