forked from chroma-core/hnswlib
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request chroma-core#9 from chroma-core/lukev/wheels
Include binary wheels in release
- Loading branch information
Showing
5 changed files
with
114 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
name: Release | ||
|
||
on: | ||
push: | ||
tags: | ||
- '[0-9]+.[0-9]+.[0-9]*' | ||
|
||
jobs: | ||
|
||
tests: | ||
uses: ./.github/workflows/test.yml | ||
|
||
build: | ||
needs: [tests] | ||
runs-on: ${{matrix.os}} | ||
strategy: | ||
matrix: | ||
os: [ubuntu-latest, windows-latest, macos-latest] | ||
steps: | ||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v2 | ||
if: matrix.os == 'ubuntu-latest' | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-python@v4 | ||
with: | ||
python-version: '3.10' | ||
- name: Install cibuildwheel | ||
run: python -m pip install cibuildwheel==2.15.0 | ||
- name: Build wheels | ||
run: python -m cibuildwheel --output-dir dist | ||
env: | ||
HNSWLIB_NO_NATIVE: true | ||
CIBW_PROJECT_REQUIRES_PYTHON: ">=3.7" | ||
CIBW_SKIP: "cp312-* pp* *musllinux*" | ||
CIBW_ARCHS_MACOS: "x86_64 arm64" | ||
CIBW_ARCHS_WINDOWS: "AMD64" | ||
CIBW_ARCHS_LINUX: "x86_64 aarch64" | ||
- name: Upload artifacts | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: python-package-distributions | ||
path: dist | ||
|
||
upload: | ||
runs-on: ubuntu-latest | ||
needs: build | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-python@v4 | ||
with: | ||
python-version: "3.10" | ||
- name: Build sdist | ||
run: | | ||
python -m pip install . | ||
make dist | ||
- name: Download wheels | ||
uses: actions/download-artifact@v3 | ||
with: | ||
name: python-package-distributions | ||
path: dist/ | ||
- name: Publish to Test PyPI | ||
uses: pypa/gh-action-pypi-publish@release/v1 | ||
with: | ||
password: ${{ secrets.TEST_PYPI_API_TOKEN }} | ||
repository-url: https://test.pypi.org/legacy/ | ||
- name: Publish to PyPI | ||
uses: pypa/gh-action-pypi-publish@release/v1 | ||
with: | ||
password: ${{ secrets.PYPI_API_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,3 +10,5 @@ var/ | |
.vscode/ | ||
.vs/ | ||
**.DS_Store | ||
*.egg-info/ | ||
venv/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,34 @@ | ||
# Chroma-Hnswlib - fast approximate nearest neighbor search | ||
Chromas fork of https://github.com/nmslib/hnswlib | ||
Chromas fork of https://github.com/nmslib/hnswlib | ||
|
||
## Build & Release | ||
|
||
Wheels are automatically built and pushed to PyPI for multiple | ||
platforms via GitHub actions using the | ||
[cibuildwheel](https://github.com/pypa/cibuildwheel). | ||
|
||
The `Publish` Github Action is configured to run whenever a version | ||
tag (a tag string with three period-delimited numbers) is pushed. Is | ||
is necessary to ensure that the version number in `setup.py` has also | ||
been updated, or else the `Publish` action will fail. | ||
|
||
### Building AVX Extensions | ||
|
||
For maximum compatibility, the distributed wheels are not compiled to | ||
make use of Advanced Vector Extensions (AVX). If your hardware | ||
supports AVX, you may get better performance by recompiling this | ||
library on the machine on which it is intended to run. | ||
|
||
To force recompilation when installing, specify the `--no-binary | ||
chroma-hsnwlib` option to PIP when installing dependencies. This can | ||
be added to your `pip install` command, for example: | ||
|
||
``` | ||
pip install -r requirements.txt --no-binary chroma-hnswlib | ||
``` | ||
|
||
You can also put the `--no-binary` directive [in your requirements.txt](https://pip.pypa.io/en/stable/cli/pip_install/#install-no-binary). | ||
|
||
If you've already installed dependencies, you must first uninstall | ||
`chroma-hsnwlib` using `pip uninstall chroma-hnswlib` to remove the | ||
precompiled version before reinstalling. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters