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

Fix version tests in CI #5

Merged
merged 4 commits into from
Dec 5, 2023

Conversation

gmgunter
Copy link
Member

@gmgunter gmgunter commented Dec 5, 2023

Fix version tests in CI by fetching tags when checking out the repo so that setuptools_scm correctly infers the version syntax.

Fix version tests in CI by fetching tags when checking out the repo so
that setuptools_scm correctly infers the version syntax.
@gmgunter
Copy link
Member Author

gmgunter commented Dec 5, 2023

One of the unit tests checks the format of the __version_tuple__ attribute generated by setuptools_scm. By default, setuptools_scm doesn't include a patch version number -- only major & minor numbers. In order to add the patch number, it needs to see an existing tag that has one.

The unit test ensures that the patch number is present. It was failing in CI since the default behavior of actions/checkout is to fetch only the HEAD of the branch, excluding the version history and tags (see actions/checkout#249).

actions/checkout#579 is supposed to be a fix for this, but AFAICT it does not actually cause tags to be fetched. Ultimately, the fix that I ended up with was fetching the full history + tags. This seems to resolve the issue, and I don't imagine the history ever getting large enough that it presents a meaningful bottleneck for testing.

@gmgunter gmgunter merged commit d288b35 into isce-framework:main Dec 5, 2023
5 checks passed
@gmgunter gmgunter deleted the fix-version-tests-ci branch December 5, 2023 04:07
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

Successfully merging this pull request may close these issues.

1 participant