FIX: fake out setuptools scm in tox on ci #29014
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The repository in GHA is a shallow checkout (so to tags) so we are going to get the version wrong no matter what. However, a recent change to our build dependencies (we think meson-python at 0.17) causes setumtools scm to fail to extract any version when installing from a generated sdist.
By setting a pretend version setuptools_scm will never try to look at git. It is not yet clear if this fixes the sdist itself or just continues to use the pretend version when installing.
Debugged this on a call with @QuLogic and @ksunden
To generate a checkout in a state that will fail use (in a container):
/usr/bin/git init /home/runner/work/matplotlib/matplotlib cd /home/runner/work/matplotlib/matplotlib/ /usr/bin/git remote add origin https://github.com/matplotlib/matplotlib /usr/bin/git config --local gc.auto 0 /usr/bin/git -c protocol.version=2 fetch --no-tags --prune --no-recurse-submodules --depth=1 origin +0a6dec17eec446fd28a51bae476a12fd09e73492:refs/remotes/pull/28658/merge /usr/bin/git checkout --progress --force refs/remotes/pull/28658/merge