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
61 changes: 61 additions & 0 deletions .github/workflows/build-multi-platform.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
# This starter workflow is for a CMake project running on multiple platforms. There is a different starter workflow if you just want a single platform.
# See: https://github.com/actions/starter-workflows/blob/main/ci/cmake-single-platform.yml
name: build on multi-platform

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

jobs:
build:
runs-on: ${{ matrix.os }}

strategy:
# Set fail-fast to false to ensure that feedback is delivered for all matrix combinations. Consider changing this to true when your workflow is stable.
fail-fast: false

# Matrix strategy: Creates a full combination of Python versions × Platform configs
# Total jobs: 5 Python versions × 10 os = 50 jobs
matrix:
os: [ubuntu-24.04, ubuntu-24.04-arm, ubuntu-22.04, ubuntu-22.04-arm, ubuntu-slim, macos-26, macos-15, macos-14, windows-2025, windows-2022]
python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"]

steps:
- uses: actions/checkout@v6
with:
submodules: recursive

- name: Set reusable strings
# Turn repeated input strings (such as the build output directory) into step outputs. These step outputs can be used throughout the workflow file.
id: strings
shell: bash
run: |
echo "build-output-dir=${{ github.workspace }}/build" >> "$GITHUB_OUTPUT"


- name: Display build configuration
shell: bash
run: |
echo "Building for:"
echo " OS: ${{ matrix.os }}"
echo " Python: ${{ matrix.python-version }}"
uname -m || echo "uname not available"

- name: setup Windows CL
uses: ilammy/msvc-dev-cmd@v1

- name: setup Python ${{ matrix.python-version }}
uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python-version }}

- name: Install apriltag-opencv
run: |
pip install .


- name: Test Python Module Import
run: |
python -c "import apriltag; print('Successfully imported apriltag'); detector = apriltag.apriltag(family='tag36h11'); print(f'Created detector: {detector}')"
29 changes: 29 additions & 0 deletions .github/workflows/deploy_manylinux_aarch64.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: PyPI manylinux_aarch64 deployer
on:
push:
tags:
- 'v*'
workflow_dispatch:

jobs:
# Build and deploy manylinux_aarch64 wheels
Linux-aarch64-build:
runs-on: ubuntu-24.04-arm
steps:
- uses: actions/checkout@v6
with:
submodules: recursive

