Skip to content
Merged
Show file tree
Hide file tree
Changes from 9 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
20 changes: 9 additions & 11 deletions .github/workflows/linux-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,35 +5,33 @@ on: [pull_request]
jobs:
build:
name: Tests for 🐍 ${{ matrix.python-version }}
runs-on: ubuntu-22.04
runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix:
python-version: ["3.9", "3.10", "3.11", "3.12"]
python-version: ["3.10", "3.11", "3.12", "3.13"]

steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v5

- name: Install Dependencies
run: |
sudo apt-get -y update
sudo apt install cmake build-essential pkg-config libpython3-dev python3-numpy libboost-all-dev
sudo apt install cmake

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
- name: Install uv and set the ${{ matrix.python-version }}
uses: astral-sh/setup-uv@v6
with:
python-version: ${{ matrix.python-version }}

- name: Python Dependencies
run: |
sudo pip3 install -U pip setuptools
sudo pip3 install -r requirements.txt
run: uv sync --locked --all-extras --dev

- name: Build and Test
run: |
# Build
cmake .
cd tests
# Use Pytest to run all the tests.
pytest
uv run pytest tests
18 changes: 7 additions & 11 deletions .github/workflows/macos-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,36 +5,32 @@ on: [pull_request]
jobs:
build:
name: Tests for 🐍 ${{ matrix.python-version }}
runs-on: macos-14
runs-on: macos-latest

strategy:
fail-fast: false
matrix:
python-version: ["3.9", "3.10", "3.11", "3.12"]
python-version: ["3.10", "3.11", "3.12", "3.13"]

steps:
- name: Checkout
uses: actions/checkout@v2

- name: Install Dependencies
run: |
brew install cmake ninja boost
brew install cmake ninja

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
- name: Install uv and set the ${{ matrix.python-version }}
uses: astral-sh/setup-uv@v6
with:
python-version: ${{ matrix.python-version }}

- name: Python Dependencies
run: |
pip3 install -U pip setuptools
pip3 install -r requirements.txt
run: uv sync --locked --all-extras --dev

- name: Build and Test
run: |
# Build
cmake .
cd tests
# Use Pytest to run all the tests.
pytest

uv run pytest tests
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,5 @@ __pycache__/
**/.coverage

gtwrap/matlab_wrapper/matlab_wrapper.tpl

.python-version
13 changes: 6 additions & 7 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.9)
cmake_minimum_required(VERSION 3.30)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

3.30 is really really new

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cmake is currently on version 4. Plus I figured this is more for our internal use anyway.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we use whatever we currently use in GTSAM? Same goes for CI runners, btw. Otherwise we could get in a situation where we use something here that is not yet supported in GTSAM.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, CMake will default to use the cmake config provided by upstream package even with FindBoost, see https://cmake.org/cmake/help/v3.10/module/FindBoost.html#boost-cmake

So we don't need to bump the minimum requirement, just need to have a test for the existence of the CMP rule and set it to NEW if exists to silence the warning

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've made that change in GTSAM and was going to push it along with some other minor fixes.

(CMake had been yelling at me a lot recently)

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Asking for too new a version imposes a burden on our users. What is the default version installed for Ubuntu 22 and 24? What is the version in brew and whatever windows uses (Unix subsystem uses Ubuntu). That is what should drive this.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Main project is at 3.9 right now borglab/gtsam@develop/CMakeLists.txt

I made that change locally, I haven't pushed it yet since I am trying to verify dependencies.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't have the bandwidth to deal with this (IMO trivial) issue, so I dropped the version down to 3.19.2 since that version is when CMake started supporting Apple Silicon.

(I say trivial since I already spent the time compiling and testing compatibility already before making the PR, as a good contributor would)


# Set the project name and version
project(gtwrap VERSION 1.0)
Expand Down Expand Up @@ -34,14 +34,13 @@ configure_package_config_file(
${CMAKE_CURRENT_BINARY_DIR}/cmake/gtwrapConfig.cmake
INSTALL_DESTINATION "${INSTALL_CMAKE_DIR}"
PATH_VARS INSTALL_CMAKE_DIR INSTALL_LIB_DIR INSTALL_BIN_DIR
INSTALL_INCLUDE_DIR
INSTALL_PREFIX ${CMAKE_INSTALL_PREFIX})
INSTALL_INCLUDE_DIR)

# Set all the install paths
set(GTWRAP_CMAKE_INSTALL_DIR ${CMAKE_INSTALL_PREFIX}/${INSTALL_CMAKE_DIR})
set(GTWRAP_LIB_INSTALL_DIR ${CMAKE_INSTALL_PREFIX}/${INSTALL_LIB_DIR})
set(GTWRAP_BIN_INSTALL_DIR ${CMAKE_INSTALL_PREFIX}/${INSTALL_BIN_DIR})
set(GTWRAP_INCLUDE_INSTALL_DIR ${CMAKE_INSTALL_PREFIX}/${INSTALL_INCLUDE_DIR})
set(GTWRAP_CMAKE_INSTALL_DIR $${INSTALL_CMAKE_DIR})
set(GTWRAP_LIB_INSTALL_DIR ${INSTALL_LIB_DIR})
set(GTWRAP_BIN_INSTALL_DIR ${INSTALL_BIN_DIR})
set(GTWRAP_INCLUDE_INSTALL_DIR ${INSTALL_INCLUDE_DIR})

# ##############################################################################
# Install the package
Expand Down
52 changes: 52 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
[project]
name = "gtwrap"
version = "2.0.0"
description = "Library to wrap C++ with Python and Matlab"
authors = [
{ name="Frank Dellaert", email="dellaert@gatech.edu" },
{ name = "Varun Agrawal", email = "varunagrawal@gatech.edu" },
{ name = "Duy Nguyen Ta", email = "duynguyen@gatech.edu" },
{ name = "Fan Jiang", email = "i@fanjiang.me" },
{ name = "Matthew Sklar", email = "matthewsklar227@gmail.com" }
]
readme = "README.md"
license = "BSD-3-Clause"
keywords=["wrap", "bindings", "cpp", "python", "matlab"]

classifiers = [
"Intended Audience :: Education",
"Intended Audience :: Developers",
"Intended Audience :: Science/Research",
"Operating System :: MacOS",
"Operating System :: Microsoft :: Windows",
"Operating System :: POSIX :: Linux",
"Programming Language :: Python",
"Programming Language :: Python :: 3.11",
]

requires-python = ">=3.10"
dependencies = [
"pyparsing>=3.2.5",
]

[dependency-groups]
dev = [
"pytest>=9.0.1",
"pytest-cov>=7.0.0",
]

[project.urls]
Homepage = "https://github.com/borglab/wrap"
Documentation = "https://github.com/borglab/wrap"
Repository = "https://github.com/borglab/wrap"

[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"

[tool.pytest.ini_options]
addopts = "--cov=gtwrap --cov-report html --cov-report term"
norecursedirs = []

[tool.uv.build-backend]
module-name = "gtwrap"
2 changes: 0 additions & 2 deletions requirements.txt

This file was deleted.

36 changes: 0 additions & 36 deletions setup.py

This file was deleted.

Loading
Loading