From 690b0efb0e0484d4f3d2569ea5f24341ea3f6d6c Mon Sep 17 00:00:00 2001 From: Cosimo Lupo Date: Sun, 7 Aug 2016 18:06:09 +0100 Subject: [PATCH] .travis/run.sh: if $BUILD_DIST is true, do `git fetch --unshallow` Else Travis only clones the last 50 commits, and `git describe` doesn't work. --- .travis/run.sh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.travis/run.sh b/.travis/run.sh index 9ff433cdd..e0b19a8a0 100755 --- a/.travis/run.sh +++ b/.travis/run.sh @@ -17,5 +17,12 @@ if [[ "${TOXENV}" == "jython" ]]; then jython -m pytest || true else source ~/.venv/bin/activate + if [ "$BUILD_DIST" = true ]; then + # Travis by default only clones a 'shallow' repository with --depth=50. + # When building the distribution packages, we use git to determine the + # package version string (via setuptools_scm), hence we need to fetch + # the whole repo, and not just the last 50 commits. + git fetch --unshallow + fi tox fi \ No newline at end of file