Skip to content
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

setuptools_scm incompatible with default actions/checkout@v2 #480

Closed
ddelange opened this issue Sep 24, 2020 · 4 comments
Closed

setuptools_scm incompatible with default actions/checkout@v2 #480

ddelange opened this issue Sep 24, 2020 · 4 comments

Comments

@ddelange
Copy link

actions/checkout@v2 no longer fetches tags by default, rather only a single commit, $GITHUB_REF (actions/checkout#100).

Hence, fetch-depth: 0 is needed for the proper version to be detected (unless GH actions runs was triggered on a tag@HEAD):

    steps:
    - uses: actions/checkout@v2
      with:
        fetch-depth: 0

This however slows down checkout significantly on big repos (actions/checkout#258).

Only fetching tags (manually) does not solve the problem:

    steps:
    - uses: actions/checkout@v2

    - name: Fetch tags
      # fetch all tags for changelog and pip install
      run: git fetch origin --depth=1 +refs/tags/*:refs/tags/*

What would be the minimum amount of info to fetch for setuptools_scm to pick up the right tag? Any explanation why it doesn't detect version after running git fetch origin --depth=1 +refs/tags/*:refs/tags/*? Potentially related comment: https://github.com/actions/checkout#217#issuecomment-614067896

@RonnyPfannschmidt
Copy link
Contributor

if the commit graph is incomplete, setuptools_scm cant connect the dots between tagged commit and current commit

@RonnyPfannschmidt
Copy link
Contributor

actions/checkout#249 was requested quite a while back to solve this, it may be necessary to develop a feature in turn where setuptools_scm provides a actions to cheaply generate the metadata

however i not in a position to start work on such tooling this year

@ddelange
Copy link
Author

Thanks for the quick reply. Will simply rely on fetch-depth: 0 and keep an eye on the issue you opened!

@RonnyPfannschmidt
Copy link
Contributor

closing this as upstream issue with gitlab actions

yuzie007 added a commit to yuzie007/mpltern that referenced this issue Nov 29, 2021
mdickinson added a commit to mdickinson/simplefractions that referenced this issue Aug 21, 2022
…elease (#29)

This PR ensures that in the release workflow we do a full clone, so that setuptools_scm has enough information to compute a version number.

We don't strictly need this if we only ever expect to be making releases from a tagged commit (which seems likely), but the failure mode if this is left out is that we compute a wrong version. So it seems better to include it. If some future version of setuptools_scm makes this an error, it should be safe to remove this.

See pypa/setuptools-scm#480 for more discussion.
mdickinson added a commit to enthought/traits-futures that referenced this issue Oct 5, 2022
The automated documentation build workflow currently miscomputes the
version number because GitHub Actions makes a shallow clone without
tags, so there's no way to compute the version number from the tags.

This PR fixes that by having the action clone the whole repository.

See also pypa/setuptools-scm#480
yuzie007 added a commit to yuzie007/mpltern that referenced this issue Oct 16, 2022
psobolewskiPhD added a commit to napari/docs that referenced this issue Feb 13, 2023
…ubstitution (#99)

# Description

See napari/napari#5509 (comment)
The docs live on napari.org don't match PR action downloaded docs when
doing napari version substitution
(#51)

This PR updates the deploy action with `fetch-depth: 0` that was added
to the PR `build_docs` action. This should make the version metadata be
correct (see pypa/setuptools-scm#480)

## Type of change
<!-- Please delete options that are not relevant. -->
- [x] Fixes or improves existing content
- [ ] Adds new content page(s)
- [ ] Fixes or improves workflow, documentation build or deployment

# References
Adresses issue noted here
napari/napari#5509 (comment)

## Final checklist:
- [x] My PR is the minimum possible work for the desired functionality
psobolewskiPhD added a commit to napari/napari that referenced this issue Feb 14, 2023
…stitutions (#5557)

# Description

This PR an an analog to napari/docs#99
The built docs built by this repo PR action have improper napari version
substitution (see napari/docs#51)

This PR fixes that based on the README of
https://github.com/actions/checkout
It updates the deploy action with `fetch-depth: 0`. You can see that
this was added to the napari/docs PR build_docs action and works
correctly. This makes the version metadata be correct (see
pypa/setuptools-scm#480)

## Type of change
- [x] Bug-fix (non-breaking change which fixes an issue)

# References
Motivated by napari/docs#51
Analog to napari/docs#99
mion00 added a commit to mion00/appdaemon that referenced this issue Mar 1, 2023
maresb added a commit to maresb/conda-lock that referenced this issue May 27, 2023
This is necessary to enable setuptools-scm to infer the version number.
Ref: <pypa/setuptools-scm#480>
reuterbal added a commit to ecmwf-ifs/loki that referenced this issue Apr 30, 2024
This resolves the wrong Loki version annotation due to missing git
history. See pypa/setuptools-scm#480.
gemenerik added a commit to bitcraze/crazyflie-clients-python that referenced this issue Nov 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants