diff --git a/.github/workflows/pypi-build.yaml b/.github/workflows/build-python-wheels.yaml similarity index 75% rename from .github/workflows/pypi-build.yaml rename to .github/workflows/build-python-wheels.yaml index c6fe0bf..5835661 100644 --- a/.github/workflows/pypi-build.yaml +++ b/.github/workflows/build-python-wheels.yaml @@ -1,4 +1,4 @@ -name: PyPI Build +name: Build Python Wheels on: workflow_dispatch: @@ -18,8 +18,7 @@ jobs: strategy: fail-fast: false matrix: - #python: ['3.8', '3.9', '3.10', '3.11', '3.12'] - python: ['3.12'] + python: ['3.8', '3.9', '3.10', '3.11', '3.12'] name: "Python ${{ matrix.python }} / NVCC (CUDA 12.6.3) / ubuntu-latest" runs-on: ubuntu-latest @@ -51,32 +50,32 @@ jobs: name: python-package-distributions path: dist/ - # https://packaging.python.org/en/latest/guides/publishing-package-distribution-releases-using-github-actions-ci-cd-workflows/ - publish-to-pypi: - name: Publish GGNN package to PyPI - if: startsWith(github.ref, 'refs/tags/') - needs: - - build - runs-on: ubuntu-latest - environment: - name: pypi - url: https://pypi.org/p/pyGGNN - permissions: - id-token: write - - steps: - - name: Download all the dists - uses: actions/download-artifact@v4 - with: - name: python-package-distributions - path: dist/ - - name: Publish distribution package to PyPI - uses: pypa/gh-action-pypi-publish@release/v1 + # # https://packaging.python.org/en/latest/guides/publishing-package-distribution-releases-using-github-actions-ci-cd-workflows/ + # publish-to-pypi: + # name: Publish GGNN package to PyPI + # if: startsWith(github.ref, 'refs/tags/') + # needs: + # - build + # runs-on: ubuntu-latest + # environment: + # name: pypi + # url: https://pypi.org/p/pyGGNN + # permissions: + # id-token: write + # + # steps: + # - name: Download all the dists + # uses: actions/download-artifact@v4 + # with: + # name: python-package-distributions + # path: dist/ + # - name: Publish distribution package to PyPI + # uses: pypa/gh-action-pypi-publish@release/v1 github-release: name: Sign the Python distribution package with Sigstore and upload them to GitHub Release needs: - - publish-to-pypi + - build runs-on: ubuntu-latest permissions: diff --git a/CMakeLists.txt b/CMakeLists.txt index 506416a..734312c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -200,7 +200,7 @@ if (nanobind_FOUND) message(STATUS "building nanobind module") nanobind_add_module(GGNN NB_STATIC NOMINSIZE "src/ggnn/python/nanobind.cu") target_link_libraries(GGNN PRIVATE GGNNBase GGNNConstruction GGNNQuery glog::glog) - nanobind_add_stub(pyGGNN_stub MODULE GGNN OUTPUT pyGGNN.pyi MARKER_FILE py.typed DEPENDS GGNN) + nanobind_add_stub(GGNN_stub MODULE GGNN OUTPUT GGNN.pyi MARKER_FILE py.typed DEPENDS GGNN) if (PY_BUILD_CMAKE_MODULE_NAME) message(STATUS "configuring python module installation") @@ -217,7 +217,7 @@ if (nanobind_FOUND) COMPONENT python_modules DESTINATION ${PY_BUILD_CMAKE_MODULE_NAME}) endif() - install(FILES ${CMAKE_BINARY_DIR}/py.typed ${CMAKE_BINARY_DIR}/pyGGNN.pyi + install(FILES ${CMAKE_BINARY_DIR}/py.typed ${CMAKE_BINARY_DIR}/GGNN.pyi EXCLUDE_FROM_ALL COMPONENT python_modules DESTINATION ${PY_BUILD_CMAKE_MODULE_NAME}) diff --git a/README.md b/README.md index 156df8f..3c40fd7 100644 --- a/README.md +++ b/README.md @@ -95,7 +95,7 @@ The GGNN python module can be used to perform GPU-accelerated approximate neares ```python #! /usr/bin/python3 -import pyggnn as ggnn +import ggnn import torch # get detailed logs diff --git a/docs/source/install.rst b/docs/source/install.rst index 36044bb..dd8ff70 100644 --- a/docs/source/install.rst +++ b/docs/source/install.rst @@ -39,8 +39,9 @@ The `ggnn` module can then be installed using the package manager pip:: python3 -m pip install . -.. note:: - Automatic installation via ``pip install ggnn`` is under development. +.. caution:: + The PyPI package ``ggnn`` belongs to a different project. + Running ``pip install ggnn`` will not install the GGNN Python module. Installing the GGNN C++ Library diff --git a/docs/source/usage_python.rst b/docs/source/usage_python.rst index 6c25898..f1859d1 100644 --- a/docs/source/usage_python.rst +++ b/docs/source/usage_python.rst @@ -22,7 +22,7 @@ By default, the log level is set to ``0``: #! /usr/bin/python3 - import pyggnn as ggnn + import ggnn #get detailed logs ggnn.set_log_level(4) @@ -174,7 +174,7 @@ Otherwise, this works the same way as above. #! /usr/bin/python3 - import pyggnn as ggnn + import ggnn import torch # create data @@ -224,7 +224,7 @@ and passed to the ``Evaluator`` directly. #! /usr/bin/python3 - import pyggnn as ggnn + import ggnn path_to_dataset = '/path/to/sift/' diff --git a/examples/python/ggnn_pytorch.py b/examples/python/ggnn_pytorch.py index 3c6031e..274f1f4 100644 --- a/examples/python/ggnn_pytorch.py +++ b/examples/python/ggnn_pytorch.py @@ -1,6 +1,6 @@ #! /usr/bin/python3 -import pyggnn as ggnn +import ggnn import torch # get detailed logs diff --git a/examples/python/ggnn_pytorch_gpu_data.py b/examples/python/ggnn_pytorch_gpu_data.py index 0ff9b84..1c76f0f 100644 --- a/examples/python/ggnn_pytorch_gpu_data.py +++ b/examples/python/ggnn_pytorch_gpu_data.py @@ -1,6 +1,6 @@ #! /usr/bin/python3 -import pyggnn as ggnn +import ggnn import torch # get detailed logs diff --git a/examples/python/ggnn_pytorch_multi_gpu.py b/examples/python/ggnn_pytorch_multi_gpu.py index b9589af..dd18389 100644 --- a/examples/python/ggnn_pytorch_multi_gpu.py +++ b/examples/python/ggnn_pytorch_multi_gpu.py @@ -1,6 +1,6 @@ #! /usr/bin/python3 -import pyggnn as ggnn +import ggnn import torch # create data diff --git a/examples/python/sift1m_fvecs.py b/examples/python/sift1m_fvecs.py index aaa6d68..84e6695 100644 --- a/examples/python/sift1m_fvecs.py +++ b/examples/python/sift1m_fvecs.py @@ -1,6 +1,6 @@ #! /usr/bin/python3 -import pyggnn as ggnn +import ggnn path_to_dataset = '/graphics/scratch/datasets/ANN_datasets/SIFT1M/sift/' diff --git a/examples/python/sift1m_hdf5.py b/examples/python/sift1m_hdf5.py index 92e5693..c93c518 100644 --- a/examples/python/sift1m_hdf5.py +++ b/examples/python/sift1m_hdf5.py @@ -1,6 +1,6 @@ #! /usr/bin/python3 -import pyggnn as ggnn +import ggnn import h5py import numpy as np diff --git a/pyproject.toml b/pyproject.toml index 85be2ff..be0af14 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,5 +1,5 @@ [project] # Project metadata -name = "pyGGNN" +name = "GGNN" readme = "README.md" requires-python = ">=3.8" license = { "file" = "LICENSE" } diff --git a/python-src/pyggnn/__init__.py b/python-src/ggnn/__init__.py similarity index 100% rename from python-src/pyggnn/__init__.py rename to python-src/ggnn/__init__.py