File tree 3 files changed +41
-2
lines changed
3 files changed +41
-2
lines changed Original file line number Diff line number Diff line change 21
21
22
22
git :
23
23
# for cloning
24
- depth : 2000
24
+ depth : false
25
25
26
26
matrix :
27
27
fast_finish : true
@@ -63,7 +63,7 @@ before_install:
63
63
- pwd
64
64
- uname -a
65
65
- git --version
66
- - git tag
66
+ - ./ci/check_git_tags.sh
67
67
# Because travis runs on Google Cloud and has a /etc/boto.cfg,
68
68
# it breaks moto import, see:
69
69
# 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 1
1
import collections
2
+ from distutils .version import LooseVersion
2
3
from functools import partial
3
4
import string
4
5
@@ -117,3 +118,13 @@ def test_git_version():
117
118
git_version = pd .__git_version__
118
119
assert len (git_version ) == 40
119
120
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