aboutsummaryrefslogtreecommitdiffstats
path: root/ann_benchmark/src/vespa/ann_benchmark/setup.py.in
blob: ee107076410994edbf0e083e3660b8355d72ab26 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.

import subprocess
import sys
import platform
import distutils.sysconfig
from setuptools import setup, Extension
from setuptools.command.build_ext import build_ext

class PreBuiltExt(build_ext):
    def build_extension(self, ext):
        print("Using prebuilt extension library")
        libdir="lib.%s-%s-%s" % (sys.platform, platform.machine(), distutils.sysconfig.get_python_version())
        subprocess.run(["mkdir", "-p", "build/%s" % libdir])
        subprocess.run(["cp", "-p", "@PYTHON_MODULE_PREFIX@vespa_ann_benchmark@PYTHON_MODULE_EXTENSION@", "build/%s" % libdir])

setup(
  name="vespa_ann_benchmark",
  version="0.1.0",
  author="Tor Egge",
  author_email="Tor.Egge@yahooinc.com",
  description="Python binding for the Vespa implementation of an HNSW index for nearest neighbor search",
  long_description="Python binding for the Vespa implementation of an HNSW index for nearest neighbor search used for low-level benchmarking",
  ext_modules=[Extension("vespa_ann_benchmark", sources=[])],
  cmdclass={"build_ext": PreBuiltExt},
  zip_safe=False,
)