Skip to content

Commit

Permalink
Fix for SSL ceritficate verification failure on Travis CI
Browse files Browse the repository at this point in the history
Report exception when failed downloading files during install
  • Loading branch information
danielhers committed Jun 2, 2020
1 parent 75cb987 commit 4c69e1f
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
6 changes: 3 additions & 3 deletions ci/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ if ! [[ "$ACTION" =~ ^(toy|unit)$ ]]; then
case "$FORMAT" in
ucca)
mkdir pickle
curl -L https://github.com/UniversalConceptualCognitiveAnnotation/UCCA_English-Wiki/releases/download/v1.2.4/ucca-sample.tar.gz | tar xz -C pickle
curl -L --insecure https://github.com/UniversalConceptualCognitiveAnnotation/UCCA_English-Wiki/releases/download/v1.2.4/ucca-sample.tar.gz | tar xz -C pickle
TRAIN_DATA="pickle/train/*"
DEV_DATA="pickle/dev/*"
;;
amr)
curl --remote-name-all https://amr.isi.edu/download/2016-03-14/alignment-release-{training,dev,test}-bio.txt
curl --insecure --remote-name-all https://amr.isi.edu/download/2016-03-14/alignment-release-{training,dev,test}-bio.txt
rename 's/.txt/.amr/' alignment-release-*-bio.txt
python -m semstr.scripts.split -q alignment-release-training-bio.amr -o alignment-release-training-bio
CONVERT_DATA=alignment-release-dev-bio.amr
Expand All @@ -27,7 +27,7 @@ if ! [[ "$ACTION" =~ ^(toy|unit)$ ]]; then
;;
sdp)
mkdir data
curl -L http://svn.delph-in.net/sdp/public/2015/trial/current.tgz | tar xz -C data
curl -L --insecure http://svn.delph-in.net/sdp/public/2015/trial/current.tgz | tar xz -C data
python -m semstr.scripts.split -q data/sdp/trial/dm.sdp -o data/sdp/trial/dm
python -m scripts.split_corpus -q data/sdp/trial/dm -t 120 -d 36 -l
CONVERT_DATA=data/sdp/trial/*.sdp
Expand Down
12 changes: 8 additions & 4 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,14 @@ def run(self):
out_file = os.path.join("semstr", "util", "resources", filename)
if not os.path.exists(out_file):
self.announce("Getting '%s'..." % filename)
try:
urllib.request.urlretrieve("https://amr.isi.edu/download/lists/" + filename, out_file)
except:
self.warn("Failed downloading https://amr.isi.edu/download/lists/" + filename + " to " + out_file)
for attempt in 1, 2:
try:
urllib.request.urlretrieve("https://amr.isi.edu/download/lists/" + filename, out_file)
except Exception as e:
self.warn("Failed downloading https://amr.isi.edu/download/lists/" + filename + " to " + out_file + ": " + str(e))
import ssl
if getattr(ssl, '_create_unverified_context', None)):
ssl._create_default_https_context = ssl._create_unverified_context

# Install actual package
_install.run(self)
Expand Down

0 comments on commit 4c69e1f

Please sign in to comment.