upgraded to v4, lost versioning in github actions workflows #444
Replies: 1 comment 10 replies
-
Hi @mathematicalmichael and thanks for your explanations. You are right that PyScaffold 4 is no longer needed at setup time, so it's no longer a requirement as this was demanded by many people over time. Still, setuptools-scm which does the actual magic of determining the version number by looking it up in the git repo is still needed at setup time, i.e. when building, and there is no way around this. But this is actually no problem since only Github Action needs this to build your package and push it to some artifact store. The problem you might have is that Github Actions does a shallow checkout of your git repo. You can do a "normal" full-depth checkout with: - name: Checkout Repo
uses: actions/checkout@v2
with:
fetch-depth: 0 # avoids shallow checkout as needed by setuptools-scm Checkout the github workflow for building and publishing PyScaffold itself as reference. |
Beta Was this translation helpful? Give feedback.
-
Hi there!
I'm in need of some help. I was on the verge of ditching pyscaffold [edit: back to loving it] until I went through the docs one last time and noticed the changes in v4, namely that it would not require pyscaffold for setup. One of the big reasons I was drawn to this project was because of the automatic versioning tied to git history. I really liked being able to tie github actions to release versions and have true CD.
pyscaffold 3.3 was causing problems for "Dockerizing" my package in the cloud and I thought that the upgrade might get around these issues. The only way I was able to successfully build my image was to strip out some of pyscaffold, and then I lost the version numbers. If I build locally, I got version numbers correctly (I copied over my git folder into the image).
Docker aside, even though github actions does some magic with git cloning that I don't quite understand, on the last version of pyscaffold I was able to get proper version numbers when building the packages in the CI/CD pipeline.
I tried v4 of pyscaffold and I'm noticing that it always builds my package with 0.0.0 as the version in the pipeline now. https://github.com/mathematicalmichael/mud-examples/runs/2434672475#step:6:73 for example.
When I build locally I get the proper versions, so I'm suspecting something with git is the problem. How might I go about having versioning work in github-actions-like environments which mess with git history? Am I stuck on the previous version of pyscaffold if I want to do so? I suspect that if I can get v4 to work in github actions with proper version numbers, I can also get it to work in docker without having to copy my
.git
folder.I have three branches where I'm experimenting: one where I attempt dockerization with the previous pyscaffold,
feature/docker
, another where I just experiment with pyscaffold v4:hotfix/update-pyscaffold
and one where I try to merge the two branches with a revised dockerfile: https://github.com/mathematicalmichael/mud-examples/tree/feature/docker-pyscaffold that would be the dream + saving grace of pyscaffold.I really hate the alternative of managing a VERSION file, and feel that the tie to git is inherently helpful, if not a pain for CI/CD environments.
Beta Was this translation helpful? Give feedback.
All reactions