Skip to content

Commit

Permalink
Merge pull request #5 from pyros-dev/nested_merged
Browse files Browse the repository at this point in the history
Nested merged
  • Loading branch information
asmodehn authored Feb 17, 2018
2 parents 9e3debe + f825540 commit 5c6b839
Show file tree
Hide file tree
Showing 83 changed files with 2,788 additions and 1,297 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
*.pyc
build
.tox
.hypothesis
.cache
6 changes: 6 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[submodule "tests/rosdeps/std_msgs"]
path = tests/rosdeps/std_msgs
url = https://github.com/ros/std_msgs.git
[submodule "tests/rosdeps/ros_comm_msgs"]
path = tests/rosdeps/ros_comm_msgs
url = https://github.com/ros/ros_comm_msgs.git
93 changes: 93 additions & 0 deletions .pyup.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
# configure updates globally
# default: all
# allowed: all, insecure, False
update: all

# configure dependency pinning globally
# default: True
# allowed: True, False
pin: True

# set the default branch
# default: empty, the default branch on GitHub
branch: master

# update schedule
# default: empty
# allowed: "every day", "every week", ..
schedule: "every week"

# search for requirement files
# default: True
# allowed: True, False
search: False

# Specify requirement files by hand, default is empty
# default: empty
# allowed: list
requirements:
# These need to be manually pinned to match ROS distros versions
- requirements/indigo/debs_in_venv.txt:
# don't update dependencies, don't try to auto pin
update: False
pin: False
- requirements/kinetic/debs_in_venv.txt:
# don't update dependencies, don't try to auto pin
update: False
pin: False
- requirements/lunar/debs_in_venv.txt:
# don't update dependencies, don't try to auto pin
update: False
pin: False

- requirements/python/indigo.txt:
# don't update dependencies, don't try to auto pin
update: False
pin: False
- requirements/python/kinetic.txt:
# don't update dependencies, don't try to auto pin
update: False
pin: False
- requirements/python/lunar.txt:
# don't update dependencies, don't try to auto pin
update: False
pin: False

- requirements/python/latest.txt:
# don't update dependencies, use global 'pin' default
update: all

- requirements/python/tests.txt:
# update all dependencies, use global 'pin' default
update: all

- requirements/tools.txt:
# update all dependencies, don't pin
update: all
pin: False


# TODO : review tests nd default values after ROS things are out of the python repo

# add a label to pull requests, default is not set
# requires private repo permissions, even on public repos
# default: empty
label_prs: update

# assign users to pull requests, default is not set
# requires private repo permissions, even on public repos
# default: empty
assignees:
- asmodehn

# configure the branch prefix the bot is using
# default: pyup-
branch_prefix: pyup/

# set a global prefix for PRs
# default: empty
#pr_prefix: "Bug #12345"

# allow to close stale PRs
# default: True
#close_prs: True
84 changes: 37 additions & 47 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,61 +1,51 @@
sudo: required
language: generic
services:
- docker
language: python

branches:
except:
- gh-pages
- gh-pages

env:
global:
- CONTAINER_NAME=pyros_msgs_docker
# This will check any ROS distro supported on this OS
# checking devel and install separately so that they don't influence each other (dependencies, path, env, etc.)
matrix:
- ROS_DISTRO=indigo ROS_FLOW=devel
- ROS_DISTRO=indigo ROS_FLOW=install
# These will be used to determine the proper version of our dependencies
# We will NOT rely on a full ROS installation.
- ROS_DISTRO=indigo
- ROS_DISTRO=kinetic TOX_PARAMS="--hypothesis-profile travis"
# Latest not LTS
- ROS_DISTRO=lunar TOX_PARAMS="--hypothesis-profile travis"
# to get latest dependencies (not released in a ROS distro yet)
- ROS_DISTRO=latest TOX_PARAMS="--hypothesis-profile travis"

python:
# always test python2 (default supported python version for ROS1)
- 2.7
# always test latest python3 (to guarantee recent python support)
# TODO - 3.6
#- pypy
#- pypy3

# Add specific python3 versions
matrix:
include:
# explicitely matching python version to the version on the ubuntu distro supported by the ROS LTS distro
#TODO - python: 3.4
# env: ROS_DISTRO=indigo
#TODO - python: 3.5
# env: ROS_DISTRO=kinetic TOX_PARAMS="--hypothesis-profile travis"
exclude:
# explicitely exclude python3 version not supported by matching linux distro
- python: 3.6
env: ROS_DISTRO=indigo
- python: 3.6
env: ROS_DISTRO=kinetic TOX_PARAMS="--hypothesis-profile travis"

