Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nested merged #5

Merged
merged 48 commits into from
Feb 17, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
cf95bf7
fixed install. improved tests by moving to pytest.
asmodehn Feb 22, 2017
c21ce0c
cleaning up test for time messages.
asmodehn Feb 23, 2017
eb0721b
Merge branch 'master' into hypothesis
asmodehn Mar 17, 2017
c87ca8a
adding first hypothesis tests. fixed time and duration field classes.
asmodehn Mar 17, 2017
ba235a5
fixing test_schema
asmodehn Mar 17, 2017
357e6b6
added hypothesis test for std schemas. removed unused time fields mod…
asmodehn Mar 20, 2017
7807824
fixed some time tests, added hypothesis requirement
asmodehn Mar 27, 2017
4e05d9f
WIP adding tests for optional fields
asmodehn Mar 29, 2017
1305523
fixed hypothesis tests
asmodehn Mar 31, 2017
5580049
moved hypothesis tests inside package
asmodehn Mar 31, 2017
a135ba3
fixing dependencies and travis install test check.
asmodehn Mar 31, 2017
0e020ac
fixing travis to use ros-shadow-fixed repos
asmodehn Mar 31, 2017
af85112
migrated to catkin_pip + pytests.
asmodehn May 16, 2017
ba5a4bc
adding nested test messages. fixing existing tests.
asmodehn May 16, 2017
7ca442c
adding catkin_pip dependency
asmodehn May 16, 2017
625f233
removing roslint build requirement
asmodehn May 16, 2017
4a8e395
fixing travis install tests
asmodehn May 16, 2017
4ecb870
adding dependency on pyros_msgs
asmodehn May 16, 2017
2603f85
Merge branch 'hypothesis' into nested_merged
asmodehn Jun 15, 2017
918213f
handle case where we get a list to change into a ROSmsg...
asmodehn Jul 7, 2017
ed11ea5
making basic and opt_as_array tests pass.
asmodehn Jul 18, 2017
b84cd2a
adding files for python package structure.
asmodehn Aug 31, 2017
777ab4d
fixing test environments with travis and tox
asmodehn Aug 31, 2017
8a50308
moving tests outside of package and fixing tox
asmodehn Aug 31, 2017
44b1cee
no need for pyros-setup in tests now, we rely on venv only.
asmodehn Aug 31, 2017
5e4a0b9
cleanup settings and now using hypothesis profiles
asmodehn Sep 1, 2017
0978d59
moving hypothesis profiles into pytest conftest.
asmodehn Sep 1, 2017
e3c4dcd
setting hypothesis profile in function to not break at import time.
asmodehn Sep 1, 2017
d10a505
registering hypothesis profile earlier, at import time.
asmodehn Sep 1, 2017
116f583
Merge pull request #6 from asmodehn/pymutate
asmodehn Sep 4, 2017
892b36b
added README comments about CI, tests and PR merges.
asmodehn Feb 7, 2018
d1dcb81
fixing CMakeLists for tests
asmodehn Feb 7, 2018
423be75
fixing travis link in README
asmodehn Feb 7, 2018
b69612a
fixing hypothesis options for travis test profile
asmodehn Feb 13, 2018
93a5251
fixing python3 iteritems
asmodehn Feb 14, 2018
36bdcd7
improving tests and CI
asmodehn Feb 15, 2018
da534c6
attempting tox params depending on ros distro
asmodehn Feb 15, 2018
48cf25f
fixing tox params for travis, adding pyup settings
asmodehn Feb 15, 2018
379d2fe
fixing excluded envs for travis
asmodehn Feb 15, 2018
7efcda5
adding README badges following pyros-msgs example
asmodehn Feb 15, 2018
b8ccee6
removing old pyros-msgs branch in requirements
asmodehn Feb 17, 2018
92db728
restructuring tests to make data generation faster
asmodehn Feb 17, 2018
36a9262
removing pyros-msgs repo from requirements
asmodehn Feb 17, 2018
f60fced
disabling currently failing py3 tests and adding comment bout it.
asmodehn Feb 17, 2018
0a81256
Merge pull request #12 from pyros-dev/refactoring_tests
asmodehn Feb 17, 2018
7929815
incrementing version number, preparing for python release
asmodehn Feb 17, 2018
d775f98
removed duplicated version module
asmodehn Feb 17, 2018
f825540
changing pyup update schedule
asmodehn Feb 17, 2018
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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