Skip to content

Commit

Permalink
PyPI will not accept CUDA packages (unsupported platform tag 'linux_x…
Browse files Browse the repository at this point in the history
…86_64').

==> Renamed Python module back to "ggnn" and require manual installation.
Add GitHub action for compiling wheels.
  • Loading branch information
LukasRuppert committed Jan 22, 2025
1 parent 0bd7f23 commit 72c1789
Show file tree
Hide file tree
Showing 12 changed files with 39 additions and 39 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: PyPI Build
name: Build Python Wheels

on:
workflow_dispatch:
Expand All @@ -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
Expand Down Expand Up @@ -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:
Expand Down
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand All @@ -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})
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 3 additions & 2 deletions docs/source/install.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions docs/source/usage_python.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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/'
Expand Down
2 changes: 1 addition & 1 deletion examples/python/ggnn_pytorch.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#! /usr/bin/python3

import pyggnn as ggnn
import ggnn
import torch

# get detailed logs
Expand Down
2 changes: 1 addition & 1 deletion examples/python/ggnn_pytorch_gpu_data.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#! /usr/bin/python3

import pyggnn as ggnn
import ggnn
import torch

# get detailed logs
Expand Down
2 changes: 1 addition & 1 deletion examples/python/ggnn_pytorch_multi_gpu.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#! /usr/bin/python3

import pyggnn as ggnn
import ggnn
import torch

# create data
Expand Down
2 changes: 1 addition & 1 deletion examples/python/sift1m_fvecs.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#! /usr/bin/python3

import pyggnn as ggnn
import ggnn

path_to_dataset = '/graphics/scratch/datasets/ANN_datasets/SIFT1M/sift/'

Expand Down
2 changes: 1 addition & 1 deletion examples/python/sift1m_hdf5.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#! /usr/bin/python3

import pyggnn as ggnn
import ggnn

import h5py
import numpy as np
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[project] # Project metadata
name = "pyGGNN"
name = "GGNN"
readme = "README.md"
requires-python = ">=3.8"
license = { "file" = "LICENSE" }
Expand Down
File renamed without changes.

0 comments on commit 72c1789

Please sign in to comment.