Skip to content

Commit

Permalink
feat: also build clproto stubs package (#139)
Browse files Browse the repository at this point in the history
Build clproto stubs package.

Revert to ros2-ws as base image.
  • Loading branch information
domire8 authored Sep 21, 2023
1 parent b045640 commit 05408bc
Show file tree
Hide file tree
Showing 9 changed files with 17 additions and 17 deletions.
4 changes: 2 additions & 2 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
{
"name": "control libraries",
"remoteUser": "developer",
"remoteUser": "ros2",
"build": {
"dockerfile": "../Dockerfile.ci",
"context": "..",
"target": "development",
"args": {
"BASE_TAG": "22.04",
"ROS2_VERSION": "humble",
"PINOCCHIO_TESTS": "OFF"
}
},
Expand Down
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Release Versions:
## Upcoming changes (in development)

- feat(build): add configuration files for VS Code devcontainer (#137, #138)
- feat(python): auto-generate stubs for python modules in Dockerfile (#135)
- feat(python): auto-generate stubs for python modules in Dockerfile (#135, #139)
- fix: build all python modules (#134)

## 7.1.1
Expand Down
16 changes: 8 additions & 8 deletions Dockerfile.ci
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
ARG BASE_TAG=22.04
FROM ghcr.io/aica-technology/control-libraries/development-dependencies:${BASE_TAG} as base
ARG ROS2_VERSION=humble
FROM ghcr.io/aica-technology/ros2-ws:${ROS2_VERSION} as base
USER ${USER}

FROM base as apt-dependencies
Expand Down Expand Up @@ -64,7 +64,7 @@ COPY --from=apt-dependencies /tmp/apt /
ARG TARGETPLATFORM
ARG CACHEID
ARG PINOCCHIO_TAG=v2.6.9
ARG PINOCCHIO_TESTS=OFF
ARG PINOCCHIO_TESTS=ON
# FIXME: it would be nicer to have it all in the root CMakelists.txt but:
# * `pinocchio` doesn't provide an include directory we can easily plug into `target_include_directories` and thus needs to be installed first
# * `pinocchio` uses hacks relying on undocumented CMake quirks which break if you use `FetchContent`
Expand Down Expand Up @@ -145,12 +145,12 @@ COPY --from=python /tmp/python-home /home
RUN sudo pip install pybind11-stubgen
RUN --mount=type=cache,target=${HOME}/.cache,id=pip-${TARGETPLATFORM}-${CACHEID},uid=1000 \
<<HEREDOC
for PKG in state_representation dynamical_systems robot_model controllers; do
for PKG in state_representation dynamical_systems robot_model controllers clproto; do
python3 -c "import ${PKG}"
if [ $? -eq 0 ]; then
pybind11-stubgen $PKG -o ./stubs
mv ./stubs/$PKG ./stubs/$PKG-stubs
cat << EoF > ./stubs/setup.py
mkdir -p ./stubs-package/$PKG-stubs && find ./stubs -type f -name "*.pyi" -exec mv {} ./stubs-package/$PKG-stubs \;
cat << EoF > ./stubs-package/setup.py
from distutils.core import setup

import $PKG
Expand All @@ -165,8 +165,8 @@ setup(
packages=["$PKG-stubs"]
)
EoF
python3 -m pip install --prefix=/tmp/python ./stubs || exit 1
rm -r ./stubs
python3 -m pip install --prefix=/tmp/python ./stubs-package || exit 1
rm -r ./stubs*
fi
done
HEREDOC
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
7.1.5
7.1.6
2 changes: 1 addition & 1 deletion demos/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
add_compile_options(-Wall -Wextra -Wpedantic)
endif()

find_package(control_libraries 7.1.5 CONFIG REQUIRED)
find_package(control_libraries 7.1.6 CONFIG REQUIRED)

set(DEMOS_SCRIPTS
task_space_control_loop
Expand Down
2 changes: 1 addition & 1 deletion doxygen/doxygen.conf
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ PROJECT_NAME = "Control Libraries"
# could be handy for archiving the generated documentation or if some version
# control system is used.

PROJECT_NUMBER = 7.1.5
PROJECT_NUMBER = 7.1.6

# Using the PROJECT_BRIEF tag one can provide an optional one line description
# for a project that appears at the top of each page and should give viewer a
Expand Down
2 changes: 1 addition & 1 deletion protocol/clproto_cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
cmake_minimum_required(VERSION 3.15)

project(clproto VERSION 7.1.5)
project(clproto VERSION 7.1.6)

# Default to C99
if(NOT CMAKE_C_STANDARD)
Expand Down
2 changes: 1 addition & 1 deletion python/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
# names of the environment variables that define osqp and openrobots include directories
osqp_path_var = 'OSQP_INCLUDE_DIR'

__version__ = "7.1.5"
__version__ = "7.1.6"
__libraries__ = ['state_representation', 'clproto', 'controllers', 'dynamical_systems', 'robot_model']
__include_dirs__ = ['include']

Expand Down
2 changes: 1 addition & 1 deletion source/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
cmake_minimum_required(VERSION 3.15)

project(control_libraries VERSION 7.1.5)
project(control_libraries VERSION 7.1.6)

# Build options
option(BUILD_TESTING "Build all tests." OFF)
Expand Down

0 comments on commit 05408bc

Please sign in to comment.