Skip to content

Commit dbc7bdb

Browse files
committed
Release v0.3.1
2 parents e72b40b + fb0864d commit dbc7bdb

File tree

151 files changed

+3138
-2160
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

151 files changed

+3138
-2160
lines changed

.circleci/README.md

+1-2
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,7 @@ We have the following CI workflows in CirclCI.
66

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

1211
## release
1312

.circleci/config.yml

+151-96
Original file line numberDiff line numberDiff line change
@@ -1,111 +1,162 @@
1-
version: 2
1+
version: 2.1
2+
3+
# Use this orb install python dependences.
4+
orbs:
5+
python: circleci/[email protected]
6+
gh-pages: sugarshin/[email protected]
7+
8+
9+
commands:
10+
# For installing dep and building toppra C++ API
11+
build_cpp:
12+
description: "Install dependencies (C++) and build toppra C++ API"
13+
parameters:
14+
python-version:
15+
type: string
16+
default: "3.6"
17+
python-version-short:
18+
type: string
19+
default: "36"
20+
steps:
21+
- run:
22+
name: Install dependencies
23+
command: |
24+
echo "deb [arch=amd64] http://robotpkg.openrobots.org/packages/debian/pub $(lsb_release -sc) robotpkg" \
25+
| sudo tee /etc/apt/sources.list.d/robotpkg.list
26+
curl http://robotpkg.openrobots.org/packages/debian/robotpkg.key \
27+
| sudo apt-key add -
28+
sudo apt update
29+
sudo apt install -y cmake clang-tidy libeigen3-dev robotpkg-pinocchio robotpkg-qpoases libglpk-dev \
30+
robotpkg-py<< parameters.python-version-short >>-pinocchio \
31+
robotpkg-py<< parameters.python-version-short >>-example-robot-data
32+
33+
cd ~/ && git clone https://github.com/pybind/pybind11
34+
cd pybind11 && git checkout v2.5.0
35+
mkdir build && cd build && cmake -DPYBIND11_TEST=false .. && sudo make install
36+
37+
cd ~/ && git clone https://github.com/msgpack/msgpack-c.git
38+
cd msgpack-c && git checkout cpp-3.2.1 && cmake -DMSGPACK_CXX11=ON -DMSGPACK_BUILD_EXAMPLES=OFF -DMSGPACK_CXX_ONLY=ON .
39+
sudo make install
40+
41+
working_directory: ~/
42+
- run:
43+
name: Build toppra C++ API
44+
command: |
45+
export LD_LIBRARY_PATH=/opt/openrobots/lib:${LD_LIBRARY_PATH}
46+
export CMAKE_PREFIX_PATH=/opt/openrobots
47+
mkdir build && cd build && cmake \
48+
-DBUILD_WITH_PINOCCHIO=ON \
49+
-DBUILD_WITH_qpOASES=ON \
50+
-DBUILD_WITH_GLPK=ON \
51+
-DPYTHON_BINDINGS=ON \
52+
-DPYTHON_VERSION=<< parameters.python-version >> \
53+
-DBUILD_WITH_PINOCCHIO_PYTHON=true \
54+
-DOPT_MSGPACK=ON ..
55+
make -j4
56+
working_directory: ~/repo/cpp
257

358
jobs:
4-
check-codestyle:
59+
# Test the base python installation on multiple environments. In
60+
# addition, run lint task.
61+
python:
62+
parameters:
63+
python-version:
64+
type: string
65+
default: ""
66+
tox-base-cmd:
67+
type: string
68+
default: "py"
569
docker:
670
- image: hungpham2511/toppra-dep:0.0.3
771

872
working_directory: ~/repo
9-
1073
steps:
1174
- checkout
12-
- restore_cache:
13-
keys:
14-
- v1-dependencies3-{{ checksum "requirements3.txt" }}
1575
- run:
16-
name: install dependencies
76+
name: Run tests for python << parameters.python-version >>
1777
command: |
18-
python3 -m virtualenv --python python3 venv3 && . venv3/bin/activate
19-
pip install invoke pathlib2 numpy cython
20-
invoke install-solvers
21-
pip install -e .[dev]
22-
23-
- save_cache:
24-
paths:
25-
- ./venv3
26-
key: v1-dependencies3-{{ checksum "requirements3.txt" }}
78+
virtualenv --python python3.7 venv3 && . venv3/bin/activate
79+
pip install tox numpy cython # need numpy and cython to create the sdist
80+
tox -e << parameters.tox-base-cmd >><< parameters.python-version >>
2781
28-
- run:
29-
name: check codestyle
30-
command: |
31-
. venv3/bin/activate
32-
invoke lint || echo "allow failure"
82+
- store_test_results:
83+
path: test-results
3384

