-
-
Notifications
You must be signed in to change notification settings - Fork 212
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Wrong reported version, while running under actions/checkout@v2 #414
Comments
Off hand the reason is not clear, can you add a |
See this build, linting step:
|
It seems the clone depth is zero and no tags get loaded, which in turn takes away all of the Metadata setuprools_scm needs, please use a full clone |
for setuptools_scm 4.0 i will cause an error here |
Fetching all tagged commits doesn't solve the issue - git can't count the number of intervening commits, or even know which of the tagged commits is the closest parent to master. You need every commit in between. Be nice if there was a kind of shallow clone where all commit objects from deeper than |
@chrisjbillington here's a working example of how to do it in GHA: https://github.com/ansible/pylibssh/blob/1e7b17f/.github/workflows/build-test-n-publish.yml#L146-L151 (credit: @matthewfeickert) |
im closing this one as current suggestion is to fetch everything #431 is a followup to make better workflows |
I'm having a problem with this -- I think it is related, but I guess maybe I'm missing something else. Here's my workflow: https://github.com/steven-murray/hmf/pull/62/checks?check_run_id=694283873 Short problem: I am using
as described in the link posted above. The last two lines are printing
which is what I would expect. However, I have a step after this that does
to print out the version that My full workflow is here: https://github.com/steven-murray/hmf/blob/pypi/.github/workflows/publish-to-pypi.yaml Any help would be much appreciated! |
@steven-murray it's unrelated. You use a legacy setup.py invocation but forgot to configure it: https://github.com/pypa/setuptools_scm#setuppy-usage. |
@webknjaz thank you, that did it. I didn't realize that merely having a |
@steven-murray I think it wasn't about having setup.py but about invoking it directly. |
FTR I've faced another interesting incarnation of this. git fetch --prune --unshallow
git fetch --depth=1 origin +refs/tags/*:refs/tags/* followed by removing the tags from Just wanted to document this corner case.
|
@webknjaz please open a new issue and consider rerunning with debug |
I don't think this is necessary. It's probably not this project's fault. I only wanted to document this so that it'd be useful to folks coming to this page from Google. |
see this error pypa/setuptools-scm#414
With version [0.86.0](https://github.com/packit/packit/actions/runs/6901837024) the **pypi_bublish** action is failing. The failing command is `python -m build` which is retrieving a *wrong version*. If you clone the repo and you run `python -m build` you get the correct version. But if you run `python -m build` in this container, which is doing more or less what the github **checkout** action does, you get the wrong version. ```FROM ubuntu:latest RUN apt-get update && apt-get install -y --no-install-recommends \ git \ python3 \ python3.10-venv \ python3-pip RUN git config --global --add safe.directory /packit RUN git config --global init.defaultBranch main RUN git init /packit WORKDIR /packit RUN git remote add origin https://github.com/packit/packit RUN git config --local gc.auto 0 RUN git submodule foreach --recursive sh -c "git config --local --name-only --get-regexp 'core\.sshCommand' && git config --local --unset-all 'core.sshCommand' || :" RUN git submodule foreach --recursive sh -c "git config --local --name-only --get-regexp 'http\.https\:\/\/github\.com\/\.extraheader' && git config --local --unset-all 'http.https://github.com/.extraheader' || :" #RUN git config --local http.https://github.com/.extraheader AUTHORIZATION: basic *** RUN git -c protocol.version=2 fetch --no-tags --prune --progress --no-recurse-submodules --depth=1 origin 44f90cd RUN git checkout --progress --force 44f90cd RUN git fetch --prune --unshallow RUN git fetch --depth=1 origin +refs/tags/*:refs/tags/* ``` A [thread](pypa/setuptools-scm#414) about the problem. And thanks to @webknjaz [solution](https://github.com/ansible/pylibssh/blob/1e7b17f/.github/workflows/build-test-n-publish.yml#L146-L151) adding this two lines of code to the container makes **scm** work again.
Signed-off-by: Eduardo Apolinario <[email protected]>
* Enable python 3.12 Signed-off-by: Eduardo Apolinario <[email protected]> * Relax the constraints on tensorflow Signed-off-by: Eduardo Apolinario <[email protected]> * wip - split tensorflow tests Signed-off-by: Eduardo Apolinario <[email protected]> * Run on python 3.12 Signed-off-by: Eduardo Apolinario <[email protected]> * Split tensorflow unit tests in their own tests Signed-off-by: Eduardo Apolinario <[email protected]> * Fix typo in dev-requirements.in Signed-off-by: Eduardo Apolinario <[email protected]> * Run extra unit tests in separate step Signed-off-by: Eduardo Apolinario <[email protected]> * Remove windows restriction Signed-off-by: Eduardo Apolinario <[email protected]> * Fix unit_test_extras make target Signed-off-by: Eduardo Apolinario <[email protected]> * Fix typo in makefile and version restriction in dev-requirements.in Signed-off-by: Eduardo Apolinario <[email protected]> * Add support for 3.12 in default_images.py Signed-off-by: Eduardo Apolinario <[email protected]> * Modify regex in dataclass tests Signed-off-by: Eduardo Apolinario <[email protected]> * Rename step in pythonbuild gh workflow Signed-off-by: Eduardo Apolinario <[email protected]> * Enable 3.12 in serialization tests Signed-off-by: Eduardo Apolinario <[email protected]> * Read python versions from env var Signed-off-by: Eduardo Apolinario <[email protected]> * Revert "Read python versions from env var" This reverts commit 6d0fb12. Signed-off-by: Eduardo Apolinario <[email protected]> * Run integration tests on 3.12 Signed-off-by: Eduardo Apolinario <[email protected]> * Use bookworm as base image Signed-off-by: Eduardo Apolinario <[email protected]> * Restrict ydata-profiling Signed-off-by: Eduardo Apolinario <[email protected]> * Install latest flytekit Signed-off-by: Eduardo Apolinario <[email protected]> * Mount .git in dev image and output version Signed-off-by: Eduardo Apolinario <[email protected]> * Cat dynamic version in integration test gh workflow Signed-off-by: Eduardo Apolinario <[email protected]> * Use solution described in pypa/setuptools-scm#414 Signed-off-by: Eduardo Apolinario <[email protected]> * Remove investigation aids Signed-off-by: Eduardo Apolinario <[email protected]> * Install pandas in deck plugin Signed-off-by: Eduardo Apolinario <[email protected]> * Revert bump of flytekit version in pod plugin Signed-off-by: Eduardo Apolinario <[email protected]> * Combine installation of flytekit and plugins in dev image Signed-off-by: Eduardo Apolinario <[email protected]> * Test setting fetch-depth: 0 Signed-off-by: Eduardo Apolinario <[email protected]> * Use with stanza Signed-off-by: Eduardo Apolinario <[email protected]> * Comment need for fetch-depth: 0 Signed-off-by: Eduardo Apolinario <[email protected]> --------- Signed-off-by: Eduardo Apolinario <[email protected]> Co-authored-by: Eduardo Apolinario <[email protected]>
E.g. in this build I got "0.1.dev1+g731594d", while correct one is something like "0.11.0a15.dev184+g5cbde2799".
The text was updated successfully, but these errors were encountered: