Skip to content

Commit 7f944a0

Browse files
Repair Travis CI: shouldn't have changed directory
1 parent d0779f9 commit 7f944a0

3 files changed

Lines changed: 14 additions & 4 deletions

File tree

skyfield/documentation/files.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ we will see that it looked for files in the current directory:
107107

108108
Already exists: ./deltat.data
109109
Parsing with: parse_deltat_data()
110-
Does not expire til: 2020-06-01
110+
Does not expire til: 2020-09-01
111111
Already exists: ./deltat.preds
112112
Parsing with: parse_deltat_preds()
113113
Does not expire til: 2021-01-01

test-code.sh

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
#!/bin/bash
2-
3-
cd "$(dirname "${BASH_SOURCE[0]}")"
2+
#
3+
# This script should not change directory, because CI strategically runs
4+
# it from somewhere besides the repository root to prevent Skyfield from
5+
# being imported directly from its source tree.
46

57
set -e
68
if ! command -v assay >/dev/null
@@ -15,6 +17,8 @@ EOF
1517
exit 2
1618
fi
1719
if python --version | grep -q 'Python 2.7'
18-
then pyflakes skyfield/*.py
20+
then
21+
d=$(python -c 'import skyfield as s; print(s.__file__.rsplit("/", 1)[0])')
22+
pyflakes "$d"/skyfield/*.py
1923
fi
2024
exec assay --batch skyfield/tests

test-docs.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
set -e
44
cd "$(dirname ${BASH_SOURCE[0]})"
5+
6+
# Copy in files that would otherwise need to download.
57
cp ci/* skyfield/documentation
68

79
function cleanup {
@@ -11,3 +13,7 @@ function cleanup {
1113
trap cleanup EXIT
1214

1315
make -C skyfield/documentation doctest
16+
17+
# Remove the files we copied in.
18+
FILES="$(cd ci; ls *.*)"
19+
(cd skyfield/documentation; rm $FILES)

0 commit comments

Comments
 (0)