Unverified Commit 83d54942 authored by Guilhem Saurel's avatar Guilhem Saurel Committed by GitHub
Browse files

Merge pull request #8 from nim65s/master

Fix python3, update tests, CI & generate doc
parents 044f7013 0b61892f
Pipeline #1298 passed with stage
in 1 minute and 56 seconds
variables: variables:
GIT_SSL_NO_VERIFY: "true"
GIT_SUBMODULE_STRATEGY: "recursive" GIT_SUBMODULE_STRATEGY: "recursive"
GIT_DEPTH: "3" GIT_DEPTH: "3"
NAMESPACE: stack-of-tasks CCACHE_BASEDIR: "${CI_PROJECT_DIR}"
PROJECT: parametric-curves CCACHE_DIR: "${CI_PROJECT_DIR}/ccache"
IMAGE: "${CI_REGISTRY}/${NAMESPACE}/${PROJECT}"
cache: cache:
paths: paths:
- build/ccache - ccache
.robotpkg-parametric-curves: &robotpkg-parametric-curves .robotpkg-parametric-curves: &robotpkg-parametric-curves
variables: except:
ROBOTPKG: parametric-curves - gh-pages
CATEGORY: wip
before_script:
- mkdir -p build/ccache
- cd build
- export CCACHE_BASEDIR=${PWD}
- export CCACHE_DIR=${PWD}/ccache
script: script:
- cd /root/robotpkg/${CATEGORY}/${ROBOTPKG} - mkdir -p ccache
- cd /root/robotpkg/wip/parametric-curves
- git pull - git pull
- echo "MASTER_REPOSITORY = git ${CI_PROJECT_DIR}" >> Makefile - make checkout MASTER_REPOSITORY="dir ${CI_PROJECT_DIR}"
- echo "REPOSITORY.parametric-curves = git ${CI_PROJECT_DIR}" >> /opt/openrobots/etc/robotpkg.conf
- make checkout
- make install - make install
- cd work.*/${PROJECT}*/ - cd work.$(hostname)/$(make show-var VARNAME=DISTNAME)
- make test - make check
- make doc - make doc
except: - mv doc/doxygen-html ${CI_PROJECT_DIR}
- gh-pages
robotpkg-parametric-curves-14.04: robotpkg-parametric-curves-16.04-release:
<<: *robotpkg-parametric-curves <<: *robotpkg-parametric-curves
image: ${IMAGE}:14.04 image: eur0c.laas.fr:5000/stack-of-tasks/parametric-curves/parametric-curves:16.04
artifacts:
expire_in: 1 day
paths:
- doxygen-html/
robotpkg-parametric-curves-16.04: robotpkg-parametric-curves-dubnium-release:
<<: *robotpkg-parametric-curves <<: *robotpkg-parametric-curves
image: ${IMAGE}:16.04 image: eur0c.laas.fr:5000/stack-of-tasks/parametric-curves/parametric-curves:dubnium
robotpkg-parametric-curves-17.10: robotpkg-parametric-curves-18.04-release:
<<: *robotpkg-parametric-curves <<: *robotpkg-parametric-curves
image: ${IMAGE}:17.10 image: eur0c.laas.fr:5000/stack-of-tasks/parametric-curves/parametric-curves:18.04
robotpkg-parametric-curves-dubnium: robotpkg-parametric-curves-14.04-release:
<<: *robotpkg-parametric-curves <<: *robotpkg-parametric-curves
image: ${IMAGE}:dubnium image: eur0c.laas.fr:5000/stack-of-tasks/parametric-curves/parametric-curves:14.04
.robotpkg-py-parametric-curves: &robotpkg-py-parametric-curves
except:
- gh-pages
script:
- mkdir -p ccache
- cd /root/robotpkg/wip/py-parametric-curves
- git pull
- make checkout MASTER_REPOSITORY="dir ${CI_PROJECT_DIR}"
- make install
- cd work.$(hostname)/$(make show-var VARNAME=DISTNAME)
- make check
- make doc
- mv doc/doxygen-html ${CI_PROJECT_DIR}
robotpkg-py-parametric-curves-14.04-release:
<<: *robotpkg-py-parametric-curves
image: eur0c.laas.fr:5000/stack-of-tasks/parametric-curves/py-parametric-curves:14.04
robotpkg-py-parametric-curves-py3-14.04-release:
<<: *robotpkg-py-parametric-curves
image: eur0c.laas.fr:5000/stack-of-tasks/parametric-curves/py-parametric-curves-py3:14.04
robotpkg-py-parametric-curves-dubnium-release:
<<: *robotpkg-py-parametric-curves
image: eur0c.laas.fr:5000/stack-of-tasks/parametric-curves/py-parametric-curves:dubnium
robotpkg-py-parametric-curves-py3-dubnium-release:
<<: *robotpkg-py-parametric-curves
image: eur0c.laas.fr:5000/stack-of-tasks/parametric-curves/py-parametric-curves-py3:dubnium
robotpkg-py-parametric-curves-16.04-release:
<<: *robotpkg-py-parametric-curves
image: eur0c.laas.fr:5000/stack-of-tasks/parametric-curves/py-parametric-curves:16.04
artifacts:
expire_in: 1 day
paths:
- doxygen-html/
robotpkg-py-parametric-curves-py3-16.04-release:
<<: *robotpkg-py-parametric-curves
image: eur0c.laas.fr:5000/stack-of-tasks/parametric-curves/py-parametric-curves-py3:16.04
robotpkg-py-parametric-curves-18.04-release:
<<: *robotpkg-py-parametric-curves
image: eur0c.laas.fr:5000/stack-of-tasks/parametric-curves/py-parametric-curves:18.04
robotpkg-py-parametric-curves-py3-18.04-release:
<<: *robotpkg-py-parametric-curves
image: eur0c.laas.fr:5000/stack-of-tasks/parametric-curves/py-parametric-curves-py3:18.04
...@@ -4,6 +4,7 @@ INCLUDE(cmake/base.cmake) ...@@ -4,6 +4,7 @@ INCLUDE(cmake/base.cmake)
INCLUDE(cmake/boost.cmake) INCLUDE(cmake/boost.cmake)
INCLUDE(cmake/eigen.cmake) INCLUDE(cmake/eigen.cmake)
INCLUDE(cmake/python.cmake) INCLUDE(cmake/python.cmake)
INCLUDE(cmake/test.cmake)
SET(PROJECT_NAME parametric-curves) SET(PROJECT_NAME parametric-curves)
SET(PROJECT_DESCRIPTION "Template based classes for creating and manipulating parametric curves. Comes with extra options specific to end-effector trajectories in robotics." ) SET(PROJECT_DESCRIPTION "Template based classes for creating and manipulating parametric curves. Comes with extra options specific to end-effector trajectories in robotics." )
...@@ -34,7 +35,7 @@ SET(BOOST_OPTIONAL_COMPONENTS "") ...@@ -34,7 +35,7 @@ SET(BOOST_OPTIONAL_COMPONENTS "")
OPTION (BUILD_PYTHON_INTERFACE "Build the python binding" ON) OPTION (BUILD_PYTHON_INTERFACE "Build the python binding" ON)
IF(BUILD_PYTHON_INTERFACE) IF(BUILD_PYTHON_INTERFACE)
SET(BOOST_OPTIONAL_COMPONENTS ${BOOST_OPTIONAL_COMPONENTS} python) SET(BOOST_OPTIONAL_COMPONENTS ${BOOST_OPTIONAL_COMPONENTS} python)
FINDPYTHON(2.7 REQUIRED) FINDPYTHON()
INCLUDE_DIRECTORIES( ${PYTHON_INCLUDE_DIRS} ) INCLUDE_DIRECTORIES( ${PYTHON_INCLUDE_DIRS} )
ENDIF(BUILD_PYTHON_INTERFACE) ENDIF(BUILD_PYTHON_INTERFACE)
...@@ -83,6 +84,7 @@ ENDIF(BUILD_PYTHON_INTERFACE) ...@@ -83,6 +84,7 @@ ENDIF(BUILD_PYTHON_INTERFACE)
ADD_SUBDIRECTORY (src/tests/spline_test) ADD_SUBDIRECTORY (src/tests/spline_test)
ADD_CUSTOM_TARGET(check COMMAND ${CMAKE_CTEST_COMMAND})
PKG_CONFIG_APPEND_BOOST_LIBS(${BOOST_REQUIERED_COMPONENTS}) PKG_CONFIG_APPEND_BOOST_LIBS(${BOOST_REQUIERED_COMPONENTS})
SETUP_PROJECT_FINALIZE() SETUP_PROJECT_FINALIZE()
Subproject commit d22de8c53c3507df785b1fb3ab260d9fdfb65233 Subproject commit bf10c6ca3565b96ab283edaa8f18b5b533e59da9
...@@ -35,31 +35,10 @@ SET(PYTHON_FILES ...@@ -35,31 +35,10 @@ SET(PYTHON_FILES
) )
FOREACH(python ${PYTHON_FILES}) FOREACH(python ${PYTHON_FILES})
GET_FILENAME_COMPONENT(pythonFile ${python} NAME)
# Generate pyc file
add_custom_target(${pythonFile}c ALL
COMMAND
${CMAKE_COMMAND} -E ${LINK}
${${PROJECT_NAME}_SOURCE_DIR}/python/${python}
${CMAKE_BINARY_DIR}/bindings/python/${PROJECT_NAME}/${pythonFile}
COMMAND
${PYTHON_EXECUTABLE} -m py_compile
${CMAKE_BINARY_DIR}/bindings/python/${PROJECT_NAME}/${pythonFile})
# Tag pyc file as generated.
SET_SOURCE_FILES_PROPERTIES(
"${CMAKE_BINARY_DIR}/bindings/python/${PROJECT_NAME}/${pythonFile}c"
PROPERTIES GENERATED TRUE)
# Clean generated files.
SET_PROPERTY(
DIRECTORY APPEND PROPERTY
ADDITIONAL_MAKE_CLEAN_FILES
"${${PROJECT_NAME}_BINARY_DIR}/bindings/python/${PROJECT_NAME}/${pythonFile}c")
INSTALL(FILES INSTALL(FILES
"${${PROJECT_NAME}_SOURCE_DIR}/python/${python}" "${${PROJECT_NAME}_SOURCE_DIR}/python/${python}"
"${CMAKE_BINARY_DIR}/bindings/python/${PROJECT_NAME}/${pythonFile}c"
DESTINATION ${${PYWRAP}_INSTALL_DIR}) DESTINATION ${${PYWRAP}_INSTALL_DIR})
ENDFOREACH(python) ENDFOREACH(python)
#ADD_PYTHON_UNIT_TEST("py-spline" "python/test/test.py" "bindings/python/parametric-curves")
ADD_PYTHON_UNIT_TEST("py-quick" "python/test/quick.py" "bindings/python/parametric-curves")
from libparametric_curves_pywrap import * from .libparametric_curves_pywrap import *
from libparametric_curves_pywrap import polynomial, curve_constraints, forcecurve, spline
from numpy import matrix
cc = curve_constraints()
cc.init_vel = matrix(range(3)).T
fc = forcecurve()
sp = spline()
pn = polynomial(matrix('1 2 3;4 5 6;7 8 9'))
assert pn.min() == 0.0
assert pn.max() == 1.0
...@@ -8,4 +8,4 @@ add_executable( ...@@ -8,4 +8,4 @@ add_executable(
spline_tests ${HeaderFiles} Main.cpp spline_tests ${HeaderFiles} Main.cpp
) )
#add_test(spline_tests spline_tests) add_test(spline_tests spline_tests)
...@@ -5,7 +5,7 @@ set -e ...@@ -5,7 +5,7 @@ set -e
set -x set -x
set -v set -v
# Add robotpkg # Add robotpkg
sudo sh -c "echo \"deb [arch=amd64] http://robotpkg.openrobots.org/packages/debian/pub trusty robotpkg\" >> /etc/apt/sources.list " sudo sh -c "echo \"deb [arch=amd64] http://robotpkg.openrobots.org/packages/debian/pub trusty robotpkg\" >> /etc/apt/sources.list "
curl http://robotpkg.openrobots.org/packages/debian/robotpkg.key | sudo apt-key add - curl http://robotpkg.openrobots.org/packages/debian/robotpkg.key | sudo apt-key add -
...@@ -15,7 +15,7 @@ sudo free -m -t ...@@ -15,7 +15,7 @@ sudo free -m -t
# Setup environment variables. # Setup environment variables.
export APT_DEPENDENCIES="doxygen libboost-serialization-dev libeigen3-dev " export APT_DEPENDENCIES="doxygen libboost-serialization-dev libeigen3-dev "
# Add Python dependency # Add Python dependency
export APT_DEPENDENCIES=$APT_DEPENDENCIES" libboost-python-dev robotpkg-eigenpy python2.7-dev python-numpy" export APT_DEPENDENCIES=$APT_DEPENDENCIES" libboost-python-dev robotpkg-py27-eigenpy python2.7-dev python-numpy"
# When this script is called the current directory is ./custom_travis # When this script is called the current directory is ./custom_travis
. ./.travis/run ../.travis/before_install . ./.travis/run ../.travis/before_install
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment