Skip to content

Commit

Permalink
Release v0.3.1
Browse files Browse the repository at this point in the history
  • Loading branch information
hungpham2511 committed Aug 23, 2020
2 parents e72b40b + fb0864d commit dbc7bdb
Show file tree
Hide file tree
Showing 151 changed files with 3,138 additions and 2,160 deletions.
3 changes: 1 addition & 2 deletions .circleci/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@ We have the following CI workflows in CirclCI.

The main workflow for new commits. The following jobs are done:
- Check project codestyle.
- Build and test toppra on Python 3.
- Build and test toppra (C++).
- Build and test toppra on Python 3 and the C++ API.

## release

Expand Down
247 changes: 151 additions & 96 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,111 +1,162 @@
version: 2
version: 2.1

# Use this orb install python dependences.
orbs:
python: circleci/[email protected]
gh-pages: sugarshin/[email protected]


commands:
# For installing dep and building toppra C++ API
build_cpp:
description: "Install dependencies (C++) and build toppra C++ API"
parameters:
python-version:
type: string
default: "3.6"
python-version-short:
type: string
default: "36"
steps:
- run:
name: Install dependencies
command: |
echo "deb [arch=amd64] http://robotpkg.openrobots.org/packages/debian/pub $(lsb_release -sc) robotpkg" \
| sudo tee /etc/apt/sources.list.d/robotpkg.list
curl http://robotpkg.openrobots.org/packages/debian/robotpkg.key \
| sudo apt-key add -
sudo apt update
sudo apt install -y cmake clang-tidy libeigen3-dev robotpkg-pinocchio robotpkg-qpoases libglpk-dev \
robotpkg-py<< parameters.python-version-short >>-pinocchio \
robotpkg-py<< parameters.python-version-short >>-example-robot-data
cd ~/ && git clone https://github.com/pybind/pybind11
cd pybind11 && git checkout v2.5.0
mkdir build && cd build && cmake -DPYBIND11_TEST=false .. && sudo make install
cd ~/ && git clone https://github.com/msgpack/msgpack-c.git
cd msgpack-c && git checkout cpp-3.2.1 && cmake -DMSGPACK_CXX11=ON -DMSGPACK_BUILD_EXAMPLES=OFF -DMSGPACK_CXX_ONLY=ON .
sudo make install
working_directory: ~/
- run:
name: Build toppra C++ API
command: |
export LD_LIBRARY_PATH=/opt/openrobots/lib:${LD_LIBRARY_PATH}
export CMAKE_PREFIX_PATH=/opt/openrobots
mkdir build && cd build && cmake \
-DBUILD_WITH_PINOCCHIO=ON \
-DBUILD_WITH_qpOASES=ON \
-DBUILD_WITH_GLPK=ON \
-DPYTHON_BINDINGS=ON \
-DPYTHON_VERSION=<< parameters.python-version >> \
-DBUILD_WITH_PINOCCHIO_PYTHON=true \
-DOPT_MSGPACK=ON ..
make -j4
working_directory: ~/repo/cpp

jobs:
check-codestyle:
# Test the base python installation on multiple environments. In
# addition, run lint task.
python:
parameters:
python-version:
type: string
default: ""
tox-base-cmd:
type: string
default: "py"
docker:
- image: hungpham2511/toppra-dep:0.0.3

working_directory: ~/repo

steps:
- checkout
- restore_cache:
keys:
- v1-dependencies3-{{ checksum "requirements3.txt" }}
- run:
name: install dependencies
name: Run tests for python << parameters.python-version >>
command: |
python3 -m virtualenv --python python3 venv3 && . venv3/bin/activate
pip install invoke pathlib2 numpy cython
invoke install-solvers
pip install -e .[dev]
- save_cache:
paths:
- ./venv3
key: v1-dependencies3-{{ checksum "requirements3.txt" }}
virtualenv --python python3.7 venv3 && . venv3/bin/activate
pip install tox numpy cython # need numpy and cython to create the sdist
tox -e << parameters.tox-base-cmd >><< parameters.python-version >>
- run:
name: check codestyle
command: |
. venv3/bin/activate
invoke lint || echo "allow failure"
- store_test_results:
path: test-results

- store_artifacts:
path: test-reports
destination: test-reports
path: test-results

build-python-3:
# Test the cpp api and bindings on python3.6 The base image of this
# job is Ubuntu 18.04, which is required to install pinocchio and
# other deps.
cpp-python36:
description: Build and test the full Python API
docker:
- image: hungpham2511/toppra-dep:0.0.3

- image: cimg/python:3.6
working_directory: ~/repo

steps:
- checkout

# Download and cache dependencies
- restore_cache:
keys:
- v1-dependencies3-{{ checksum "requirements3.txt" }}

- build_cpp
- run:
name: install dependencies
name: Unit tests (C++)
command: |
virtualenv --python python3.7 venv3 && . venv3/bin/activate
pip install invoke pathlib2 numpy cython
./tests/all_tests
working_directory: ~/repo/cpp/build
- run:
name: Check codestyle (C++)
command: |
clang-tidy src/**/*.cpp \
-checks=clang-analyzer-*,clang-analyzer-cplusplus*,cppcoreguidelines-*,performance-*,modernize-*,readability-,-cppcoreguidelines-pro-bounds-array-to-pointer-decay\
-warnings-as-errors=clang-analyzer-*,clang-analyzer-cplusplus*,cppcoreguidelines-*,modernize-*
working_directory: ~/repo/cpp
- python/load-cache:
dependency-file: requirements3.txt
- python/install-deps:
dependency-file: requirements3.txt
- python/save-cache:
dependency-file: requirements3.txt
- run:
name: Install Python API with bindings
command: |
pip install numpy cython invoke # absolute minimum to run setup.py
invoke install-solvers
pip install -e .[dev]
- save_cache:
paths:
- ./venv3
key: v1-dependencies3-{{ checksum "requirements3.txt" }}

