Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
56ffae7
feat(shm): add python bindings
dsalwasser Jan 27, 2025
88c0c9d
Merge branch 'main' into shm/feat/bindings
dsalwasser Feb 3, 2025
cc9bafa
build: update gitignore
dsalwasser Feb 3, 2025
cae3a25
feat: add networkit bindings
dsalwasser Feb 3, 2025
e52814a
feat: update python bindings
dsalwasser Feb 3, 2025
37aec66
ci: add python bindings build
dsalwasser Feb 3, 2025
c08ea3f
ci: pin dependencies and add top-level permission
dsalwasser Feb 3, 2025
e3533b3
fix(build): make Python extension position-independent
dsalwasser Feb 4, 2025
160496b
refactor(shm): move c bindings back to kaminpar-shm
dsalwasser Feb 9, 2025
cd36dbc
Merge branch 'main' into shm/feat/bindings
dsalwasser Feb 9, 2025
b3c9f5c
fix(shm): update includes
dsalwasser Feb 9, 2025
e1a465c
feat(shm): update bindings
dsalwasser Mar 2, 2025
fe517d0
ci: pass correct environment flags
dsalwasser Mar 2, 2025
9a73e50
ci: remove unsupported python versions
dsalwasser Mar 2, 2025
f5b1eb0
ci: enable support for free-threaded build
dsalwasser Mar 2, 2025
b96a640
build: add python packages to nix flake
dsalwasser Mar 10, 2025
bc18715
feat(shm): update bindings
dsalwasser Mar 14, 2025
bf7c88c
Merge branch 'main' into shm/feat/bindings
dsalwasser Mar 14, 2025
4149057
build: fix networkit bindings installation
dsalwasser Mar 14, 2025
a03d2f0
ci: fix networkit source distribution build
dsalwasser Mar 17, 2025
2f45aa9
Merge branch 'main' into shm/feat/bindings
dsalwasser Mar 19, 2025
71421d0
fix(shm): disable -mtune=native flag for bindings
dsalwasser Mar 20, 2025
612d258
fix(shm): update KaMinPar source for bindings
dsalwasser Mar 20, 2025
2ce7be6
fix(shm): revert KaMinPar source for bindings
dsalwasser Mar 20, 2025
61d0aa6
ci: update wheel builder
dsalwasser Mar 20, 2025
64eb9cf
ci: add test publisher job
dsalwasser Mar 20, 2025
753d5e2
feat(shm): update bindings documentation
dsalwasser Mar 21, 2025
3e85f98
build: update nix flake
dsalwasser Mar 21, 2025
b557a8e
build: update kaminpar version
dsalwasser Mar 21, 2025
4ac7b84
ci: update wheel jobs
dsalwasser Mar 21, 2025
50368b6
ci: fix wheel jobs
dsalwasser Mar 21, 2025
420efc0
fix(shm): update version for python bindings test
dsalwasser Mar 21, 2025
b12667a
ci: add linux arm wheel job
dsalwasser Mar 21, 2025
6111864
ci: fix build
dsalwasser Mar 21, 2025
eaf8ca5
ci: fix typo
dsalwasser Mar 21, 2025
bc3b01d
ci: use different ubuntu runner
dsalwasser Mar 21, 2025
e67b96a
ci: add macos runner
dsalwasser Mar 21, 2025
505be65
feat(shm): update readme of bindings
dsalwasser Mar 22, 2025
13a60ef
ci: update wheel jobs
dsalwasser Mar 22, 2025
24110a4
ci: fix scorecard warning
dsalwasser Mar 22, 2025
c6c837c
Merge branch 'main' into shm/feat/bindings
DanielSeemaier Mar 24, 2025
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
125 changes: 125 additions & 0 deletions .github/workflows/networkit_wheels.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,125 @@
name: Wheel builder for NetworKit bindings

on:
push:
branches: ["main"]
pull_request:
branches: ["main"]

permissions:
contents: read

jobs:
build-networkit-wheels:
name: Build KaMinPar NetworKit wheel for ${{ matrix.python }}

strategy:
matrix:
python: ["cp310", "cp311", "cp312", "cp313"]
fail-fast: false

