Skip to content
This repository has been archived by the owner on Oct 11, 2024. It is now read-only.

Commit

Permalink
version check patch (#251)
Browse files Browse the repository at this point in the history
SUMMARY:
* make `magic-wand` version check robust

TEST PLAN:
runs on remote push. will be manually triggering NIGHTLY and RELEASE
relative to this branch.

```bash
andy@waldorf:~$ cat test.sh 
#!/bin/bash

set -euo pipefail

MAGIC_WAND=$(pip3 show nm-magic-wand-nightly | grep "Version" | cut -d' ' -f2) || echo "nightly not installed" 
if [ -z "$MAGIC_WAND" ]; then
    MAGIC_WAND=$(pip3 show nm-magic-wand | grep "Version" | cut -d' ' -f2)
fi

echo ${MAGIC_WAND}

andy@waldorf:~$ ./test.sh 
WARNING: Package(s) not found: nm-magic-wand-nightly
nightly not installed
0.2.2
andy@waldorf:~$ echo $?
0
```

when "nightly" is installed ... 

```bash
andy@waldorf:~$ ./test.sh 
0.2.2.20240520
```

---------

Co-authored-by: andy-neuma <andy@neuralmagic.com>
  • Loading branch information
andy-neuma and andy-neuma authored May 20, 2024
1 parent d69a34a commit 290c53f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion .github/actions/nm-install-test-whl/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,9 @@ runs:
echo "whl=${WHL_BASENAME}" >> "$GITHUB_OUTPUT"
pip3 install ${WHL}[sparse]
# report magic_wand version
MAGIC_WAND=$(pip3 show nm-magic-wand-nightly | grep "Version" | cut -d' ' -f2)
MAGIC_WAND=$(pip3 show nm-magic-wand-nightly | grep "Version" | cut -d' ' -f2) || echo "nightly not installed"
if [ -z "${MAGIC_WAND}" ]; then
# if neither magic-wand nor magic-wand-nightly is installed stop here with error
MAGIC_WAND=$(pip3 show nm-magic-wand | grep "Version" | cut -d' ' -f2)
fi
echo "magic_wand=${MAGIC_WAND}" >> "$GITHUB_OUTPUT"
Expand Down

0 comments on commit 290c53f

Please sign in to comment.