Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"]
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12", "3.13"]
os: ["ubuntu-20.04", "macos-latest", "windows-latest"]

steps:
Expand Down
75 changes: 75 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
name: Publish

on:
push:
tags:
- 'v*.*.*'

jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Set up QEMU (for Linux aarch64)
if: runner.os == 'Linux'
uses: docker/setup-qemu-action@v3
with:
platforms: arm64

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.x'

- name: Install cibuildwheel
run: python -m pip install cibuildwheel==3.2.1

- name: Build wheels
run: python -m cibuildwheel --output-dir dist
env:
CIBW_BEFORE_BUILD: python -m pip install -U pip && rm -rf build
Comment thread
benglewis marked this conversation as resolved.
CIBW_ARCHS_LINUX: auto aarch64

- name: Upload wheels
uses: actions/upload-artifact@v4
with:
name: built-wheels-${{ matrix.os }}-${{ strategy.job-index }}
path: ./dist/*.whl

- name: Build source distribution
if: matrix.os == 'ubuntu-latest'
run: python -m pip install build && python -m build --sdist --outdir dist

- name: Upload sdist
if: matrix.os == 'ubuntu-latest'
uses: actions/upload-artifact@v4
with:
name: built-sdist
path: ./dist/*.tar.gz

publish:
needs: build
runs-on: ubuntu-latest
# pypi trusted publishing via OIDC
permissions:
id-token: write
steps:
- name: Download all artifacts
uses: actions/download-artifact@v4
with:
pattern: built-*
path: dist
merge-multiple: true

- name: Publish package
uses: pypa/gh-action-pypi-publish@release/v1
if: startsWith(github.ref, 'refs/tags/v') && github.event_name == 'push'
with:
password: ${{ secrets.PYPI_API_TOKEN }}
4 changes: 2 additions & 2 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Annoy
:align: center

.. image:: https://github.com/spotify/annoy/actions/workflows/ci.yml/badge.svg
:target: https://github.com/spotify/annoy/actions
:target: https://github.com/spotify/annoy/actions

Annoy (`Approximate Nearest Neighbors <http://en.wikipedia.org/wiki/Nearest_neighbor_search#Approximate_nearest_neighbor>`__ Oh Yeah) is a C++ library with Python bindings to search for points in space that are close to a given query point. It also creates large read-only file-based data structures that are `mmapped <https://en.wikipedia.org/wiki/Mmap>`__ into memory so that many processes may share the same data.

Expand Down Expand Up @@ -136,7 +136,7 @@ More info
* Annoy is available as a `conda package <https://anaconda.org/conda-forge/python-annoy>`__ on Linux, OS X, and Windows.
* `ann-benchmarks <https://github.com/erikbern/ann-benchmarks>`__ is a benchmark for several approximate nearest neighbor libraries. Annoy seems to be fairly competitive, especially at higher precisions:

.. figure:: https://github.com/erikbern/ann-benchmarks/raw/master/results/glove-100-angular.png
.. figure:: https://raw.githubusercontent.com/erikbern/ann-benchmarks/main/results/glove-100-angular.png
:alt: ANN benchmarks
:align: center
:target: https://github.com/erikbern/ann-benchmarks
Expand Down
8 changes: 6 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
# the License.

from setuptools import setup, Extension
import codecs
import os
import platform
import sys
Expand All @@ -32,7 +31,7 @@

"""

with codecs.open('README.rst', encoding='utf-8') as fobj:
with open('README.rst', encoding='utf-8') as fobj:
long_description = readme_note + fobj.read()

# Various platform-dependent extras
Expand Down Expand Up @@ -86,6 +85,7 @@
)
],
long_description=long_description,
long_description_content_type='text/x-rst',
author='Erik Bernhardsson',
author_email='mail@erikbern.com',
url='https://github.com/spotify/annoy',
Expand All @@ -102,6 +102,10 @@
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: 3.10',
'Programming Language :: Python :: 3.11',
'Programming Language :: Python :: 3.12',
'Programming Language :: Python :: 3.13',
],
keywords='nns, approximate nearest neighbor search',
setup_requires=['nose>=1.0'],
Expand Down
2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[tox]
envlist=py{26,27,33,34,35,36,37}, go, lua
envlist=py{26,27,33,34,35,36,37,38,39,310,311,312,313}, go, lua

[testenv]
setenv =
Expand Down