- name: Build manylinux_aarch64 wheels
uses: pypa/cibuildwheel@v3.3.0
env:
CIBW_ARCHS_LINUX: "aarch64"
CIBW_BUILD: cp310-* cp311-* cp312-* cp313-* cp314-*
- name: Upload manylinux2014_aarch64 wheels to PyPI
env:
TWINE_USERNAME: ${{ secrets.TWINE_USERNAME }}
TWINE_PASSWORD: ${{ secrets.TWINE_PASSWORD }}
run: |
ls -l ./wheelhouse
pip install -U packaging twine
twine upload --skip-existing ./wheelhouse/*.whl
29 changes: 29 additions & 0 deletions .github/workflows/deploy_manylinux_x86_64.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: PyPI manylinux_x86_64 deployer
on:
push:
tags:
- 'v*'
workflow_dispatch:

jobs:
# Build and deploy manylinux_x86_64 wheels
# follow numpy schema: https://pypi.org/project/numpy/#files
Linux-x86-build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
with:
submodules: recursive
- name: Build manylinux_x86_64 wheels
uses: pypa/cibuildwheel@v3.3.0
env:
CIBW_ARCHS_LINUX: "x86_64"
CIBW_BUILD: cp310-* cp311-* cp312-* cp313-* cp314-*
- name: Upload manylinux2014_x86_64 wheels to PyPI
env:
TWINE_USERNAME: ${{ secrets.TWINE_USERNAME }}
TWINE_PASSWORD: ${{ secrets.TWINE_PASSWORD }}
run: |
ls -l ./wheelhouse
pip install -U packaging twine
twine upload --skip-existing ./wheelhouse/*.whl
30 changes: 30 additions & 0 deletions .github/workflows/deploy_source.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: PyPI source deployer
on:
push:
tags:
- 'v*'

jobs:
# Build and deploy source distribution
source-deploy:
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v6
with:
submodules: recursive
- name: Install Python 3.12
uses: actions/setup-python@v6
with:
python-version: 3.12
- name: Build source distribution
run: |
python -m pip install --upgrade build
python -m build --sdist
- name: Upload source package to PyPI
env:
TWINE_USERNAME: ${{ secrets.TWINE_USERNAME }}
TWINE_PASSWORD: ${{ secrets.TWINE_PASSWORD }}
run: |
pip install twine
twine upload dist/*
39 changes: 39 additions & 0 deletions .github/workflows/deploy_win_macos.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: PyPI win and macos deployer
on:
push:
tags:
- 'v*'
workflow_dispatch:

jobs:
# Build and deploy Windows AMD64, macOS x86 & macOS arm64 wheels
Matrix-build:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [windows-latest, macos-latest]
steps:
- name: Check out repository
uses: actions/checkout@v6
with:
submodules: recursive
- name: Install Python 3.x
uses: actions/setup-python@v6
with:
python-version: 3.x
- name: Build wheels
uses: pypa/cibuildwheel@v3.3.0
env:
CIBW_ARCHS_WINDOWS: "AMD64"
CIBW_ARCHS_MACOS: "x86_64 arm64 universal2"
# Does not fail at unsupported Python versions!
CIBW_BUILD: cp310-* cp311-* cp312-* cp313-* cp314-*
- name: Upload wheels
env:
TWINE_USERNAME: ${{ secrets.TWINE_USERNAME }}
TWINE_PASSWORD: ${{ secrets.TWINE_PASSWORD }}
run: |
ls -l ./wheelhouse
pip install twine
twine upload --skip-existing ./wheelhouse/*.whl
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -205,3 +205,6 @@ cython_debug/
marimo/_static/
marimo/_lsp/
__marimo__/

.*
!.github
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "src/apriltag/apriltag"]
path = src/apriltag/apriltag
url = https://github.com/AprilRobotics/apriltag
39 changes: 39 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
foreach(X IN ITEMS apriltag_detect.docstring apriltag_estimate_tag_pose.docstring apriltag_pywrap.c CMakeLists.txt)
configure_file(
${CMAKE_CURRENT_SOURCE_DIR}/src/${X}
${CMAKE_CURRENT_SOURCE_DIR}/src/apriltag/apriltag/${X}
COPYONLY
)
endforeach()

# Top-level CMakeLists.txt for scikit-build-core
cmake_minimum_required(VERSION 3.16)
project(${SKBUILD_PROJECT_NAME}
VERSION ${SKBUILD_PROJECT_VERSION}
DESCRIPTION "Python wrapper for the AprilTag visual fiducial detector"
LANGUAGES C)

# Set rpath for shared libraries to be found at runtime
if(APPLE)
set(CMAKE_INSTALL_RPATH "@loader_path")
elseif(UNIX)
set(CMAKE_INSTALL_RPATH "$ORIGIN")
endif()
set(CMAKE_BUILD_WITH_INSTALL_RPATH TRUE)


# Find Python and NumPy
find_package(Python3 REQUIRED COMPONENTS Development.Module NumPy)
message(STATUS "Found Python ${Python3_VERSION}")

add_subdirectory(src/apriltag/apriltag)

# Install the Python module
# scikit-build-core will automatically handle installation to the correct location
install(TARGETS apriltag.${Python3_SOABI}
LIBRARY DESTINATION apriltag
RUNTIME DESTINATION apriltag)

install(TARGETS apriltag
LIBRARY DESTINATION apriltag
RUNTIME DESTINATION apriltag)
Loading