File tree Expand file tree Collapse file tree 3 files changed +41
-2
lines changed Expand file tree Collapse file tree 3 files changed +41
-2
lines changed Original file line number Diff line number Diff line change 2121
2222git :
2323 # for cloning
24- depth : 2000
24+ depth : false
2525
2626matrix :
2727 fast_finish : true
@@ -63,7 +63,7 @@ before_install:
6363 - pwd
6464 - uname -a
6565 - git --version
66- - git tag
66+ - ./ci/check_git_tags.sh
6767 # Because travis runs on Google Cloud and has a /etc/boto.cfg,
6868 # it breaks moto import, see:
6969 # https://github.com/spulec/moto/issues/1771
Original file line number Diff line number Diff line change 1+ set -e
2+
3+ if [[ ! $( git tag) ]]; then
4+ echo " No git tags in clone, please sync your git tags with upstream using:"
5+ echo " git fetch --tags upstream"
6+ echo " git push --tags origin"
7+ echo " "
8+ echo " If the issue persists, the clone depth needs to be increased in .travis.yml"
9+ exit 1
10+ fi
11+
12+ # This will error if there are no tags and we omit --always
13+ DESCRIPTION=$( git describe --long --tags)
14+ echo " $DESCRIPTION "
15+
16+ if [[ " $DESCRIPTION " == * " untagged" * ]]; then
17+ echo " Unable to determine most recent tag, aborting build"
18+ exit 1
19+ else
20+ if [[ " $DESCRIPTION " != * " g" * ]]; then
21+ # A good description will have the hash prefixed by g, a bad one will be
22+ # just the hash
23+ echo " Unable to determine most recent tag, aborting build"
24+ exit 1
25+ else
26+ echo " $( git tag) "
27+ fi
28+ fi
Original file line number Diff line number Diff line change 11import collections
2+ from distutils .version import LooseVersion
23from functools import partial
34import string
45
@@ -117,3 +118,13 @@ def test_git_version():
117118 git_version = pd .__git_version__
118119 assert len (git_version ) == 40
119120 assert all (c in string .hexdigits for c in git_version )
121+
122+
123+ def test_version_tag ():
124+ version = pd .__version__
125+ try :
126+ version > LooseVersion ("0.0.1" )
127+ except TypeError :
128+ raise ValueError (
129+ "No git tags exist, please sync tags between upstream and your repo"
130+ )
You can’t perform that action at this time.
0 commit comments