From a44105290c46f26cad2790437319fbf443df761a Mon Sep 17 00:00:00 2001 From: alexv Date: Thu, 27 Jul 2017 18:34:29 +0900 Subject: [PATCH] restructuring to extract tests, fix package dist, replace ros submodules with pips --- .gitignore | 5 +++++ .gitmodules | 14 ++++--------- MANIFEST.in | 3 +++ dev-requirements.txt | 19 ++++++++++------- msg | 1 + pyros_msgs/__init__.py | 15 ------------- {msg => pyros_msgs/msg}/OptionalFields.msg | 0 pyros_msgs/opt_as_nested/opt_as_nested.py | 4 ---- pyros_msgs/typecheck/ros_mappings.py | 2 +- ros-site/README.md | 6 ------ ros-site/genmsg.pth | 1 - ros-site/genpy.pth | 1 - rosdeps/genmsg | 1 - rosdeps/genpy | 1 - setup.py | 2 +- tests/opt_as_array/__init__.py | 21 ------------------- tests/opt_as_nested/__init__.py | 21 ------------------- {rosdeps => tests/rosdeps}/ros_comm_msgs | 0 {rosdeps => tests/rosdeps}/std_msgs | 0 tests/{ => test_pyros_msgs}/__init__.py | 0 .../test_pyros_msgs/opt_as_array/__init__.py | 17 +++++++++++++++ .../msg/test_opt_bool_as_array.msg | 0 .../msg/test_opt_duration_as_array.msg | 0 .../msg/test_opt_float32_as_array.msg | 0 .../msg/test_opt_float64_as_array.msg | 0 .../msg/test_opt_header_as_array.msg | 0 .../msg/test_opt_int16_as_array.msg | 0 .../msg/test_opt_int32_as_array.msg | 0 .../msg/test_opt_int64_as_array.msg | 0 .../msg/test_opt_int8_as_array.msg | 0 .../msg/test_opt_std_empty_as_array.msg | 0 .../msg/test_opt_string_as_array.msg | 0 .../msg/test_opt_time_as_array.msg | 0 .../msg/test_opt_uint16_as_array.msg | 0 .../msg/test_opt_uint32_as_array.msg | 0 .../msg/test_opt_uint64_as_array.msg | 0 .../msg/test_opt_uint8_as_array.msg | 0 .../opt_as_array/test_opt_bool.py | 0 .../opt_as_array/test_opt_duration.py | 0 .../opt_as_array/test_opt_int16.py | 0 .../opt_as_array/test_opt_int32.py | 0 .../opt_as_array/test_opt_int64.py | 0 .../opt_as_array/test_opt_int8.py | 0 .../opt_as_array/test_opt_std_empty.py | 0 .../opt_as_array/test_opt_string.py | 0 .../opt_as_array/test_opt_time.py | 0 .../opt_as_array/test_opt_uint16.py | 0 .../opt_as_array/test_opt_uint32.py | 0 .../opt_as_array/test_opt_uint64.py | 0 .../opt_as_array/test_opt_uint8.py | 0 .../test_pyros_msgs/opt_as_nested/__init__.py | 14 +++++++++++++ .../msg/test_opt_bool_as_nested.msg | 0 .../msg/test_opt_duration_as_nested.msg | 0 .../msg/test_opt_int16_as_nested.msg | 0 .../msg/test_opt_int32_as_nested.msg | 0 .../msg/test_opt_int64_as_nested.msg | 0 .../msg/test_opt_int8_as_nested.msg | 0 .../msg/test_opt_std_empty_as_nested.msg | 0 .../msg/test_opt_string_as_nested.msg | 0 .../msg/test_opt_time_as_nested.msg | 0 .../msg/test_opt_uint16_as_nested.msg | 0 .../msg/test_opt_uint32_as_nested.msg | 0 .../msg/test_opt_uint64_as_nested.msg | 0 .../msg/test_opt_uint8_as_nested.msg | 0 .../opt_as_nested/test_opt_bool.py | 0 .../opt_as_nested/test_opt_duration.py | 0 .../opt_as_nested/test_opt_int16.py | 0 .../opt_as_nested/test_opt_int32.py | 0 .../opt_as_nested/test_opt_int64.py | 0 .../opt_as_nested/test_opt_int8.py | 0 .../opt_as_nested/test_opt_std_empty.py | 0 .../opt_as_nested/test_opt_string.py | 0 .../opt_as_nested/test_opt_time.py | 0 .../opt_as_nested/test_opt_uint16.py | 0 .../opt_as_nested/test_opt_uint32.py | 0 .../opt_as_nested/test_opt_uint64.py | 0 .../opt_as_nested/test_opt_uint8.py | 0 .../typecheck/__init__.py | 10 --------- .../typecheck/test_basic_ros_serialization.py | 0 .../typecheck/test_ros_mappings.py | 0 .../typecheck/test_typechecker_arrays.py | 0 .../typecheck/test_typechecker_basic.py | 0 .../typecheck/test_typechecker_nested.py | 0 tox.ini | 12 +++++------ 84 files changed, 63 insertions(+), 107 deletions(-) create mode 100644 MANIFEST.in create mode 120000 msg rename {msg => pyros_msgs/msg}/OptionalFields.msg (100%) delete mode 100644 ros-site/README.md delete mode 100644 ros-site/genmsg.pth delete mode 100644 ros-site/genpy.pth delete mode 160000 rosdeps/genmsg delete mode 160000 rosdeps/genpy delete mode 100644 tests/opt_as_array/__init__.py delete mode 100644 tests/opt_as_nested/__init__.py rename {rosdeps => tests/rosdeps}/ros_comm_msgs (100%) rename {rosdeps => tests/rosdeps}/std_msgs (100%) rename tests/{ => test_pyros_msgs}/__init__.py (100%) create mode 100644 tests/test_pyros_msgs/opt_as_array/__init__.py rename tests/{ => test_pyros_msgs}/opt_as_array/msg/test_opt_bool_as_array.msg (100%) rename tests/{ => test_pyros_msgs}/opt_as_array/msg/test_opt_duration_as_array.msg (100%) rename tests/{ => test_pyros_msgs}/opt_as_array/msg/test_opt_float32_as_array.msg (100%) rename tests/{ => test_pyros_msgs}/opt_as_array/msg/test_opt_float64_as_array.msg (100%) rename tests/{ => test_pyros_msgs}/opt_as_array/msg/test_opt_header_as_array.msg (100%) rename tests/{ => test_pyros_msgs}/opt_as_array/msg/test_opt_int16_as_array.msg (100%) rename tests/{ => test_pyros_msgs}/opt_as_array/msg/test_opt_int32_as_array.msg (100%) rename tests/{ => test_pyros_msgs}/opt_as_array/msg/test_opt_int64_as_array.msg (100%) rename tests/{ => test_pyros_msgs}/opt_as_array/msg/test_opt_int8_as_array.msg (100%) rename tests/{ => test_pyros_msgs}/opt_as_array/msg/test_opt_std_empty_as_array.msg (100%) rename tests/{ => test_pyros_msgs}/opt_as_array/msg/test_opt_string_as_array.msg (100%) rename tests/{ => test_pyros_msgs}/opt_as_array/msg/test_opt_time_as_array.msg (100%) rename tests/{ => test_pyros_msgs}/opt_as_array/msg/test_opt_uint16_as_array.msg (100%) rename tests/{ => test_pyros_msgs}/opt_as_array/msg/test_opt_uint32_as_array.msg (100%) rename tests/{ => test_pyros_msgs}/opt_as_array/msg/test_opt_uint64_as_array.msg (100%) rename tests/{ => test_pyros_msgs}/opt_as_array/msg/test_opt_uint8_as_array.msg (100%) rename tests/{ => test_pyros_msgs}/opt_as_array/test_opt_bool.py (100%) rename tests/{ => test_pyros_msgs}/opt_as_array/test_opt_duration.py (100%) rename tests/{ => test_pyros_msgs}/opt_as_array/test_opt_int16.py (100%) rename tests/{ => test_pyros_msgs}/opt_as_array/test_opt_int32.py (100%) rename tests/{ => test_pyros_msgs}/opt_as_array/test_opt_int64.py (100%) rename tests/{ => test_pyros_msgs}/opt_as_array/test_opt_int8.py (100%) rename tests/{ => test_pyros_msgs}/opt_as_array/test_opt_std_empty.py (100%) rename tests/{ => test_pyros_msgs}/opt_as_array/test_opt_string.py (100%) rename tests/{ => test_pyros_msgs}/opt_as_array/test_opt_time.py (100%) rename tests/{ => test_pyros_msgs}/opt_as_array/test_opt_uint16.py (100%) rename tests/{ => test_pyros_msgs}/opt_as_array/test_opt_uint32.py (100%) rename tests/{ => test_pyros_msgs}/opt_as_array/test_opt_uint64.py (100%) rename tests/{ => test_pyros_msgs}/opt_as_array/test_opt_uint8.py (100%) create mode 100644 tests/test_pyros_msgs/opt_as_nested/__init__.py rename tests/{ => test_pyros_msgs}/opt_as_nested/msg/test_opt_bool_as_nested.msg (100%) rename tests/{ => test_pyros_msgs}/opt_as_nested/msg/test_opt_duration_as_nested.msg (100%) rename tests/{ => test_pyros_msgs}/opt_as_nested/msg/test_opt_int16_as_nested.msg (100%) rename tests/{ => test_pyros_msgs}/opt_as_nested/msg/test_opt_int32_as_nested.msg (100%) rename tests/{ => test_pyros_msgs}/opt_as_nested/msg/test_opt_int64_as_nested.msg (100%) rename tests/{ => test_pyros_msgs}/opt_as_nested/msg/test_opt_int8_as_nested.msg (100%) rename tests/{ => test_pyros_msgs}/opt_as_nested/msg/test_opt_std_empty_as_nested.msg (100%) rename tests/{ => test_pyros_msgs}/opt_as_nested/msg/test_opt_string_as_nested.msg (100%) rename tests/{ => test_pyros_msgs}/opt_as_nested/msg/test_opt_time_as_nested.msg (100%) rename tests/{ => test_pyros_msgs}/opt_as_nested/msg/test_opt_uint16_as_nested.msg (100%) rename tests/{ => test_pyros_msgs}/opt_as_nested/msg/test_opt_uint32_as_nested.msg (100%) rename tests/{ => test_pyros_msgs}/opt_as_nested/msg/test_opt_uint64_as_nested.msg (100%) rename tests/{ => test_pyros_msgs}/opt_as_nested/msg/test_opt_uint8_as_nested.msg (100%) rename tests/{ => test_pyros_msgs}/opt_as_nested/test_opt_bool.py (100%) rename tests/{ => test_pyros_msgs}/opt_as_nested/test_opt_duration.py (100%) rename tests/{ => test_pyros_msgs}/opt_as_nested/test_opt_int16.py (100%) rename tests/{ => test_pyros_msgs}/opt_as_nested/test_opt_int32.py (100%) rename tests/{ => test_pyros_msgs}/opt_as_nested/test_opt_int64.py (100%) rename tests/{ => test_pyros_msgs}/opt_as_nested/test_opt_int8.py (100%) rename tests/{ => test_pyros_msgs}/opt_as_nested/test_opt_std_empty.py (100%) rename tests/{ => test_pyros_msgs}/opt_as_nested/test_opt_string.py (100%) rename tests/{ => test_pyros_msgs}/opt_as_nested/test_opt_time.py (100%) rename tests/{ => test_pyros_msgs}/opt_as_nested/test_opt_uint16.py (100%) rename tests/{ => test_pyros_msgs}/opt_as_nested/test_opt_uint32.py (100%) rename tests/{ => test_pyros_msgs}/opt_as_nested/test_opt_uint64.py (100%) rename tests/{ => test_pyros_msgs}/opt_as_nested/test_opt_uint8.py (100%) rename tests/{ => test_pyros_msgs}/typecheck/__init__.py (97%) rename tests/{ => test_pyros_msgs}/typecheck/test_basic_ros_serialization.py (100%) rename tests/{ => test_pyros_msgs}/typecheck/test_ros_mappings.py (100%) rename tests/{ => test_pyros_msgs}/typecheck/test_typechecker_arrays.py (100%) rename tests/{ => test_pyros_msgs}/typecheck/test_typechecker_basic.py (100%) rename tests/{ => test_pyros_msgs}/typecheck/test_typechecker_nested.py (100%) diff --git a/.gitignore b/.gitignore index dc106bf..c3cebe4 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,10 @@ *.pyc build +dist .tox .hypothesis *.egg-info +.cache +.idea +__pycache__ + diff --git a/.gitmodules b/.gitmodules index 2351cfc..0922419 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,12 +1,6 @@ -[submodule "rosdeps/genmsg"] - path = rosdeps/genmsg - url = https://github.com/ros/genmsg.git -[submodule "rosdeps/genpy"] - path = rosdeps/genpy - url = https://github.com/ros/genpy.git -[submodule "rosdeps/std_msgs"] - path = rosdeps/std_msgs +[submodule "tests/rosdeps/std_msgs"] + path = tests/rosdeps/std_msgs url = https://github.com/ros/std_msgs.git -[submodule "rosdeps/ros_comm_msgs"] - path = rosdeps/ros_comm_msgs +[submodule "tests/rosdeps/ros_comm_msgs"] + path = tests/rosdeps/ros_comm_msgs url = https://github.com/ros/ros_comm_msgs.git diff --git a/MANIFEST.in b/MANIFEST.in new file mode 100644 index 0000000..b570fbf --- /dev/null +++ b/MANIFEST.in @@ -0,0 +1,3 @@ +# default +include README.rst +include setup.py diff --git a/dev-requirements.txt b/dev-requirements.txt index 31998c0..80fb301 100644 --- a/dev-requirements.txt +++ b/dev-requirements.txt @@ -1,11 +1,14 @@ gitchangelog twine -pytest>=2.8.0, # as per hypothesis requirement (careful with 2.5.1 on trusty) -pytest-xdist, # for --boxed (careful with the version it will be moved out of xdist) -hypothesis>=3.0.1, # to target xenial LTS version -numpy>=1.8.2, # from trusty version -rosimport +pytest>=2.8.0 # as per hypothesis requirement (careful with 2.5.1 on trusty) +pytest-xdist # for --boxed (careful with the version it will be moved out of xdist) +hypothesis>=3.0.1 # to target xenial LTS version +numpy>=1.8.2 # from trusty version -# source access to latest filefinder from git ... -#-e git+https://github.com/asmodehn/filefinder2.git#egg=filefinder2 -#-e git+https://github.com/asmodehn/rosimport.git#egg=rosimport +# source access to latest filefinder and rosimport from git ... +-e git+https://github.com/asmodehn/filefinder2.git#egg=filefinder2 +-e git+https://github.com/asmodehn/rosimport.git#egg=rosimport + +# ros dependencies (necessary when running tests from install) +-e git+https://github.com/asmodehn/genmsg.git@setuptools#egg=ros_genmsg +-e git+https://github.com/asmodehn/genpy.git@setuptools#egg=ros_genpy diff --git a/msg b/msg new file mode 120000 index 0000000..7ad3823 --- /dev/null +++ b/msg @@ -0,0 +1 @@ +pyros_msgs/msg \ No newline at end of file diff --git a/pyros_msgs/__init__.py b/pyros_msgs/__init__.py index 62b0fcc..e69de29 100644 --- a/pyros_msgs/__init__.py +++ b/pyros_msgs/__init__.py @@ -1,15 +0,0 @@ -from __future__ import absolute_import, division, print_function -# This is a namespace package to merge the ROS generated messages and the python subpackage sources -# Note : this file must be loaded first in order for other subpackages to be found -# Note : this works for development packages only if pyros_setup has been activated -# because it will put egg directories on pythonpath FIRST. - -# Ref : https://packaging.python.org/namespace_packages/ - -# pkgutil does not seem, somehow, to be compatible with ROS devel space... -# import pkgutil -# __path__ = pkgutil.extend_path(__path__, __name__) - -# Be aware : https://github.com/jonparrott/namespace-pkg-tests/blob/master/table.md -import pkg_resources -pkg_resources.declare_namespace(__name__) diff --git a/msg/OptionalFields.msg b/pyros_msgs/msg/OptionalFields.msg similarity index 100% rename from msg/OptionalFields.msg rename to pyros_msgs/msg/OptionalFields.msg diff --git a/pyros_msgs/opt_as_nested/opt_as_nested.py b/pyros_msgs/opt_as_nested/opt_as_nested.py index 0937155..8aafe28 100644 --- a/pyros_msgs/opt_as_nested/opt_as_nested.py +++ b/pyros_msgs/opt_as_nested/opt_as_nested.py @@ -11,10 +11,6 @@ make_typechecker_field_hidden, ) -import os -import sys - - from .ros_mappings import typechecker_from_rosfield_opttype diff --git a/pyros_msgs/typecheck/ros_mappings.py b/pyros_msgs/typecheck/ros_mappings.py index 0492693..e1e397a 100644 --- a/pyros_msgs/typecheck/ros_mappings.py +++ b/pyros_msgs/typecheck/ros_mappings.py @@ -27,7 +27,7 @@ import six -from pyros_msgs.typecheck import ( +from .typechecker import ( six_long, Accepter, Sanitizer, Array, Any, MinMax, CodePoint, TypeChecker, diff --git a/ros-site/README.md b/ros-site/README.md deleted file mode 100644 index 24202b8..0000000 --- a/ros-site/README.md +++ /dev/null @@ -1,6 +0,0 @@ -This folder is added with site.addsitedir() to provide a set of ROS python packages from source. -It happens when the import of one of these packages(usually found on ROS systems) fails. -This is the case from pure python, for our automated testing tox suite. - -If ROS is setup before executing pyros_msgs/importer/rosmsg_generator.py, -then the ROS versions of these packages will be used instead \ No newline at end of file diff --git a/ros-site/genmsg.pth b/ros-site/genmsg.pth deleted file mode 100644 index 297013a..0000000 --- a/ros-site/genmsg.pth +++ /dev/null @@ -1 +0,0 @@ -../rosdeps/genmsg/src \ No newline at end of file diff --git a/ros-site/genpy.pth b/ros-site/genpy.pth deleted file mode 100644 index 79a5b28..0000000 --- a/ros-site/genpy.pth +++ /dev/null @@ -1 +0,0 @@ -../rosdeps/genpy/src \ No newline at end of file diff --git a/rosdeps/genmsg b/rosdeps/genmsg deleted file mode 160000 index 490b375..0000000 --- a/rosdeps/genmsg +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 490b3753213ed3e2251acd218c62224b2787ee0e diff --git a/rosdeps/genpy b/rosdeps/genpy deleted file mode 160000 index cb07134..0000000 --- a/rosdeps/genpy +++ /dev/null @@ -1 +0,0 @@ -Subproject commit cb07134e084a4fb6099de5cefcbb6b9a7f666cf5 diff --git a/setup.py b/setup.py index 8228392..3f49ec1 100644 --- a/setup.py +++ b/setup.py @@ -204,7 +204,6 @@ def run(self): package_data={ '': ['*.msg', '*.srv'] }, - namespace_packages=['pyros_msgs'], # this is better than using package data ( since behavior is a bit different from distutils... ) #include_package_data=True, # use MANIFEST.in during install. # Reference for optional dependencies : http://stackoverflow.com/questions/4796936/does-pip-handle-extras-requires-from-setuptools-distribute-based-sources @@ -213,6 +212,7 @@ def run(self): 'pyyaml>=3.10', # genpy relies on this... ], tests_require=[ + 'filefinder2', 'rosimport', # we rely on this for generating ROS message if necessary before importing 'pytest>=2.8.0', # as per hypothesis requirement (careful with 2.5.1 on trusty) 'pytest-xdist', # for --boxed (careful with the version it will be moved out of xdist) diff --git a/tests/opt_as_array/__init__.py b/tests/opt_as_array/__init__.py deleted file mode 100644 index d544393..0000000 --- a/tests/opt_as_array/__init__.py +++ /dev/null @@ -1,21 +0,0 @@ -from __future__ import absolute_import, division, print_function - -import os -import sys -import site - -site.addsitedir(os.path.join(os.path.dirname(os.path.dirname(os.path.dirname(__file__))), 'rosdeps')) -site.addsitedir(os.path.join(os.path.dirname(os.path.dirname(os.path.dirname(__file__))), 'pydeps')) - -# TMP : waiting for proper pip installable version of genpy and genmsd -try: - # Using genpy directly if ROS has been setup (while using from ROS pkg) - import genpy, genmsg -except ImportError: - # Otherwise we refer to our submodules here (setup.py usecase, or running from tox without site-packages) - import site - site.addsitedir(os.path.join(os.path.dirname(os.path.dirname(os.path.dirname(__file__))), 'ros-site')) - import genpy, genmsg - -import rosimport -rosimport.activate() diff --git a/tests/opt_as_nested/__init__.py b/tests/opt_as_nested/__init__.py deleted file mode 100644 index 059dc31..0000000 --- a/tests/opt_as_nested/__init__.py +++ /dev/null @@ -1,21 +0,0 @@ -from __future__ import absolute_import, division, print_function - -import os -import sys -import site - -# This is used for message definitions, not for python code -site.addsitedir(os.path.join(os.path.dirname(os.path.dirname(os.path.dirname(__file__))), 'rosdeps')) - -# TMP : waiting for proper pip installable version of genpy and genmsd -try: - # Using genpy directly if ROS has been setup (while using from ROS pkg) - import genpy, genmsg -except ImportError: - # Otherwise we refer to our submodules here (setup.py usecase, or running from tox without site-packages) - import site - site.addsitedir(os.path.join(os.path.dirname(os.path.dirname(os.path.dirname(__file__))), 'ros-site')) - import genpy, genmsg - -import rosimport -rosimport.activate() diff --git a/rosdeps/ros_comm_msgs b/tests/rosdeps/ros_comm_msgs similarity index 100% rename from rosdeps/ros_comm_msgs rename to tests/rosdeps/ros_comm_msgs diff --git a/rosdeps/std_msgs b/tests/rosdeps/std_msgs similarity index 100% rename from rosdeps/std_msgs rename to tests/rosdeps/std_msgs diff --git a/tests/__init__.py b/tests/test_pyros_msgs/__init__.py similarity index 100% rename from tests/__init__.py rename to tests/test_pyros_msgs/__init__.py diff --git a/tests/test_pyros_msgs/opt_as_array/__init__.py b/tests/test_pyros_msgs/opt_as_array/__init__.py new file mode 100644 index 0000000..1ecdaa8 --- /dev/null +++ b/tests/test_pyros_msgs/opt_as_array/__init__.py @@ -0,0 +1,17 @@ +from __future__ import absolute_import, division, print_function + +import os +import sys +import site + +added_site_dir = os.path.join(os.path.dirname(os.path.dirname(os.path.dirname(__file__))), 'rosdeps') +print("Adding site directory {0} to access genmsg, genpy and, std_msgs".format(added_site_dir)) +site.addsitedir(added_site_dir) + +# Using genpy directly if ROS has been setup (while using from ROS pkg) +import genpy, genmsg + +print(sys.path) + +import rosimport +rosimport.activate() diff --git a/tests/opt_as_array/msg/test_opt_bool_as_array.msg b/tests/test_pyros_msgs/opt_as_array/msg/test_opt_bool_as_array.msg similarity index 100% rename from tests/opt_as_array/msg/test_opt_bool_as_array.msg rename to tests/test_pyros_msgs/opt_as_array/msg/test_opt_bool_as_array.msg diff --git a/tests/opt_as_array/msg/test_opt_duration_as_array.msg b/tests/test_pyros_msgs/opt_as_array/msg/test_opt_duration_as_array.msg similarity index 100% rename from tests/opt_as_array/msg/test_opt_duration_as_array.msg rename to tests/test_pyros_msgs/opt_as_array/msg/test_opt_duration_as_array.msg diff --git a/tests/opt_as_array/msg/test_opt_float32_as_array.msg b/tests/test_pyros_msgs/opt_as_array/msg/test_opt_float32_as_array.msg similarity index 100% rename from tests/opt_as_array/msg/test_opt_float32_as_array.msg rename to tests/test_pyros_msgs/opt_as_array/msg/test_opt_float32_as_array.msg diff --git a/tests/opt_as_array/msg/test_opt_float64_as_array.msg b/tests/test_pyros_msgs/opt_as_array/msg/test_opt_float64_as_array.msg similarity index 100% rename from tests/opt_as_array/msg/test_opt_float64_as_array.msg rename to tests/test_pyros_msgs/opt_as_array/msg/test_opt_float64_as_array.msg diff --git a/tests/opt_as_array/msg/test_opt_header_as_array.msg b/tests/test_pyros_msgs/opt_as_array/msg/test_opt_header_as_array.msg similarity index 100% rename from tests/opt_as_array/msg/test_opt_header_as_array.msg rename to tests/test_pyros_msgs/opt_as_array/msg/test_opt_header_as_array.msg diff --git a/tests/opt_as_array/msg/test_opt_int16_as_array.msg b/tests/test_pyros_msgs/opt_as_array/msg/test_opt_int16_as_array.msg similarity index 100% rename from tests/opt_as_array/msg/test_opt_int16_as_array.msg rename to tests/test_pyros_msgs/opt_as_array/msg/test_opt_int16_as_array.msg diff --git a/tests/opt_as_array/msg/test_opt_int32_as_array.msg b/tests/test_pyros_msgs/opt_as_array/msg/test_opt_int32_as_array.msg similarity index 100% rename from tests/opt_as_array/msg/test_opt_int32_as_array.msg rename to tests/test_pyros_msgs/opt_as_array/msg/test_opt_int32_as_array.msg diff --git a/tests/opt_as_array/msg/test_opt_int64_as_array.msg b/tests/test_pyros_msgs/opt_as_array/msg/test_opt_int64_as_array.msg similarity index 100% rename from tests/opt_as_array/msg/test_opt_int64_as_array.msg rename to tests/test_pyros_msgs/opt_as_array/msg/test_opt_int64_as_array.msg diff --git a/tests/opt_as_array/msg/test_opt_int8_as_array.msg b/tests/test_pyros_msgs/opt_as_array/msg/test_opt_int8_as_array.msg similarity index 100% rename from tests/opt_as_array/msg/test_opt_int8_as_array.msg rename to tests/test_pyros_msgs/opt_as_array/msg/test_opt_int8_as_array.msg diff --git a/tests/opt_as_array/msg/test_opt_std_empty_as_array.msg b/tests/test_pyros_msgs/opt_as_array/msg/test_opt_std_empty_as_array.msg similarity index 100% rename from tests/opt_as_array/msg/test_opt_std_empty_as_array.msg rename to tests/test_pyros_msgs/opt_as_array/msg/test_opt_std_empty_as_array.msg diff --git a/tests/opt_as_array/msg/test_opt_string_as_array.msg b/tests/test_pyros_msgs/opt_as_array/msg/test_opt_string_as_array.msg similarity index 100% rename from tests/opt_as_array/msg/test_opt_string_as_array.msg rename to tests/test_pyros_msgs/opt_as_array/msg/test_opt_string_as_array.msg diff --git a/tests/opt_as_array/msg/test_opt_time_as_array.msg b/tests/test_pyros_msgs/opt_as_array/msg/test_opt_time_as_array.msg similarity index 100% rename from tests/opt_as_array/msg/test_opt_time_as_array.msg rename to tests/test_pyros_msgs/opt_as_array/msg/test_opt_time_as_array.msg diff --git a/tests/opt_as_array/msg/test_opt_uint16_as_array.msg b/tests/test_pyros_msgs/opt_as_array/msg/test_opt_uint16_as_array.msg similarity index 100% rename from tests/opt_as_array/msg/test_opt_uint16_as_array.msg rename to tests/test_pyros_msgs/opt_as_array/msg/test_opt_uint16_as_array.msg diff --git a/tests/opt_as_array/msg/test_opt_uint32_as_array.msg b/tests/test_pyros_msgs/opt_as_array/msg/test_opt_uint32_as_array.msg similarity index 100% rename from tests/opt_as_array/msg/test_opt_uint32_as_array.msg rename to tests/test_pyros_msgs/opt_as_array/msg/test_opt_uint32_as_array.msg diff --git a/tests/opt_as_array/msg/test_opt_uint64_as_array.msg b/tests/test_pyros_msgs/opt_as_array/msg/test_opt_uint64_as_array.msg similarity index 100% rename from tests/opt_as_array/msg/test_opt_uint64_as_array.msg rename to tests/test_pyros_msgs/opt_as_array/msg/test_opt_uint64_as_array.msg diff --git a/tests/opt_as_array/msg/test_opt_uint8_as_array.msg b/tests/test_pyros_msgs/opt_as_array/msg/test_opt_uint8_as_array.msg similarity index 100% rename from tests/opt_as_array/msg/test_opt_uint8_as_array.msg rename to tests/test_pyros_msgs/opt_as_array/msg/test_opt_uint8_as_array.msg diff --git a/tests/opt_as_array/test_opt_bool.py b/tests/test_pyros_msgs/opt_as_array/test_opt_bool.py similarity index 100% rename from tests/opt_as_array/test_opt_bool.py rename to tests/test_pyros_msgs/opt_as_array/test_opt_bool.py diff --git a/tests/opt_as_array/test_opt_duration.py b/tests/test_pyros_msgs/opt_as_array/test_opt_duration.py similarity index 100% rename from tests/opt_as_array/test_opt_duration.py rename to tests/test_pyros_msgs/opt_as_array/test_opt_duration.py diff --git a/tests/opt_as_array/test_opt_int16.py b/tests/test_pyros_msgs/opt_as_array/test_opt_int16.py similarity index 100% rename from tests/opt_as_array/test_opt_int16.py rename to tests/test_pyros_msgs/opt_as_array/test_opt_int16.py diff --git a/tests/opt_as_array/test_opt_int32.py b/tests/test_pyros_msgs/opt_as_array/test_opt_int32.py similarity index 100% rename from tests/opt_as_array/test_opt_int32.py rename to tests/test_pyros_msgs/opt_as_array/test_opt_int32.py diff --git a/tests/opt_as_array/test_opt_int64.py b/tests/test_pyros_msgs/opt_as_array/test_opt_int64.py similarity index 100% rename from tests/opt_as_array/test_opt_int64.py rename to tests/test_pyros_msgs/opt_as_array/test_opt_int64.py diff --git a/tests/opt_as_array/test_opt_int8.py b/tests/test_pyros_msgs/opt_as_array/test_opt_int8.py similarity index 100% rename from tests/opt_as_array/test_opt_int8.py rename to tests/test_pyros_msgs/opt_as_array/test_opt_int8.py diff --git a/tests/opt_as_array/test_opt_std_empty.py b/tests/test_pyros_msgs/opt_as_array/test_opt_std_empty.py similarity index 100% rename from tests/opt_as_array/test_opt_std_empty.py rename to tests/test_pyros_msgs/opt_as_array/test_opt_std_empty.py diff --git a/tests/opt_as_array/test_opt_string.py b/tests/test_pyros_msgs/opt_as_array/test_opt_string.py similarity index 100% rename from tests/opt_as_array/test_opt_string.py rename to tests/test_pyros_msgs/opt_as_array/test_opt_string.py diff --git a/tests/opt_as_array/test_opt_time.py b/tests/test_pyros_msgs/opt_as_array/test_opt_time.py similarity index 100% rename from tests/opt_as_array/test_opt_time.py rename to tests/test_pyros_msgs/opt_as_array/test_opt_time.py diff --git a/tests/opt_as_array/test_opt_uint16.py b/tests/test_pyros_msgs/opt_as_array/test_opt_uint16.py similarity index 100% rename from tests/opt_as_array/test_opt_uint16.py rename to tests/test_pyros_msgs/opt_as_array/test_opt_uint16.py diff --git a/tests/opt_as_array/test_opt_uint32.py b/tests/test_pyros_msgs/opt_as_array/test_opt_uint32.py similarity index 100% rename from tests/opt_as_array/test_opt_uint32.py rename to tests/test_pyros_msgs/opt_as_array/test_opt_uint32.py diff --git a/tests/opt_as_array/test_opt_uint64.py b/tests/test_pyros_msgs/opt_as_array/test_opt_uint64.py similarity index 100% rename from tests/opt_as_array/test_opt_uint64.py rename to tests/test_pyros_msgs/opt_as_array/test_opt_uint64.py diff --git a/tests/opt_as_array/test_opt_uint8.py b/tests/test_pyros_msgs/opt_as_array/test_opt_uint8.py similarity index 100% rename from tests/opt_as_array/test_opt_uint8.py rename to tests/test_pyros_msgs/opt_as_array/test_opt_uint8.py diff --git a/tests/test_pyros_msgs/opt_as_nested/__init__.py b/tests/test_pyros_msgs/opt_as_nested/__init__.py new file mode 100644 index 0000000..dddba74 --- /dev/null +++ b/tests/test_pyros_msgs/opt_as_nested/__init__.py @@ -0,0 +1,14 @@ +from __future__ import absolute_import, division, print_function + +import os +import sys +import site + +# This is used for message definitions, not for python code +site.addsitedir(os.path.join(os.path.dirname(os.path.dirname(os.path.dirname(__file__))), 'rosdeps')) + +# Using genpy directly if ROS has been setup (while using from ROS pkg) +import genpy, genmsg + +import rosimport +rosimport.activate() diff --git a/tests/opt_as_nested/msg/test_opt_bool_as_nested.msg b/tests/test_pyros_msgs/opt_as_nested/msg/test_opt_bool_as_nested.msg similarity index 100% rename from tests/opt_as_nested/msg/test_opt_bool_as_nested.msg rename to tests/test_pyros_msgs/opt_as_nested/msg/test_opt_bool_as_nested.msg diff --git a/tests/opt_as_nested/msg/test_opt_duration_as_nested.msg b/tests/test_pyros_msgs/opt_as_nested/msg/test_opt_duration_as_nested.msg similarity index 100% rename from tests/opt_as_nested/msg/test_opt_duration_as_nested.msg rename to tests/test_pyros_msgs/opt_as_nested/msg/test_opt_duration_as_nested.msg diff --git a/tests/opt_as_nested/msg/test_opt_int16_as_nested.msg b/tests/test_pyros_msgs/opt_as_nested/msg/test_opt_int16_as_nested.msg similarity index 100% rename from tests/opt_as_nested/msg/test_opt_int16_as_nested.msg rename to tests/test_pyros_msgs/opt_as_nested/msg/test_opt_int16_as_nested.msg diff --git a/tests/opt_as_nested/msg/test_opt_int32_as_nested.msg b/tests/test_pyros_msgs/opt_as_nested/msg/test_opt_int32_as_nested.msg similarity index 100% rename from tests/opt_as_nested/msg/test_opt_int32_as_nested.msg rename to tests/test_pyros_msgs/opt_as_nested/msg/test_opt_int32_as_nested.msg diff --git a/tests/opt_as_nested/msg/test_opt_int64_as_nested.msg b/tests/test_pyros_msgs/opt_as_nested/msg/test_opt_int64_as_nested.msg similarity index 100% rename from tests/opt_as_nested/msg/test_opt_int64_as_nested.msg rename to tests/test_pyros_msgs/opt_as_nested/msg/test_opt_int64_as_nested.msg diff --git a/tests/opt_as_nested/msg/test_opt_int8_as_nested.msg b/tests/test_pyros_msgs/opt_as_nested/msg/test_opt_int8_as_nested.msg similarity index 100% rename from tests/opt_as_nested/msg/test_opt_int8_as_nested.msg rename to tests/test_pyros_msgs/opt_as_nested/msg/test_opt_int8_as_nested.msg diff --git a/tests/opt_as_nested/msg/test_opt_std_empty_as_nested.msg b/tests/test_pyros_msgs/opt_as_nested/msg/test_opt_std_empty_as_nested.msg similarity index 100% rename from tests/opt_as_nested/msg/test_opt_std_empty_as_nested.msg rename to tests/test_pyros_msgs/opt_as_nested/msg/test_opt_std_empty_as_nested.msg diff --git a/tests/opt_as_nested/msg/test_opt_string_as_nested.msg b/tests/test_pyros_msgs/opt_as_nested/msg/test_opt_string_as_nested.msg similarity index 100% rename from tests/opt_as_nested/msg/test_opt_string_as_nested.msg rename to tests/test_pyros_msgs/opt_as_nested/msg/test_opt_string_as_nested.msg diff --git a/tests/opt_as_nested/msg/test_opt_time_as_nested.msg b/tests/test_pyros_msgs/opt_as_nested/msg/test_opt_time_as_nested.msg similarity index 100% rename from tests/opt_as_nested/msg/test_opt_time_as_nested.msg rename to tests/test_pyros_msgs/opt_as_nested/msg/test_opt_time_as_nested.msg diff --git a/tests/opt_as_nested/msg/test_opt_uint16_as_nested.msg b/tests/test_pyros_msgs/opt_as_nested/msg/test_opt_uint16_as_nested.msg similarity index 100% rename from tests/opt_as_nested/msg/test_opt_uint16_as_nested.msg rename to tests/test_pyros_msgs/opt_as_nested/msg/test_opt_uint16_as_nested.msg diff --git a/tests/opt_as_nested/msg/test_opt_uint32_as_nested.msg b/tests/test_pyros_msgs/opt_as_nested/msg/test_opt_uint32_as_nested.msg similarity index 100% rename from tests/opt_as_nested/msg/test_opt_uint32_as_nested.msg rename to tests/test_pyros_msgs/opt_as_nested/msg/test_opt_uint32_as_nested.msg diff --git a/tests/opt_as_nested/msg/test_opt_uint64_as_nested.msg b/tests/test_pyros_msgs/opt_as_nested/msg/test_opt_uint64_as_nested.msg similarity index 100% rename from tests/opt_as_nested/msg/test_opt_uint64_as_nested.msg rename to tests/test_pyros_msgs/opt_as_nested/msg/test_opt_uint64_as_nested.msg diff --git a/tests/opt_as_nested/msg/test_opt_uint8_as_nested.msg b/tests/test_pyros_msgs/opt_as_nested/msg/test_opt_uint8_as_nested.msg similarity index 100% rename from tests/opt_as_nested/msg/test_opt_uint8_as_nested.msg rename to tests/test_pyros_msgs/opt_as_nested/msg/test_opt_uint8_as_nested.msg diff --git a/tests/opt_as_nested/test_opt_bool.py b/tests/test_pyros_msgs/opt_as_nested/test_opt_bool.py similarity index 100% rename from tests/opt_as_nested/test_opt_bool.py rename to tests/test_pyros_msgs/opt_as_nested/test_opt_bool.py diff --git a/tests/opt_as_nested/test_opt_duration.py b/tests/test_pyros_msgs/opt_as_nested/test_opt_duration.py similarity index 100% rename from tests/opt_as_nested/test_opt_duration.py rename to tests/test_pyros_msgs/opt_as_nested/test_opt_duration.py diff --git a/tests/opt_as_nested/test_opt_int16.py b/tests/test_pyros_msgs/opt_as_nested/test_opt_int16.py similarity index 100% rename from tests/opt_as_nested/test_opt_int16.py rename to tests/test_pyros_msgs/opt_as_nested/test_opt_int16.py diff --git a/tests/opt_as_nested/test_opt_int32.py b/tests/test_pyros_msgs/opt_as_nested/test_opt_int32.py similarity index 100% rename from tests/opt_as_nested/test_opt_int32.py rename to tests/test_pyros_msgs/opt_as_nested/test_opt_int32.py diff --git a/tests/opt_as_nested/test_opt_int64.py b/tests/test_pyros_msgs/opt_as_nested/test_opt_int64.py similarity index 100% rename from tests/opt_as_nested/test_opt_int64.py rename to tests/test_pyros_msgs/opt_as_nested/test_opt_int64.py diff --git a/tests/opt_as_nested/test_opt_int8.py b/tests/test_pyros_msgs/opt_as_nested/test_opt_int8.py similarity index 100% rename from tests/opt_as_nested/test_opt_int8.py rename to tests/test_pyros_msgs/opt_as_nested/test_opt_int8.py diff --git a/tests/opt_as_nested/test_opt_std_empty.py b/tests/test_pyros_msgs/opt_as_nested/test_opt_std_empty.py similarity index 100% rename from tests/opt_as_nested/test_opt_std_empty.py rename to tests/test_pyros_msgs/opt_as_nested/test_opt_std_empty.py diff --git a/tests/opt_as_nested/test_opt_string.py b/tests/test_pyros_msgs/opt_as_nested/test_opt_string.py similarity index 100% rename from tests/opt_as_nested/test_opt_string.py rename to tests/test_pyros_msgs/opt_as_nested/test_opt_string.py diff --git a/tests/opt_as_nested/test_opt_time.py b/tests/test_pyros_msgs/opt_as_nested/test_opt_time.py similarity index 100% rename from tests/opt_as_nested/test_opt_time.py rename to tests/test_pyros_msgs/opt_as_nested/test_opt_time.py diff --git a/tests/opt_as_nested/test_opt_uint16.py b/tests/test_pyros_msgs/opt_as_nested/test_opt_uint16.py similarity index 100% rename from tests/opt_as_nested/test_opt_uint16.py rename to tests/test_pyros_msgs/opt_as_nested/test_opt_uint16.py diff --git a/tests/opt_as_nested/test_opt_uint32.py b/tests/test_pyros_msgs/opt_as_nested/test_opt_uint32.py similarity index 100% rename from tests/opt_as_nested/test_opt_uint32.py rename to tests/test_pyros_msgs/opt_as_nested/test_opt_uint32.py diff --git a/tests/opt_as_nested/test_opt_uint64.py b/tests/test_pyros_msgs/opt_as_nested/test_opt_uint64.py similarity index 100% rename from tests/opt_as_nested/test_opt_uint64.py rename to tests/test_pyros_msgs/opt_as_nested/test_opt_uint64.py diff --git a/tests/opt_as_nested/test_opt_uint8.py b/tests/test_pyros_msgs/opt_as_nested/test_opt_uint8.py similarity index 100% rename from tests/opt_as_nested/test_opt_uint8.py rename to tests/test_pyros_msgs/opt_as_nested/test_opt_uint8.py diff --git a/tests/typecheck/__init__.py b/tests/test_pyros_msgs/typecheck/__init__.py similarity index 97% rename from tests/typecheck/__init__.py rename to tests/test_pyros_msgs/typecheck/__init__.py index 2b7400e..c50a829 100644 --- a/tests/typecheck/__init__.py +++ b/tests/test_pyros_msgs/typecheck/__init__.py @@ -3,16 +3,6 @@ import pytest import sys -# try: -# import pyros_msgs -# import genpy -# except ImportError: -# import pyros_setup -# pyros_setup.configurable_import().configure().activate() -# import pyros_msgs -# import genpy - - import six from pyros_msgs.typecheck.typechecker import ( diff --git a/tests/typecheck/test_basic_ros_serialization.py b/tests/test_pyros_msgs/typecheck/test_basic_ros_serialization.py similarity index 100% rename from tests/typecheck/test_basic_ros_serialization.py rename to tests/test_pyros_msgs/typecheck/test_basic_ros_serialization.py diff --git a/tests/typecheck/test_ros_mappings.py b/tests/test_pyros_msgs/typecheck/test_ros_mappings.py similarity index 100% rename from tests/typecheck/test_ros_mappings.py rename to tests/test_pyros_msgs/typecheck/test_ros_mappings.py diff --git a/tests/typecheck/test_typechecker_arrays.py b/tests/test_pyros_msgs/typecheck/test_typechecker_arrays.py similarity index 100% rename from tests/typecheck/test_typechecker_arrays.py rename to tests/test_pyros_msgs/typecheck/test_typechecker_arrays.py diff --git a/tests/typecheck/test_typechecker_basic.py b/tests/test_pyros_msgs/typecheck/test_typechecker_basic.py similarity index 100% rename from tests/typecheck/test_typechecker_basic.py rename to tests/test_pyros_msgs/typecheck/test_typechecker_basic.py diff --git a/tests/typecheck/test_typechecker_nested.py b/tests/test_pyros_msgs/typecheck/test_typechecker_nested.py similarity index 100% rename from tests/typecheck/test_typechecker_nested.py rename to tests/test_pyros_msgs/typecheck/test_typechecker_nested.py diff --git a/tox.ini b/tox.ini index 77e9e18..9af67ee 100644 --- a/tox.ini +++ b/tox.ini @@ -10,7 +10,7 @@ envlist = py27 # we skip sdist since currently our sdist doesnt generate messages # we will manually setup the package via develop in [testenv] -skipsdist=True +#skipsdist=True [travis] 2.7 = py27 @@ -39,8 +39,8 @@ recreate=True # sitepackages=True # We do not want any access to system (same as basic travis python testing) -# TMP because our dependencies are not in pips -usedevelop = True +;# TMP because our dependencies are not in pips +;usedevelop = True # we need to set our ROS distro in the pythonpath for our code to rely on ROS #TODO : not havnig this breaks pyros-setup which tries to create its config file in @@ -55,9 +55,9 @@ usedevelop = True setenv= # TODO : get rid of this by removing all dependencies to ROS on system... - indigo: PYTHONPATH=/opt/ros/indigo/lib/python2.7/dist-packages - jade: PYTHONPATH=/opt/ros/jade/lib/python2.7/dist-packages - kinetic: PYTHONPATH=/opt/ros/kinetic/lib/python2.7/dist-packages +; indigo: PYTHONPATH=/opt/ros/indigo/lib/python2.7/dist-packages +; jade: PYTHONPATH=/opt/ros/jade/lib/python2.7/dist-packages +; kinetic: PYTHONPATH=/opt/ros/kinetic/lib/python2.7/dist-packages commands= # we want to make sure python finds the installed package in tox env