runs-on: ubuntu-24.04
steps:
- name: Checkout KaMinPar
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2

- name: Build wheels
uses: pypa/cibuildwheel@6cccd09a31908ffd175b012fb8bf4e1dbda3bc6c # v2.23.0
env:
CIBW_BUILD: ${{ matrix.python }}-manylinux_x86_64
with:
package-dir: bindings/networkit
output-dir: bindings/networkit/dist

- name: Store wheels
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: kaminpar-networkit-wheel-${{ matrix.python }}
path: bindings/networkit/dist/
if-no-files-found: error

build-networkit-sdist:
name: Build KaMinPar NetworKit source distribution
runs-on: ubuntu-24.04
steps:
- name: Checkout KaMinPar
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2

- name: Set up Python
uses: actions/setup-python@42375524e23c412d93fb67b49958b491fce71c38 # v5.4.0
with:
python-version: "3.13"

- name: Build source distribution
run: |
# Create a requirements file with pinned versions and hashes for security
echo "build==1.2.2.post1 --hash=sha256:1d61c0887fa860c01971625baae8bdd338e517b836a2f70dd1f7aa3a6b2fc5b5" > build-requirements.txt
echo "packaging==24.2 --hash=sha256:09abb1bccd265c01f4a3aa3f7a7db064b36514d2cba19a2f694fe6150451a759" >> build-requirements.txt
echo "pyproject_hooks==1.2.0 --hash=sha256:9e5c6bfa8dcc30091c74b0cf803c81fdd29d94f01992a7707bc97babb1141913" >> build-requirements.txt
# Install the required build dependencies using the requirements file and build the sdist
python -m pip install --require-hashes -r build-requirements.txt
python -m build --sdist bindings/networkit/

- name: Store sdist
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: kaminpar-networkit-sdist
path: bindings/networkit/dist/
if-no-files-found: error

publish-networkit-to-pypi:
name: Publish KaMinPar NetworKit distribution to PyPI
if: github.repository_owner == 'KaHIP' && startsWith(github.ref, 'refs/tags/')
needs:
- build-networkit-wheels
- build-networkit-sdist

environment:
name: pypi
url: https://pypi.org/p/kaminpar-networkit
permissions:
id-token: write

runs-on: ubuntu-24.04
steps:
- name: Download all the dists
uses: actions/download-artifact@95815c38cf2ff2164869cbab79da8d1f422bc89e # v4.2.1
with:
pattern: kaminpar-networkit-*
merge-multiple: true
path: dist/

- name: Publish distribution to PyPI
uses: pypa/gh-action-pypi-publish@76f52bc884231f62b9a034ebfe128415bbaabdfc # v1.12.4
with:
print-hash: true
verbose: true

publish-networkit-to-testpypi:
name: Publish KaMinPar NetworKit distribution to TestPyPI
if: github.repository_owner == 'KaHIP' && startsWith(github.ref, 'refs/tags/')
needs:
- build-networkit-wheels
- build-networkit-sdist

environment:
name: testpypi
url: https://test.pypi.org/p/kaminpar-networkit
permissions:
id-token: write

runs-on: ubuntu-24.04
steps:
- name: Download all the dists
uses: actions/download-artifact@95815c38cf2ff2164869cbab79da8d1f422bc89e # v4.2.1
with:
pattern: kaminpar-networkit-*
merge-multiple: true
path: dist/

- name: Publish distribution to TestPyPI
uses: pypa/gh-action-pypi-publish@76f52bc884231f62b9a034ebfe128415bbaabdfc # v1.12.4
with:
repository-url: https://test.pypi.org/legacy/
print-hash: true
verbose: true
131 changes: 131 additions & 0 deletions .github/workflows/python_wheels.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,131 @@
name: Wheel builder for Python bindings

on:
push:
branches: ["main"]
pull_request:
branches: ["main"]

permissions:
contents: read

jobs:
build-python-wheels:
name: Build KaMinPar Python wheel for ${{ matrix.python }}-${{ matrix.platform[1] }}

