Repository navigation
Expand file tree
/
Copy pathtest.sh
More file actions
executable file
·64 lines (48 loc) · 1.38 KB
/
Copy pathtest.sh
File metadata and controls
executable file
·64 lines (48 loc) · 1.38 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
#!/bin/bash
set -e
cd "$(readlink -f $(dirname "${BASH_SOURCE[0]}"))"
export PYTHONDONTWRITEBYTECODE=dont
echo
echo Building source distribution
echo
python3 setup.py sdist
SDIST_TAR_GZ="$(ls -t dist | head -1)"
echo "$SDIST_TAR_GZ"
# Change directory to the mostly-empty `ci/` directory, so Python can't
# cheat and import 'sgp4' directly from the source tree.
cd ci/
echo
echo Testing pure-Python version
echo
PYTHON_SGP4_COMPILE=never uv run \
--isolated \
--no-project \
--reinstall-package sgp4 \
--with ../dist/$SDIST_TAR_GZ,numpy \
-m unittest sgp4.tests
echo
echo Testing compiled extension
echo
# Okay, this is crazy, and just burned about an hour of my time: despite
# the pile of options I'm using here, plus "PYTHON_SGP4_COMPILE" being
# listed in "pyproject.toml" as a cache key, the ONLY way I've managed
# to get "uv" to rebuild "sgp4" for this second run is to touch the
# tar.gz file to update its mtime. Gads.
touch ../dist/$SDIST_TAR_GZ
PYTHON_SGP4_COMPILE=always uv run \
--isolated \
--no-project \
--reinstall-package sgp4 \
--with ../dist/$SDIST_TAR_GZ,numpy \
-m unittest sgp4.tests
echo
echo Running doctests
echo
PYTHON_SGP4_COMPILE=always uv run \
--isolated \
--no-project \
--with ../dist/$SDIST_TAR_GZ,numpy \
-m doctest -o ELLIPSIS ../README.rst
# Since "doctest" itself is silent upon success:
echo Doctests successful!
echo