[BLD] Add script that fails build if git tags do not exist #27770
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 Travis build process can fail in hard to decipher ways if git tags are not synced between
upstream
and a developer's repo. This failure mode would occur in the main repo if we go 2000 commits (current clone depth, ~9 months) without tagging a release. This PR explicitly fails the build with instructions of how to resolve if this situation is encountered.The underlying issue is that
versioneer
and the underlyinggit describe
rely on tags to exist in the local repo for the purposes of creating a version description like:As Travis makes a shallow clone, these tags are will not exist if:
pandas
goes 2000 commits without tagging a commitIf tags do not exist, we get something like:
Which causes causes tests involving downstream libraries like
pyarrow
,statsmodels
, etc to fail their internal version checks in sometimes indecipherable ways like this:With some digging, you can eventually find that the root cause is:
Syncing tags between repos resolves the issue.
black pandas
git diff upstream/master -u -- "*.py" | flake8 --diff