strategy:
matrix:
python: ["cp39", "cp310", "cp311", "cp312", "cp313", "cp313t", "pp39", "pp310", "pp311"]
platform:
- [ubuntu-24.04, manylinux_x86_64]
- [ubuntu-24.04-arm, manylinux_aarch64]
- [macos-15, macosx_arm64]
fail-fast: false

runs-on: ${{ matrix.platform[0] }}
steps:
- name: Checkout KaMinPar
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2

- name: Build wheels
uses: pypa/cibuildwheel@6cccd09a31908ffd175b012fb8bf4e1dbda3bc6c # v2.23.0
env:
CIBW_BUILD: ${{ matrix.python }}-${{ matrix.platform[1] }}
CIBW_ENVIRONMENT: SKBUILD_CMAKE_DEFINE="KAMINPAR_PYTHON_INSTALL_TBB=On"
CIBW_FREE_THREADED_SUPPORT: True
with:
package-dir: bindings/python
output-dir: bindings/python/dist

- name: Store wheels
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: kaminpar-python-wheel-${{ matrix.python }}-${{ matrix.platform[1] }}
path: bindings/python/dist/
if-no-files-found: error

build-python-sdist:
name: Build KaMinPar Python source distribution
runs-on: ubuntu-24.04
steps:
- name: Checkout KaMinPar
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2

- name: Set up Python
uses: actions/setup-python@42375524e23c412d93fb67b49958b491fce71c38 # v5.4.0
with:
python-version: "3.13"

- name: Build source distribution
run: |
# Create a requirements file with pinned versions and hashes for security
echo "build==1.2.2.post1 --hash=sha256:1d61c0887fa860c01971625baae8bdd338e517b836a2f70dd1f7aa3a6b2fc5b5" > build-requirements.txt
echo "packaging==24.2 --hash=sha256:09abb1bccd265c01f4a3aa3f7a7db064b36514d2cba19a2f694fe6150451a759" >> build-requirements.txt
echo "pyproject_hooks==1.2.0 --hash=sha256:9e5c6bfa8dcc30091c74b0cf803c81fdd29d94f01992a7707bc97babb1141913" >> build-requirements.txt
# Install the required build dependencies using the requirements file and build the sdist
python -m pip install --require-hashes -r build-requirements.txt
python -m build --sdist bindings/python/

- name: Store sdist
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: kaminpar-python-sdist
path: bindings/python/dist/
if-no-files-found: error

publish-python-to-pypi:
name: Publish KaMinPar Python distribution to PyPI
if: github.repository_owner == 'KaHIP' && startsWith(github.ref, 'refs/tags/')
needs:
- build-python-wheels
- build-python-sdist

environment:
name: pypi
url: https://pypi.org/p/kaminpar
permissions:
id-token: write

runs-on: ubuntu-24.04
steps:
- name: Download all the dists
uses: actions/download-artifact@95815c38cf2ff2164869cbab79da8d1f422bc89e # v4.2.1
with:
pattern: kaminpar-python-*
merge-multiple: true
path: dist/

- name: Publish distribution to PyPI
uses: pypa/gh-action-pypi-publish@76f52bc884231f62b9a034ebfe128415bbaabdfc # v1.12.4
with:
print-hash: true
verbose: true

publish-python-to-testpypi:
name: Publish KaMinPar Python distribution to TestPyPI
if: github.repository_owner == 'KaHIP' && startsWith(github.ref, 'refs/tags/')
needs:
- build-python-wheels
- build-python-sdist

environment:
name: testpypi
url: https://test.pypi.org/p/kaminpar
permissions:
id-token: write

runs-on: ubuntu-24.04
steps:
- name: Download all the dists
uses: actions/download-artifact@95815c38cf2ff2164869cbab79da8d1f422bc89e # v4.2.1
with:
pattern: kaminpar-python-*
merge-multiple: true
path: dist/

- name: Publish distribution to TestPyPI
uses: pypa/gh-action-pypi-publish@76f52bc884231f62b9a034ebfe128415bbaabdfc # v1.12.4
with:
repository-url: https://test.pypi.org/legacy/
print-hash: true
verbose: true
Loading
Loading