Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
16f3b98
Adds CI scripts.
msis Jan 20, 2016
cc09bdd
TRAVIS: changes to cpp project and installs boost-python. APPVEYOR: a…
msis Jan 20, 2016
378e8a2
Trying to fix bootstrap for OSX and Windows
msis Jan 20, 2016
3f2b992
Doesn't compile, don't judge!
msis Feb 6, 2016
1038c3b
Only activequeuecomms.py works for now with python3.
msis Feb 14, 2016
f69f555
changed cmake build to cater for multiple python versions
briany1000 Apr 20, 2016
2b719c2
Intelligently deal with capitalised or non capitalised Python include…
Apr 26, 2016
68a8f3c
Merge branch 'master' of github.com:themoos/python-moos
pmnewman May 26, 2016
ec4aa17
<pybind11> migration to pybind11 almost done.
msis Dec 14, 2016
294ed9a
<pybind11> uses the whole pybind11 prject and its macros
msis Dec 14, 2016
560515c
[travis-ci] fixes c++11 error w/ g++-4.8
msis Dec 15, 2016
7310c5f
[travis-ci] adding cmake to get 2.8.12 (at least)
msis Dec 15, 2016
570271d
[travis-ci] fixes macOS CMake error due to pybind11 use of PRIVATE in…
msis Dec 16, 2016
45eb082
[appveyor] removes remains of boost.
msis Dec 16, 2016
a6d8e0f
[appveyor] same mistake as last commit for travis-ci
msis Dec 16, 2016
0893410
[appveyor] trying to fix arch issues.
msis Dec 16, 2016
bc4183f
[appveyor] trying to fix folder exists issue when building.
msis Dec 16, 2016
b406fb1
[appveyor] same as previous
msis Dec 16, 2016
1638168
[README] adds build badges.
msis Dec 16, 2016
d3e398a
[src] removes old TODOs. Exception translator is maybe OK w/o???
msis Dec 16, 2016
d6a5ca5
Adds install option.
msis Feb 1, 2017
0678ba9
[src] misuderstanding around pyGIL solved
msis Feb 9, 2017
80728af
[src] forgotten comments
msis Feb 9, 2017
bcfe3b0
Merge branch 'master' into pybind11
msis Feb 14, 2017
c882d03
puts back mistakenly uncommented lines in Close() method.
msis Feb 14, 2017
0641904
[testing] adding first unittests
msis Feb 14, 2017
08d880c
[testing] adds some tests to make sure all is right!
msis Feb 19, 2017
d143f43
[testing] removes old commented lines
msis Feb 19, 2017
bdbdc63
[CI] testing in Travis-CI
msis Feb 21, 2017
76d03d2
[CI] second try at automating all the tests.
msis Feb 22, 2017
417c079
[CI] still trying to find the right fit!
msis Feb 22, 2017
b3f94d4
[src] adds python docstrings
msis Feb 22, 2017
35c3f6d
[CI] still figuring ci...
msis Feb 22, 2017
dd5d723
[CI] it will work at some point...
msis Feb 22, 2017
ed47a0f
[testing] adds callback testing
msis Feb 19, 2017
0e6d8a9
Adds get community name from msg
msis May 10, 2017
335287f
Fixes Travis failure issue
msis May 10, 2017
35adc01
[testing] fixed the callback test failure (needed some sleep)
msis Jul 13, 2017
a2ea6ca
Trying with setup.py!
msis Jul 13, 2017
b022479
fixing CI
msis Jul 13, 2017
a160a34
[CI] fingers Xed
msis Jul 14, 2017
3f69a20
[CI] solution! (maybe)
msis Jul 14, 2017
8c896da
[WIN32] fix NOMINMAX
msis Jul 14, 2017
3a5dd49
[ignore] setup.py stuff
msis Jul 14, 2017
9a7ba58
[exceptions] getting closer, but not there yet.
msis Jul 14, 2017
f195f43
[tests] all in one test script to better see the score.
msis Jul 14, 2017
fe1f490
[tests] reorder tests
msis Jul 20, 2017
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
62 changes: 62 additions & 0 deletions .appveyor.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
version: devel-{build}

os: Visual Studio 2015

platform:
- x64
- x86

environment:
matrix:
- PYTHON: 27
- PYTHON: 36
- CONDA: 27
- CONDA: 35

shallow_clone: true