- run:
name: test
name: Test Python API with bindings
command: |
. venv3/bin/activate
mkdir test-reports
python --version
python -m pytest -q tests --durations=3 --junitxml=test-reports/junit.xml
export ROS_PACKAGE_PATH=/opt/openrobots/share
export PYTHONPATH=/opt/openrobots/lib/python3.6/site-packages:$PYTHONPATH
pytest tests --durations=3 --junitxml=test-reports/junit.xml
- store_test_results:
path: test-reports

build-cpp:
docker:
- image: hungpham2511/toppra-dep:0.0.3

working_directory: ~/repo

steps:
- checkout
- run:
name: dependencies
name: Build docs
command: |
sudo apt install -y curl
echo "deb [arch=amd64] http://robotpkg.openrobots.org/packages/debian/pub $(lsb_release -sc) robotpkg" \
| sudo tee /etc/apt/sources.list.d/robotpkg.list
curl http://robotpkg.openrobots.org/packages/debian/robotpkg.key \
| sudo apt-key add -
sudo apt update
sudo apt install -y clang-tidy libeigen3-dev robotpkg-pinocchio robotpkg-qpoases libglpk-dev
export ROS_PACKAGE_PATH=/opt/openrobots/share
export PYTHONPATH=/opt/openrobots/lib/python3.6/site-packages:$PYTHONPATH
pip install -r docs/requirements.txt
invoke build-docs
- run:
name: build
command: |
export LD_LIBRARY_PATH=/opt/openrobots/lib:${LD_LIBRARY_PATH}
export CMAKE_PREFIX_PATH=/opt/openrobots
mkdir build && cd build && cmake -DBUILD_WITH_PINOCCHIO=ON -DBUILD_WITH_qpOASES=ON -DBUILD_WITH_GLPK=ON ..
make -j4
working_directory: ~/repo/cpp
- persist_to_workspace:
root: .
paths:
- docs/build

- run:
name: test
command: |
./tests/all_tests
working_directory: ~/repo/cpp/build
# Publishthe built doc from the last build step
publish-docs:
docker:
- image: cimg/python:3.6
working_directory: ~/repo
steps:
- checkout
- attach_workspace:
at: .
- add_ssh_keys
- gh-pages/deploy:
ssh-fingerprints: "9f:09:37:d6:4a:48:0d:17:a7:c5:4a:5d:af:b5:fc:ab"
build-dir: ./docs/build/html

pre-release:
docker:
Expand All @@ -122,48 +173,52 @@ jobs:
release:
docker:
- image: buildpack-deps:trusty
- image: cimg/python:3.6
working_directory: ~/repo
steps:
- checkout
- run:
name: Tag code with the latest version in VERSION and push tag.
name: Build distribution
command: |
VERSION=`cat VERSION`
git fetch --tags
git tag $VERSION
git push origin $VERSION
pip install cython numpy twine
python setup.py sdist
- run:
name: Publish to PyPI
command: |
echo "TODO"
twine upload dist/* --username hungpham --password $PYPI_PASSWORD
workflows:
version: 2
integrate:
jobs:
- build-cpp
- check-codestyle
- build-python-3:
- python:
tox-base-cmd: "lint"
- python:
matrix:
parameters:
python-version: ["27", "36", "37"]

- cpp-python36
- publish-docs:
requires:
- check-codestyle

release:
jobs:
- pre-release:
- cpp-python36
filters:
branches:
only:
- fix-ci
- /release-.*/

publish:
- fix-doc
- develop
release:
jobs:
- release:
filters:
branches:
only:
- master
- test-release



- pre-release:
filters:
branches:
only:
- /release-.*/
35 changes: 0 additions & 35 deletions .github/workflows/main.yml

This file was deleted.

21 changes: 21 additions & 0 deletions .github/workflows/stale.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Mark stale issues and pull requests

on:
schedule:
- cron: "0 0 * * *"

jobs:
stale:

runs-on: ubuntu-latest

steps:
- uses: actions/stale@v3
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
stale-issue-message: 'Stale issue message'
stale-pr-message: 'Stale pull request message'
stale-issue-label: 'no-issue-activity'
stale-pr-label: 'no-pr-activity'
days-before-stale: 365
days-before-close: 365
6 changes: 4 additions & 2 deletions .pylintrc
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,9 @@ disable=
xrange-builtin,
xreadlines-attribute,
zip-builtin-not-iterating,
bad-continuation
bad-continuation,
arguments-differ,
super-with-arguments

# Enable the message, report, category or checker with the given id(s). You can
# either give multiple identifier separated by comma (,) or put this option
Expand Down Expand Up @@ -348,7 +350,7 @@ good-names=i,
x, y, z, s, dt, F, g, a, b, c,
N, ds, q, qd, qdd, qddd, qs, qss, qsss,
us, xs, vs, # special toppra-specific variables
constraint_F, F_vec
constraint_F, F_vec, ts, us, ss, t


# Include a hint for the correct naming format with invalid-name
Expand Down
Loading

0 comments on commit dbc7bdb

Please sign in to comment.