3485
- store_artifacts:
35-
path: test-reports
36-
destination: test-reports
86+
path: test-results
3787

38-
build-python-3:
88+
# Test the cpp api and bindings on python3.6 The base image of this
89+
# job is Ubuntu 18.04, which is required to install pinocchio and
90+
# other deps.
91+
cpp-python36:
92+
description: Build and test the full Python API
3993
docker:
40-
- image: hungpham2511/toppra-dep:0.0.3
41-
94+
- image: cimg/python:3.6
4295
working_directory: ~/repo
43-
4496
steps:
4597
- checkout
46-
47-
# Download and cache dependencies
48-
- restore_cache:
49-
keys:
50-
- v1-dependencies3-{{ checksum "requirements3.txt" }}
51-
98+
- build_cpp
5299
- run:
53-
name: install dependencies
100+
name: Unit tests (C++)
54101
command: |
55-
virtualenv --python python3.7 venv3 && . venv3/bin/activate
56-
pip install invoke pathlib2 numpy cython
102+
./tests/all_tests
103+
working_directory: ~/repo/cpp/build
104+
- run:
105+
name: Check codestyle (C++)
106+
command: |
107+
clang-tidy src/**/*.cpp \
108+
-checks=clang-analyzer-*,clang-analyzer-cplusplus*,cppcoreguidelines-*,performance-*,modernize-*,readability-,-cppcoreguidelines-pro-bounds-array-to-pointer-decay\
109+
-warnings-as-errors=clang-analyzer-*,clang-analyzer-cplusplus*,cppcoreguidelines-*,modernize-*
110+
working_directory: ~/repo/cpp
111+
- python/load-cache:
112+
dependency-file: requirements3.txt
113+
- python/install-deps:
114+
dependency-file: requirements3.txt
115+
- python/save-cache:
116+
dependency-file: requirements3.txt
117+
- run:
118+
name: Install Python API with bindings
119+
command: |
120+
pip install numpy cython invoke # absolute minimum to run setup.py
57121
invoke install-solvers
58122
pip install -e .[dev]
59123
60-
- save_cache:
61-
paths:
62-
- ./venv3
63-
key: v1-dependencies3-{{ checksum "requirements3.txt" }}
64-
65124
- run:
66-
name: test
125+
name: Test Python API with bindings
67126
command: |
68-
. venv3/bin/activate
69-
mkdir test-reports
70-
python --version
71-
python -m pytest -q tests --durations=3 --junitxml=test-reports/junit.xml
127+
export ROS_PACKAGE_PATH=/opt/openrobots/share
128+
export PYTHONPATH=/opt/openrobots/lib/python3.6/site-packages:$PYTHONPATH
129+
pytest tests --durations=3 --junitxml=test-reports/junit.xml
72130
73131
- store_test_results:
74132
path: test-reports
75133

76-
build-cpp:
77-
docker:
78-
- image: hungpham2511/toppra-dep:0.0.3
79-
80-
working_directory: ~/repo
81-
82-
steps:
83-
- checkout
84134
- run:
85-
name: dependencies
135+
name: Build docs
86136
command: |
87-
sudo apt install -y curl
88-
echo "deb [arch=amd64] http://robotpkg.openrobots.org/packages/debian/pub $(lsb_release -sc) robotpkg" \
89-
| sudo tee /etc/apt/sources.list.d/robotpkg.list
90-
curl http://robotpkg.openrobots.org/packages/debian/robotpkg.key \
91-
| sudo apt-key add -
92-
sudo apt update
93-
sudo apt install -y clang-tidy libeigen3-dev robotpkg-pinocchio robotpkg-qpoases libglpk-dev
137+
export ROS_PACKAGE_PATH=/opt/openrobots/share
138+
export PYTHONPATH=/opt/openrobots/lib/python3.6/site-packages:$PYTHONPATH
139+
pip install -r docs/requirements.txt
140+
invoke build-docs
94141
95-
- run:
96-
name: build
97-
command: |
98-
export LD_LIBRARY_PATH=/opt/openrobots/lib:${LD_LIBRARY_PATH}
99-
export CMAKE_PREFIX_PATH=/opt/openrobots
100-
mkdir build && cd build && cmake -DBUILD_WITH_PINOCCHIO=ON -DBUILD_WITH_qpOASES=ON -DBUILD_WITH_GLPK=ON ..
101-
make -j4
102-
working_directory: ~/repo/cpp
142+
- persist_to_workspace:
143+
root: .
144+
paths:
145+
- docs/build
103146

