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
55 changes: 55 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: CI

on:
push:
branches: [main]
pull_request:

jobs:
build:
runs-on: windows-latest
steps:
- uses: actions/checkout@v4

- uses: actions/setup-python@v5
with:
python-version: "3.12"

- name: Setup MSVC
uses: ilammy/msvc-dev-cmd@v1

- name: Cache CUDA Toolkit
id: cache-cuda
uses: actions/cache@v4
with:
path: C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.6
key: cuda-12.6.0-nvcc-cudart

- name: Install CUDA Toolkit
if: steps.cache-cuda.outputs.cache-hit != 'true'
shell: powershell
run: |
$url = "https://developer.download.nvidia.com/compute/cuda/12.6.0/network_installers/cuda_12.6.0_windows_network.exe"
Invoke-WebRequest -Uri $url -OutFile cuda_installer.exe
Start-Process -FilePath .\cuda_installer.exe -ArgumentList '-s','nvcc_12.6','cudart_12.6' -Wait -NoNewWindow

- name: Set CUDA environment
shell: powershell
run: |
echo "CUDA_PATH=C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.6" >> $env:GITHUB_ENV
echo "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.6\bin" >> $env:GITHUB_PATH

- name: Install Vulkan SDK
uses: jakoch/install-vulkan-sdk-action@v1.0.5
with:
vulkan_version: 1.3.290.0
install_runtime: false
cache: true

- name: Build and install
run: pip install . -v
env:
CMAKE_GENERATOR: Ninja

- name: Verify import
run: python -c "import touchpy; print(f'touchpy {touchpy.__version__} OK')"
67 changes: 67 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
name: Documentation

on:
release:
types: [published]
workflow_dispatch:

jobs:
build-and-deploy:
runs-on: windows-latest
steps:
- uses: actions/checkout@v4

- uses: actions/setup-python@v5
with:
python-version: "3.12"

- name: Setup MSVC
uses: ilammy/msvc-dev-cmd@v1

- name: Cache CUDA Toolkit
id: cache-cuda
uses: actions/cache@v4
with:
path: C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.6
key: cuda-12.6.0-nvcc-cudart

- name: Install CUDA Toolkit
if: steps.cache-cuda.outputs.cache-hit != 'true'
shell: powershell
run: |
$url = "https://developer.download.nvidia.com/compute/cuda/12.6.0/network_installers/cuda_12.6.0_windows_network.exe"
Invoke-WebRequest -Uri $url -OutFile cuda_installer.exe
Start-Process -FilePath .\cuda_installer.exe -ArgumentList '-s','nvcc_12.6','cudart_12.6' -Wait -NoNewWindow

- name: Set CUDA environment
shell: powershell
run: |
echo "CUDA_PATH=C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.6" >> $env:GITHUB_ENV
echo "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.6\bin" >> $env:GITHUB_PATH

- name: Install Vulkan SDK
uses: jakoch/install-vulkan-sdk-action@v1.0.5
with:
vulkan_version: 1.3.290.0
install_runtime: false
cache: true

- name: Build and install touchpy
run: pip install . -v
env:
CMAKE_GENERATOR: Ninja

- name: Install docs dependencies
run: pip install -r docs/requirements.txt

- name: Build documentation
run: sphinx-build -M html docs/source docs/build

- name: Deploy to docs branch
uses: peaceiris/actions-gh-pages@v4
if: github.event_name == 'release' || github.event_name == 'workflow_dispatch'
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: docs/build/html
publish_branch: docs
force_orphan: false
115 changes: 115 additions & 0 deletions .github/workflows/wheels.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
name: Build Wheels

on:
workflow_dispatch:
release:
types: [published]

jobs:
build_wheels:
name: Build wheels (Python ${{ matrix.python }})
runs-on: windows-latest
strategy:
fail-fast: false
matrix:
python: ["cp39", "cp310", "cp311", "cp312", "cp313"]
steps:
- uses: actions/checkout@v4

- name: Setup MSVC
uses: ilammy/msvc-dev-cmd@v1

- name: Cache CUDA Toolkit
id: cache-cuda
uses: actions/cache@v4
with:
path: C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.6
key: cuda-12.6.0-nvcc-cudart

- name: Install CUDA Toolkit
if: steps.cache-cuda.outputs.cache-hit != 'true'
shell: powershell
run: |
$url = "https://developer.download.nvidia.com/compute/cuda/12.6.0/network_installers/cuda_12.6.0_windows_network.exe"
Invoke-WebRequest -Uri $url -OutFile cuda_installer.exe
Start-Process -FilePath .\cuda_installer.exe -ArgumentList '-s','nvcc_12.6','cudart_12.6' -Wait -NoNewWindow