install:
- ps: |
if ($env:PLATFORM -eq "x64") { $env:CMAKE_ARCH = "x64" }
if ($env:PYTHON) {
if ($env:PLATFORM -eq "x64") { $env:PYTHON = "$env:PYTHON-x64" }
$env:PATH = "C:\Python$env:PYTHON\;C:\Python$env:PYTHON\Scripts\;$env:PATH"
pip install --disable-pip-version-check --user --upgrade pip setuptools
} elseif ($env:CONDA) {
if ($env:CONDA -eq "27") { $env:CONDA = "" }
if ($env:PLATFORM -eq "x64") { $env:CONDA = "$env:CONDA-x64" }
$env:PATH = "C:\Miniconda$env:CONDA\;C:\Miniconda$env:CONDA\Scripts\;$env:PATH"
conda config --set always_yes yes --set changeps1 no
conda config --add channels conda-forge
conda update -q conda
conda install -q conda-build
}
- if "%platform%" == "x64" SET VS_FULL=Visual Studio 14 2015 Win64
- if "%platform%" == "x86" SET VS_FULL=Visual Studio 14 2015
- cd ..
- git clone -b wOnlineCI --depth=1 https://github.com/msis/core-moos
- cd core-moos
- mkdir build
- cd build
- cmake -G "%VS_FULL%" -DENABLE_EXPORT=ON -DUSE_ASYNC_COMMS=ON -DCMAKE_BUILD_TYPE=Release ../
- cmake --build . --config Release
- cmake --build . --config Release --target install

build_script:
- cd %APPVEYOR_BUILD_FOLDER%
- ps: |
if ($env:PYTHON) {
python setup.py sdist
pip install --verbose dist\pymoos-0.0.1.tar.gz
} else {
conda build conda.recipe
conda install --use-local pymoos
}

test_script:
- ps: |
cd tests
python run_close.py
python simple_comms.py
python register.py
python callbacks.py
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,6 @@
/.DS_Store
/build
__pycache__
*.pyc
*.egg-info
dist
81 changes: 81 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
language: cpp

matrix:
include:
- os: linux
env: PYTHON=2.7
- os: linux
env: PYTHON=3.5
- os: linux
env: CONDA=2.7
- os: linux
env: CONDA=3.6
- os: osx
env: PYTHON=2.7
- os: osx
env: PYTHON=3.6
- os: osx
env: CONDA=2.7
- os: osx
env: CONDA=3.6

dist: trusty

addons:
apt:
sources:
- ubuntu-toolchain-r-test
- deadsnakes
- kubuntu-backports
packages:
- g++-4.8
- python3.5
- python3.5-dev
- cmake

before_install:
- if [ "`uname`" != "Darwin" ] ; then export MOOS_CXX_FLAGS="-fPIC -Wno-long-long"; fi
- if [ "`uname`" != "Darwin" ] ; then export CXX="g++-4.8"; fi
- cd ..
- git clone -b wOnlineCI --depth=1 https://github.com/msis/core-moos
- cd core-moos
- mkdir build
- cd build
- cmake -DENABLE_EXPORT=ON -DUSE_ASYNC_COMMS=ON -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_FLAGS=$MOOS_CXX_FLAGS ..
- cmake --build . --config Release --config -j4
- sudo cmake --build . --config Release --target install
- cd $TRAVIS_BUILD_DIR
- |
if [ "$TRAVIS_OS_NAME" = "linux" ]; then export CXX=g++-4.8 CC=gcc-4.8; fi
if [ -n "$PYTHON" ]; then
if [ "$TRAVIS_OS_NAME" = "osx" ] && [ "${PYTHON:0:1}" = "3" ]; then
brew update; brew install python3;
fi
pip install --user --upgrade pip virtualenv
virtualenv -p python$PYTHON venv
source venv/bin/activate
elif [ -n "$CONDA" ]; then
if [ "$TRAVIS_OS_NAME" = "linux" ]; then OS=Linux-x86_64; else OS=MacOSX-x86_64; fi
wget -O miniconda.sh https://repo.continuum.io/miniconda/Miniconda${CONDA:0:1}-latest-$OS.sh
bash miniconda.sh -b -p $HOME/miniconda
export PATH="$HOME/miniconda/bin:$PATH"
conda config --set always_yes yes --set changeps1 no
conda config --add channels conda-forge
conda update -q conda
conda install -q conda-build
conda create -q -n test-environment python=$CONDA
source activate test-environment
fi