- ROS_DISTRO=jade ROS_FLOW=devel
- ROS_DISTRO=jade ROS_FLOW=install

- ROS_DISTRO=kinetic ROS_FLOW=devel
- ROS_DISTRO=kinetic ROS_FLOW=install

before_install:
# Getting docker ros image
- docker pull ros:${ROS_DISTRO}-ros-core
# Running as daemon
- docker run --name ${CONTAINER_NAME} -d -t ros:${ROS_DISTRO}-ros-core /bin/bash | tee container.id
# Checking current container
- docker ps -a
- docker exec -ti ${CONTAINER_NAME} hostname
- docker exec -ti ${CONTAINER_NAME} uname -a
- docker exec -ti ${CONTAINER_NAME} cat /etc/lsb-release

install:
# refreshing packages
- docker exec -ti ${CONTAINER_NAME} apt-get update
# TMP Patch because rosdep doesnt declare a dependency to sudo yet (2016-08-25) and it doesnt come with xenial
- docker exec -ti ${CONTAINER_NAME} apt-get install sudo -y
# TMP Patch because catkin doesnt declare a dependency to gcc yet (2016-09-02) and it doesnt come in ros image
- docker exec -ti ${CONTAINER_NAME} apt-get install build-essential -y

# refreshing rosdep
- docker exec -ti ${CONTAINER_NAME} rosdep update
# copying local clone to the running container (volume is currently broken)
- docker cp . ${CONTAINER_NAME}:/git_clone
# Installing package dependencies
- docker exec -ti ${CONTAINER_NAME} rosdep install --default-yes --from-paths /git_clone --rosdistro $ROS_DISTRO

# full ROS setup, build and test
- pip install tox tox-travis

script:
- CONTAINER_ID=$(cat container.id)
- docker ps -a
- docker exec -ti ${CONTAINER_NAME} /bin/bash -c "source /opt/ros/$ROS_DISTRO/setup.bash && rospack profile"
# Passing env vars here since passing in docker run currently breaks (2016-08-25)
- docker exec -ti ${CONTAINER_NAME} /bin/bash -c "export ROS_DISTRO=$ROS_DISTRO && export ROS_FLOW=$ROS_FLOW && bash /git_clone/travis_checks.bash"
- docker stop "${CONTAINER_ID}"
- tox -- $TOX_PARAMS

notifications:
email: false

17 changes: 3 additions & 14 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,33 +10,22 @@ project(pyros_schemas)
##############################################################################

find_package(catkin REQUIRED COMPONENTS
roslint
catkin_pip
std_msgs
)


catkin_python_setup()