- name: Set CUDA environment
shell: powershell
run: |
echo "CUDA_PATH=C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.6" >> $env:GITHUB_ENV
echo "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.6\bin" >> $env:GITHUB_PATH

- name: Install Vulkan SDK
uses: jakoch/install-vulkan-sdk-action@v1.0.5
with:
vulkan_version: 1.3.290.0
install_runtime: false
cache: true

- name: Build wheel
uses: pypa/cibuildwheel@v2.22
env:
CIBW_BUILD: "${{ matrix.python }}-win_amd64"
CIBW_ARCHS_WINDOWS: "AMD64"
CMAKE_GENERATOR: Ninja

- uses: actions/upload-artifact@v4
with:
name: wheel-${{ matrix.python }}
path: ./wheelhouse/*.whl

build_sdist:
name: Build source distribution
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Build sdist
run: pipx run build --sdist

- uses: actions/upload-artifact@v4
with:
name: sdist
path: dist/*.tar.gz

publish:
name: Publish to PyPI
needs: [build_wheels, build_sdist]
runs-on: ubuntu-latest
if: github.event_name == 'release'
permissions:
id-token: write
steps:
- uses: actions/download-artifact@v4
with:
pattern: wheel-*
path: dist/
merge-multiple: true

- uses: actions/download-artifact@v4
with:
name: sdist
path: dist/

- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1

upload_release_assets:
name: Upload release assets
needs: [build_wheels]
runs-on: ubuntu-latest
if: github.event_name == 'release'
permissions:
contents: write
steps:
- uses: actions/download-artifact@v4
with:
pattern: wheel-*
path: dist/
merge-multiple: true

- name: Upload wheels to release
uses: softprops/action-gh-release@v2
with:
files: dist/*.whl
16 changes: 16 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,21 @@ FetchContent_Declare(
)
FetchContent_MakeAvailable(spdlog)

FetchContent_Declare(
VulkanMemoryAllocator
GIT_REPOSITORY https://github.com/GPUOpen-LibrariesAndSDKs/VulkanMemoryAllocator.git
GIT_TAG v3.1.0
CONFIGURE_COMMAND ""
BUILD_COMMAND ""
)
FetchContent_MakeAvailable(VulkanMemoryAllocator)

# Source includes VMA as "vma/vk_mem_alloc.h" (matching Vulkan SDK layout)
# but the VMA repo puts it at include/vk_mem_alloc.h — create the expected structure
file(MAKE_DIRECTORY "${CMAKE_BINARY_DIR}/_vma_include/vma")
file(COPY "${vulkanmemoryallocator_SOURCE_DIR}/include/vk_mem_alloc.h"
DESTINATION "${CMAKE_BINARY_DIR}/_vma_include/vma")

# touchpy
#################################################################################################
find_package(Python 3.9
Expand Down Expand Up @@ -105,6 +120,7 @@ target_include_directories(touchpy PRIVATE
${SOURCE_DIR}
${CUDAToolkit_INCLUDE_DIRS}
"${CMAKE_CURRENT_SOURCE_DIR}/external/TouchEngine-Windows/include"
"${CMAKE_BINARY_DIR}/_vma_include"
)

target_link_directories(touchpy PRIVATE
Expand Down
2 changes: 1 addition & 1 deletion docs/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
SPHINXOPTS ?=
SPHINXBUILD ?= sphinx-build
SOURCEDIR = source
BUILDDIR = ../install/docs
BUILDDIR = build

# Put it first so that "make" without argument is like "make help".
help:
Expand Down
8 changes: 5 additions & 3 deletions docs/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
sphinx==7.3.6
sphinx-autoapi==3.1.0b0
furo==2024.1.29
sphinx>=7.3
sphinx-autoapi>=3.1
furo
sphinx-copybutton
numpydoc
myst_parser
14 changes: 5 additions & 9 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,12 @@
# https://www.sphinx-doc.org/en/master/usage/configuration.html


from pathlib import Path
import sys
localImportPath = Path.cwd().parents[1] / 'install/modules'

if str(localImportPath) not in sys.path:
sys.path.insert(0,str(localImportPath))

from importlib.metadata import version as get_version

project = 'TouchPy'
copyright = '2024'
author = 'IntentDev'
release = '0.10'
release = get_version('touchpy')


#==== start autoapi variant ========================
Expand All @@ -28,7 +22,9 @@
'numpydoc',
'myst_parser']

autoapi_dirs = ['../../out/install_build/py312']
import touchpy
import os
autoapi_dirs = [os.path.dirname(touchpy.__file__)]
autoapi_type = "python"

autoapi_options = [ 'members', 'undoc-members', 'private-members', 'show-module-summary', 'special-members', 'imported-members', ]
Expand Down
Loading