Skip to content

Commit f7da371

Browse files
Test script: die on Python deprecation warnings
A recent issue alerted me to the fact that the test suite was not detecting Python deprecation warnings. Turning them on, alas, revealed that `astropy` and `pandas` were both triggering warnings on their own, killing the tests. Here we upgrade them to safe versions, then turn on deprecation warnings, hopefully permanently. (Also: so that the test script works in a minimal container, have it skip running git if git is not installed.)
1 parent fa615df commit f7da371

File tree

2 files changed

+15
-11
lines changed

2 files changed

+15
-11
lines changed

requirements.txt

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
astropy==4.3.1
1+
astropy==5.1
22
beautifulsoup4==4.6.0
33
html5lib==1.0.1
44
jinja2==3.0.3
55
lxml==4.9.1
66
mock==2.0.0
7-
numpy==1.17.5
7+
numpy==1.18.5
88
matplotlib==3.3.0
9-
pandas==1.0.0
9+
pandas==1.3.5
1010
pyflakes==2.1.1
1111
pygments==2.17.2
1212
python-dateutil>=2.5.0

test-code.sh

+12-8
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
#!/bin/bash
22

3-
export PYTHONWARNINGS=d
3+
export PYTHONWARNINGS=error
44

55
cd "$(readlink -f $(dirname "${BASH_SOURCE[0]}"))"/ci
66
echo 'Changing to CI directory: cd' $(pwd)
7+
echo 'Python version:' $(python --version)
78

89
set -e
910
if ! command -v assay >/dev/null
@@ -17,14 +18,17 @@ to install all of the tools and libraries for Skyfield development.
1718
EOF
1819
exit 2
1920
fi
20-
r=$(git rev-parse --show-toplevel)
21-
if grep ' $' \
22-
$(git ls-files $r/design $r/examples $r/skyfield | grep '\.py$') \
23-
/dev/null # prevent hanging on a grep of stdin if ls-files fails
21+
if command -v git >/dev/null
2422
then
25-
echo
26-
echo 'Error: trailing whitespace detected on the above-listed lines'
27-
exit 1
23+
r=$(git rev-parse --show-toplevel)
24+
if grep ' $' \
25+
$(git ls-files $r/design $r/examples $r/skyfield | grep '\.py$') \
26+
/dev/null # prevent hanging on a grep of stdin if ls-files fails
27+
then
28+
echo
29+
echo 'Error: trailing whitespace detected on the above-listed lines'
30+
exit 1
31+
fi
2832
fi
2933
if python --version | grep -q 'Python 3' && command -v pyflakes >/dev/null
3034
then

0 commit comments

Comments
 (0)