Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update CMake and setuptools logic for the Python bindings #233

Merged
merged 18 commits into from
Jul 13, 2021
Merged
Show file tree
Hide file tree
Changes from 11 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
22 changes: 16 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -214,12 +214,12 @@ jobs:
fail-fast: false
matrix:
platform: [macos-latest, ubuntu-latest] #windows-latest,
# python-version: [3.5, 3.6, 3.7, 3.8]
python-version: [3.6]
python-version: [3.6, 3.7, 3.8, 3.9]
runs-on: ${{ matrix.platform }}
steps:
- name: Checkout
uses: actions/checkout@v2
- run: git fetch --prune --unshallow
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
Expand All @@ -234,14 +234,24 @@ jobs:
run: brew install eigen
- name: Setup
run: |
python -m pip install --upgrade pip
pip install pytest "pybind11[global]"
pip install -r requirements.txt
python3 -m pip install --upgrade pip
pip3 install build
- name: Build
run: pip install .
run: pip3 install -v .[testing]
- name: Test
run: pytest

- name: Build sdist
if: contains(matrix.platform, 'ubuntu') && matrix.python-version == '3.6'
run: python3 -m build --sdist -o dist/
- name: Build wheel
run: python3 -m build --wheel -o dist/
- name: Upload artifacts
uses: actions/upload-artifact@v2
with:
path: dist/*
name: dist

# arm64:
# needs: [build-ubuntu]
# runs-on: ubuntu-latest
Expand Down
7 changes: 7 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,15 @@ option(BUILD_PYTHON_BINDINGS "Build Python bindings with pybind11." OFF)
option(BUILD_TESTING_PYTHON "Build Python tests only." OFF)

if (BUILD_PYTHON_BINDINGS)

# Include the vendored FindPython3 resources
list(PREPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules")

find_package(Python3 REQUIRED COMPONENTS Interpreter Development.Module)
find_package(pybind11 REQUIRED)

add_subdirectory(python)

endif()

###########
Expand Down
3 changes: 1 addition & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,7 @@ Let's install all dependencies for development and testing,

```terminal
apt install libeigen3-dev
python3 -m pip install "pybind11[global]" pytest
python3 -m pip install -r requirements
python3 -m pip install "pybind11[global]" pytest numpy
```

We can now build **manif**, its Python wrappers and all tests,
Expand Down
Loading