-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathbuild-test
65 lines (50 loc) · 1.32 KB
/
build-test
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
65
#!/bin/bash
set -evu
# Usage:
#
# build-test [mypy|nomypy]
#
# Arguments:
# - mypy: include mypy check ("mypy" or "nomypy")
#
# Environment variables used:
# - GITHUB_WORKSPACE: workspace directory
#
# WARNING: running this locally will delete any local files that
# aren't strictly part of the git tree, including gitignored files!
MODULE=pytket-cuquantum
MYPY=$1
PLAT=`python -c 'import platform; print(platform.system())'`
PYVER=`python -c 'import sys; print(".".join(map(str, sys.version_info[:2])))'`
git clean -dfx
echo "Module to test: ${MODULE}"
MODULEDIR="${GITHUB_WORKSPACE}"
ARTIFACTSDIR=${GITHUB_WORKSPACE}/wheelhouse
rm -rf ${ARTIFACTSDIR} && mkdir ${ARTIFACTSDIR}
python -m pip install --upgrade pip wheel build
# Generate and install the package
python -m build
for w in dist/*.whl ; do
python -m pip install $w
cp $w ${ARTIFACTSDIR}
done
# Test and mypy:
if [[ "${MYPY}" = "mypy" ]]
then
python -m pip install --upgrade mypy
fi
# Currently all tests depend on cuQuantum, so are disabled
#cd ${GITHUB_WORKSPACE}/tests
#
#python -m pip install --pre -r test-requirements.txt
#
## update the pytket version to the lastest (pre) release
#python -m pip install --upgrade --pre pytket~=1.0
#
#pytest --doctest-modules
#
#cd ..
if [[ "${MYPY}" = "mypy" ]]
then
${GITHUB_WORKSPACE}/mypy-check ${GITHUB_WORKSPACE}
fi