diff --git a/.github/workflows/pip.yml b/.github/workflows/pip.yml index dfabeff..cce7dc1 100644 --- a/.github/workflows/pip.yml +++ b/.github/workflows/pip.yml @@ -45,6 +45,30 @@ jobs: echo "DISTUTILS_USE_SDK=1" >> $GITHUB_ENV echo "MSSdk=1" >> $GITHUB_ENV + - name: Update vcpkg + run: | + cd C:\vcpkg + git pull + .\\bootstrap-vcpkg.bat + if: startsWith(matrix.os, 'win') + + - name: Install library deps with vcpkg + run: | + vcpkg install eigen3:x64-windows + vcpkg integrate install + if: startsWith(matrix.os, 'win') + + - name: Install library deps with brew + run: | + brew install -s eigen + if: startsWith(matrix.os, 'mac') + + - name: Install library deps with apt + if: runner.os == 'Linux' + run: | + sudo apt-get -qq update + sudo apt-get install -y libeigen3-dev + - name: Build and install run: pip install --verbose . diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index 11732ef..1c30121 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -54,6 +54,11 @@ jobs: - uses: actions/setup-python@v2 + - name: Install library deps with apt + run: | + sudo apt-get -qq update + sudo apt-get install -y libeigen3-dev + - name: Install cibuildwheel run: python -m pip install cibuildwheel==1.6.3 diff --git a/CMakeLists.txt b/CMakeLists.txt index 9b220b1..a61d3f6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,9 +1,19 @@ cmake_minimum_required(VERSION 3.4...3.18) project(cmake_example) +find_package(Eigen3 CONFIG REQUIRED) +find_package(Threads REQUIRED) + add_subdirectory(pybind11) pybind11_add_module(cmake_example src/main.cpp) +set(CMAKE_CXX_STANDARD 11) +set(CMAKE_CXX_STANDARD_REQUIRED ON) +set(CMAKE_CXX_EXTENSIONS OFF) + # EXAMPLE_VERSION_INFO is defined by setup.py and passed into the C++ code as a # define (VERSION_INFO) here. target_compile_definitions(cmake_example PRIVATE VERSION_INFO=${EXAMPLE_VERSION_INFO}) + +target_compile_features(cmake_example INTERFACE cxx_std_11) +target_link_libraries(cmake_example PRIVATE Eigen3::Eigen) diff --git a/tox.ini b/tox.ini new file mode 100644 index 0000000..2401737 --- /dev/null +++ b/tox.ini @@ -0,0 +1,33 @@ +[tox] +envlist = py3{6,7,8,9} +skip_missing_interpreters = true + +[tox:travis] +3.6 = py36 +3.7 = py37 +3.8 = py38 +3.9 = py39 + +[testenv] +passenv = CI PYTHON CC CXX + +deps = + pip>=19.0.1 + wheel + +commands = + pip install . + python tests/test.py + #py.test . --cov --cov-report term-missing + # codecov + +[testenv:deploy] +passenv = CI PYTHON CC CXX + +deps = + pip>=19.0.1 + wheel + +commands = + python setup.py sdist + python setup.py bdist_wheel