# Lint Python modules
file(GLOB_RECURSE ${PROJECT_NAME}_PY_SRCS
RELATIVE ${PROJECT_SOURCE_DIR} pyros_schemas/*.py)
roslint_python(${${PROJECT_NAME}_PY_SRCS})



##############################################################################
# Catkin
##############################################################################

catkin_package()
catkin_pip_package(pyros_schemas)

#########
# Tests
#######

if (CATKIN_ENABLE_TESTING)
catkin_add_nosetests(pyros_schemas/ros/tests)
catkin_add_pytests(tests/test_pyros_schemas)
endif()


7 changes: 7 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# default
include README.rst
include setup.py

# including tests in sdist
recursive-include tests *
recursive-exclude tests/.hypothesis *
41 changes: 41 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
|Build Status| |Code Health| |Pyup Updates| |Pyup Py3|

Pyros-schemas
=============

Package implementing serialization for Pyros multiprocess systems.

Features
--------

ROS
~~~

- serializes everything as a dict, flatten base field types if possible.


.. |Build Status| image:: https://travis-ci.org/pyros-dev/pyros-schemas.svg?branch=master
:target: https://travis-ci.org/pyros-dev/pyros-schemas
:alt: Build Status

.. |Code Health| image:: https://landscape.io/github/pyros-dev/pyros-schemas/master/landscape.svg?style=flat
:target: https://landscape.io/github/pyros-dev/pyros-schemas/master
:alt: Code Health

.. |Pyup Updates| image:: https://pyup.io/repos/github/pyros-dev/pyros-schemas/shield.svg
:target: https://pyup.io/repos/github/pyros-dev/pyros-schemas/
:alt: Updates

.. |Pyup Py3| image:: https://pyup.io/repos/github/pyros-dev/pyros-schemas/python-3-shield.svg
:target: https://pyup.io/repos/github/pyros-dev/pyros-schemas/
:alt: Python 3

Testing
-------

1) make sure you have downloaded the submodules (ros message definitions)
2) check `tox -l` to list the test environments
3) choose the tests matching your platform and run them

The tests are also run on travis, so any pull request need to have tests failing at first ( create test to illustrate the problem if needed).
Then add commits to fix the broken tests, and all must pass before merging.
17 changes: 9 additions & 8 deletions package.xml
Original file line number Diff line number Diff line change
@@ -1,30 +1,31 @@
<?xml version="1.0"?>
<package format="2">
<name>pyros_schemas</name>
<version>0.0.1</version>
<version>0.0.2</version>
<description>
Pyros messages and services definition
Pyros serialization
</description>

<author>AlexV</author>
<maintainer email="[email protected]">AlexV</maintainer>
<license>BSD</license>

<url type="website">http://www.ros.org/wiki/rocon_tools</url>
<url type="repository">https://bitbucket.org/yujinrobot/gopher_common</url>
<url type="bugtracker">https://bitbucket.org/yujinrobot/gopher_common/issues</url>
<url type="repository">https://bitbucket.org/yujinrobot/gopher_schemas</url>
<url type="bugtracker">https://bitbucket.org/yujinrobot/gopher_schemas/issues</url>

<buildtool_depend version_gte="0.6.18">catkin</buildtool_depend>
<buildtool_depend version_gte="0.2.0">catkin_pip</buildtool_depend>

<depend version_gte="1.5.2">python-six</depend>
<depend version_gte="1.11.19">rospy</depend>
<depend version_gte="0.5.9">std_msgs</depend>
<depend version_gte="2.9.1">marshmallow</depend>
<depend version_gte="0.1.1">pyros_msgs</depend>

<build_depend version_gte="0.10.0">roslint</build_depend>
<build_depend version_gte="0.2.10">message_generation</build_depend>

<exec_depend version_gte="0.4.12">message_runtime</exec_depend>
<!-- we depend on these here just because we embed tests inside the package -->
<depend version_gte="2.8.0">python-pytest</depend> <!-- version based on hypothesis requirements but trusty only has 2.5.1, which seems to work anyway... -->
<depend version_gte="3.0.1">hypothesis</depend> <!-- backport as rospackage for indigo and jade, but system package from xenial -->

<!-- documentation dependencies -->
<doc_depend version_gte="0.2.10">python-catkin-pkg</doc_depend>
Expand Down
7 changes: 3 additions & 4 deletions pyros_schemas/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
from __future__ import absolute_import
from __future__ import print_function
from __future__ import absolute_import, print_function

# try:
# import std_msgs
Expand Down Expand Up @@ -34,8 +33,8 @@
'RosUInt8', 'RosUInt16', 'RosUInt32', 'RosUInt64',
'RosFloat32', 'RosFloat64',
'RosString', 'RosTextString',
'RosTime',
'RosDuration',
'RosTimeVerbatim',
'RosDurationVerbatim',
'RosOpt',
'RosNested',
'RosList',
Expand Down
6 changes: 6 additions & 0 deletions pyros_schemas/_version.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Store the version here so:
# 1) we don't load dependencies by storing it in __init__.py
# 2) we can import it in setup.py for the same reason
# 3) we can import it into your module module
__version_info__ = ('0', '1', '0')
__version__ = '.'.join(__version_info__)
12 changes: 8 additions & 4 deletions pyros_schemas/ros/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
RosFloat32, RosFloat64,
RosString,
RosTextString,
RosTime,
RosDuration,
RosNested,
RosList,
)
Expand All @@ -25,11 +27,13 @@
RosMsgString,
)

from .time_fields import (
RosTime, RosTimeVerbatim,
RosDuration, RosDurationVerbatim,
)
# from .time_fields import (
# # RosTime,
# RosDuration,
# )

from .schemagic import create

from .decorators import with_service_schemas # useful for direct import even if not included in __all__

from .types_mapping import ros_msgtype_mapping, ros_pythontype_mapping
Loading

0 comments on commit 5c6b839

Please sign in to comment.