104-
- run:
105-
name: test
106-
command: |
107-
./tests/all_tests
108-
working_directory: ~/repo/cpp/build
147+
# Publishthe built doc from the last build step
148+
publish-docs:
149+
docker:
150+
- image: cimg/python:3.6
151+
working_directory: ~/repo
152+
steps:
153+
- checkout
154+
- attach_workspace:
155+
at: .
156+
- add_ssh_keys
157+
- gh-pages/deploy:
158+
ssh-fingerprints: "9f:09:37:d6:4a:48:0d:17:a7:c5:4a:5d:af:b5:fc:ab"
159+
build-dir: ./docs/build/html
109160

110161
pre-release:
111162
docker:
@@ -122,48 +173,52 @@ jobs:
122173
123174
release:
124175
docker:
125-
- image: buildpack-deps:trusty
176+
- image: cimg/python:3.6
126177
working_directory: ~/repo
127178
steps:
128179
- checkout
129180
- run:
130-
name: Tag code with the latest version in VERSION and push tag.
181+
name: Build distribution
131182
command: |
132-
VERSION=`cat VERSION`
133-
git fetch --tags
134-
git tag $VERSION
135-
git push origin $VERSION
183+
pip install cython numpy twine
184+
python setup.py sdist
185+
136186
- run:
137187
name: Publish to PyPI
138188
command: |
139-
echo "TODO"
189+
twine upload dist/* --username hungpham --password $PYPI_PASSWORD
140190
141191
workflows:
142192
version: 2
143193
integrate:
144194
jobs:
145-
- build-cpp
146-
- check-codestyle
147-
- build-python-3:
195+
- python:
196+
tox-base-cmd: "lint"
197+
- python:
198+
matrix:
199+
parameters:
200+
python-version: ["27", "36", "37"]
201+
202+
- cpp-python36
203+
- publish-docs:
148204
requires:
149-
- check-codestyle
150-
151-
release:
152-
jobs:
153-
- pre-release:
205+
- cpp-python36
154206
filters:
155207
branches:
156208
only:
157-
- fix-ci
158-
- /release-.*/
159-
160-
publish:
209+
- fix-doc
210+
- develop
211+
release:
161212
jobs:
162213
- release:
163214
filters:
164215
branches:
165216
only:
166217
- master
218+
- test-release
167219

168-
169-
220+
- pre-release:
221+
filters:
222+
branches:
223+
only:
224+
- /release-.*/

.github/workflows/main.yml

-35
This file was deleted.

.github/workflows/stale.yml

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: Mark stale issues and pull requests
2+
3+
on:
4+
schedule:
5+
- cron: "0 0 * * *"
6+
7+
jobs:
8+
stale:
9+
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- uses: actions/stale@v3
14+
with:
15+
repo-token: ${{ secrets.GITHUB_TOKEN }}
16+
stale-issue-message: 'Stale issue message'
17+
stale-pr-message: 'Stale pull request message'
18+
stale-issue-label: 'no-issue-activity'
19+
stale-pr-label: 'no-pr-activity'
20+
days-before-stale: 365
21+
days-before-close: 365

.pylintrc

+4-2
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,9 @@ disable=
142142
xrange-builtin,
143143
xreadlines-attribute,
144144
zip-builtin-not-iterating,
145-
bad-continuation
145+
bad-continuation,
146+
arguments-differ,
147+
super-with-arguments
146148

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

353355

354356
# Include a hint for the correct naming format with invalid-name

0 commit comments

Comments
 (0)