diff --git a/.github/workflows/release-chromadb.yml b/.github/workflows/release-chromadb.yml index 1dfe912768d..c2000a64a30 100644 --- a/.github/workflows/release-chromadb.yml +++ b/.github/workflows/release-chromadb.yml @@ -126,7 +126,7 @@ jobs: - name: Build Client run: python -m build - name: Test Client Package - run: bin/test-package.sh dist/*.tar.gz + run: bin/test-package/test-package.sh dist/*.tar.gz - name: Upload as artifact uses: actions/upload-artifact@v4 with: @@ -164,7 +164,7 @@ jobs: - name: Build Client run: ./clients/python/build_python_thin_client.sh - name: Test Client Package - run: bin/test-package.sh dist/*.tar.gz + run: bin/test-package/test-thin-client-package.sh dist/*.tar.gz - name: Install setuptools_scm run: python -m pip install setuptools_scm - name: Publish to Test PyPI diff --git a/bin/test-package.sh b/bin/test-package.sh deleted file mode 100755 index e1be700b43a..00000000000 --- a/bin/test-package.sh +++ /dev/null @@ -1,24 +0,0 @@ -#!/bin/bash - -# Verify PIP tarball -tarball=$(readlink -f $1) -if [ -f "$tarball" ]; then - echo "Testing PIP package from tarball: $tarball" -else - echo "Could not find PIP package: $tarball" -fi - -# Create temporary project dir -dir=$(mktemp -d) - -echo "Building python project dir at $dir ..." - -cd $dir - -python3 -m venv venv - -source venv/bin/activate - -pip install $tarball - -python -c "import chromadb; api = chromadb.Client(); print(api.heartbeat())" diff --git a/bin/test-package/install.sh b/bin/test-package/install.sh new file mode 100755 index 00000000000..3b725cf94f0 --- /dev/null +++ b/bin/test-package/install.sh @@ -0,0 +1,24 @@ +#!/bin/bash + +pip_install_from_tarball() { + local tarball=$(readlink -f $1) + if [ -f "$tarball" ]; then + echo "Testing PIP package from tarball: $tarball" + else + echo "Could not find PIP package: $tarball" + return 1 + fi + + # Create temporary project dir + local dir=$(mktemp -d) + + echo "Building python project dir at $dir ..." + + cd $dir + + python3 -m venv venv + + source venv/bin/activate + + pip install $tarball +} diff --git a/bin/test-package/test-package.sh b/bin/test-package/test-package.sh new file mode 100755 index 00000000000..03e9a8a6c74 --- /dev/null +++ b/bin/test-package/test-package.sh @@ -0,0 +1,8 @@ +#!/bin/bash +# Sanity check to ensure package is installed correctly + +source ./install.sh + +pip_install_from_tarball $1 + +python -c "import chromadb; api = chromadb.Client(); print(api.heartbeat())" diff --git a/bin/test-package/test-thin-client-package.sh b/bin/test-package/test-thin-client-package.sh new file mode 100755 index 00000000000..1d5214760ed --- /dev/null +++ b/bin/test-package/test-thin-client-package.sh @@ -0,0 +1,8 @@ +#!/bin/bash +# Sanity check to ensure package is installed correctly + +source ./install.sh + +pip_install_from_tarball $1 + +python -c "import chromadb; print(chromadb.__version__)"