install:
- |
if [ -n "$PYTHON" ]; then
python setup.py sdist
pip install --verbose dist/*.tar.gz
elif [ -n "$CONDA" ]; then
conda build conda.recipe
conda install --use-local pymoos
fi

script:
- python tests/test.py
62 changes: 6 additions & 56 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,59 +1,9 @@
cmake_minimum_required(VERSION 2.6)
cmake_minimum_required(VERSION 2.8.12)
project (python-moos)
find_package(MOOS 10 REQUIRED)

find_package(PythonLibs)
if(PYTHONLIBS_FOUND)
include_directories("${PYTHON_INCLUDE_DIRS}")
else()
message(FATAL_ERROR "Unable to find PythonLibs.")
endif()

find_package(Boost REQUIRED python)
set(Boost_USE_STATIC_LIBS ON)
set(Boost_USE_MULTITHREADED ON)
set(Boost_USE_STATIC_RUNTIME ON)

if(NOT DEFINED CMAKE_RUNTIME_OUTPUT_DIRECTORY)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/bin)
endif()

if(NOT DEFINED CMAKE_LIBRARY_OUTPUT_DIRECTORY)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/lib)
endif()
if(NOT DEFINED CMAKE_ARCHIVE_OUTPUT_DIRECTORY)
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/lib)
endif()


include_directories(${CMAKE_CURRENT_SOURCE_DIR} ${Boost_INCLUDE_DIRS} ${MOOS_INCLUDE_DIRS})

set(src
pyMOOS.cpp
)

add_library(pymoos SHARED ${src})

set_target_properties( pymoos
PROPERTIES
SUFFIX ".so"
)

set_target_properties(pymoos
PROPERTIES
PREFIX "")


file(GLOB ExampleFiles ${CMAKE_SOURCE_DIR}/Documentation/examples/*.py)
add_custom_target(copy)
get_target_property(pymoosLocation pymoos LOCATION)
get_filename_component(pymoosDir ${pymoosLocation} PATH)
foreach(ExampleFile ${ExampleFiles})
add_custom_command(TARGET copy PRE_BUILD
COMMAND ${CMAKE_COMMAND} -E
copy ${ExampleFile} ${pymoosDir})
endforeach()
add_dependencies(pymoos copy)

find_package(MOOS 10 REQUIRED)

TARGET_LINK_LIBRARIES(pymoos ${Boost_LIBRARIES} ${PYTHON_LIBRARIES} ${MOOS_LIBRARIES})
add_subdirectory(pybind11)
pybind11_add_module(pymoos src/pyMOOS.cpp)
include_directories(${MOOS_INCLUDE_DIRS})
target_link_libraries(pymoos PRIVATE ${MOOS_LIBRARIES})
4 changes: 4 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
include README.md LICENSE
global-include CMakeLists.txt *.cmake
recursive-include src *
recursive-include pybind11/include *.h
10 changes: 9 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
python-moos
===========
python bindings for [MOOS](https://github.com/themoos/core-moos)

python bindings for MOOS
# Build Statuses
|OS |Build Status|
|:--------|-----------:|
|Linux/OSX|[![Build Status](https://travis-ci.org/msis/python-moos.svg)](https://travis-ci.org/msis/python-moos)|
|Windows |[![Build status](https://ci.appveyor.com/api/projects/status/ad0jwpij0xhikh5f?svg=true)](https://ci.appveyor.com/project/msis/python-moos)|

# Build Instructions
(TODO, for now please refer to the `.travis.yml` file for Linux/OSX and `appveyor.yml` file for Windows.)
2 changes: 2 additions & 0 deletions conda.recipe/bld.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
"%PYTHON%" setup.py install
if errorlevel 1 exit 1
3 changes: 3 additions & 0 deletions conda.recipe/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/bash
unset MACOSX_DEPLOYMENT_TARGET
${PYTHON} setup.py install;
33 changes: 33 additions & 0 deletions conda.recipe/meta.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
package:
name: pymoos
version: {{ environ.get('GIT_DESCRIBE_TAG', 'dev') }}

build:
number: {{ environ.get('GIT_DESCRIBE_NUMBER', 0) }}
{% if environ.get('GIT_DESCRIBE_NUMBER', '0') == '0' %}string: py{{ environ.get('PY_VER').replace('.', '') }}_0
{% else %}string: py{{ environ.get('PY_VER').replace('.', '') }}_{{ environ.get('GIT_BUILD_STR', 'GIT_STUB') }}{% endif %}
script_env:
- CC
- CXX

source:
git_url: ../

requirements:
build:
- python
- setuptools
- pybind11
- cmake

run:
- python
- vs2015_runtime # [win]

test:
imports:
- pymoos

about:
summary: An example project built with pybind11.
license_file: LICENSE
Loading