10 if [[ "$VIRTUAL_ENV" == "" ]]; then
15 cargo_version
="$(cargo --version)" || fail
"can't find cargo, install it from https://rustup.rs/"
16 [[ "$cargo_version" =~ ^
'cargo 1.'([0-9]+)'.'[0-9]+' ' ]] || fail
"can't parse cargo's version string"
17 (( "${BASH_REMATCH[1]}" >= 53 )) || fail
'your rust version is not recent enough, update your rust version using `rustup update`'
18 python3
-m pip
install "${user[@]}" 'maturin>=0.11,<0.12'
19 if [[ "$VIRTUAL_ENV" == "" ]]; then
20 scripts
="$(python3 -m sysconfig | sed 's@^\tuserbase = "\
([^
"]\+\)"$@\
1/bin@p
; d
')"
22 scripts="$(python3 -m sysconfig | sed 's
/^
\tscripts
= "\([^"]\
+\
)"$/\1/p; d')"
25 [[ -d "$scripts" ]] || fail
"can't find python's \`scripts\` directory"
26 rm -f target
/wheels
/power_instruction_analyzer-
*.whl
27 "$scripts"/maturin build
--compatibility linux
--cargo-extra-args=--features=python-extension
-i python3
--release --no-sdist
28 python3
-m pip
install --force "${user[@]}" target
/wheels
/power_instruction_analyzer-
*.whl