-
-
Notifications
You must be signed in to change notification settings - Fork 216
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 <eapolinario@users.noreply.github.com>
* Enable python 3.12 Signed-off-by: Eduardo Apolinario <eapolinario@users.noreply.github.com> * Relax the constraints on tensorflow Signed-off-by: Eduardo Apolinario <eapolinario@users.noreply.github.com> * wip - split tensorflow tests Signed-off-by: Eduardo Apolinario <eapolinario@users.noreply.github.com> * Run on python 3.12 Signed-off-by: Eduardo Apolinario <eapolinario@users.noreply.github.com> * Split tensorflow unit tests in their own tests Signed-off-by: Eduardo Apolinario <eapolinario@users.noreply.github.com> * Fix typo in dev-requirements.in Signed-off-by: Eduardo Apolinario <eapolinario@users.noreply.github.com> * Run extra unit tests in separate step Signed-off-by: Eduardo Apolinario <eapolinario@users.noreply.github.com> * Remove windows restriction Signed-off-by: Eduardo Apolinario <eapolinario@users.noreply.github.com> * Fix unit_test_extras make target Signed-off-by: Eduardo Apolinario <eapolinario@users.noreply.github.com> * Fix typo in makefile and version restriction in dev-requirements.in Signed-off-by: Eduardo Apolinario <eapolinario@users.noreply.github.com> * Add support for 3.12 in default_images.py Signed-off-by: Eduardo Apolinario <eapolinario@users.noreply.github.com> * Modify regex in dataclass tests Signed-off-by: Eduardo Apolinario <eapolinario@users.noreply.github.com> * Rename step in pythonbuild gh workflow Signed-off-by: Eduardo Apolinario <eapolinario@users.noreply.github.com> * Enable 3.12 in serialization tests Signed-off-by: Eduardo Apolinario <eapolinario@users.noreply.github.com> * Read python versions from env var Signed-off-by: Eduardo Apolinario <eapolinario@users.noreply.github.com> * Revert "Read python versions from env var" This reverts commit 6d0fb12. Signed-off-by: Eduardo Apolinario <eapolinario@users.noreply.github.com> * Run integration tests on 3.12 Signed-off-by: Eduardo Apolinario <eapolinario@users.noreply.github.com> * Use bookworm as base image Signed-off-by: Eduardo Apolinario <eapolinario@users.noreply.github.com> * Restrict ydata-profiling Signed-off-by: Eduardo Apolinario <eapolinario@users.noreply.github.com> * Install latest flytekit Signed-off-by: Eduardo Apolinario <eapolinario@users.noreply.github.com> * Mount .git in dev image and output version Signed-off-by: Eduardo Apolinario <eapolinario@users.noreply.github.com> * Cat dynamic version in integration test gh workflow Signed-off-by: Eduardo Apolinario <eapolinario@users.noreply.github.com> * Use solution described in pypa/setuptools-scm#414 Signed-off-by: Eduardo Apolinario <eapolinario@users.noreply.github.com> * Remove investigation aids Signed-off-by: Eduardo Apolinario <eapolinario@users.noreply.github.com> * Install pandas in deck plugin Signed-off-by: Eduardo Apolinario <eapolinario@users.noreply.github.com> * Revert bump of flytekit version in pod plugin Signed-off-by: Eduardo Apolinario <eapolinario@users.noreply.github.com> * Combine installation of flytekit and plugins in dev image Signed-off-by: Eduardo Apolinario <eapolinario@users.noreply.github.com> * Test setting fetch-depth: 0 Signed-off-by: Eduardo Apolinario <eapolinario@users.noreply.github.com> * Use with stanza Signed-off-by: Eduardo Apolinario <eapolinario@users.noreply.github.com> * Comment need for fetch-depth: 0 Signed-off-by: Eduardo Apolinario <eapolinario@users.noreply.github.com> --------- Signed-off-by: Eduardo Apolinario <eapolinario@users.noreply.github.com> Co-authored-by: Eduardo Apolinario <eapolinario@users.noreply.github.com>
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: