Closed tomaroberts closed 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
Mild pain in the ass, but in the end...
fetch-depth 0
to enable GitHub Action environment to see enough of repo history. Without this, setuptools-scm is not able to calculate version number properly as it lacks enough information.
WIP
setuptools_scm
to dynamically adjust version number with every commitlocal_scheme = "no-local-version"
optionsetuptools_scm
creates_version.py
with each commit and this is propagated through rest of code (such as CLI-v
option, etc.)