Skip to content

Commit

Permalink
restructuring to extract tests, fix package dist, replace ros submodu…
Browse files Browse the repository at this point in the history
…les with pips
  • Loading branch information
asmodehn committed Jul 27, 2017
1 parent e4a8f3e commit a441052
Show file tree
Hide file tree
Showing 84 changed files with 63 additions and 107 deletions.
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
*.pyc
build
dist
.tox
.hypothesis
*.egg-info
.cache
.idea
__pycache__

14 changes: 4 additions & 10 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -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
3 changes: 3 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# default
include README.rst
include setup.py
19 changes: 11 additions & 8 deletions dev-requirements.txt
Original file line number Diff line number Diff line change
@@ -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
1 change: 1 addition & 0 deletions msg
15 changes: 0 additions & 15 deletions pyros_msgs/__init__.py
Original file line number Diff line number Diff line change
@@ -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__)
File renamed without changes.
4 changes: 0 additions & 4 deletions pyros_msgs/opt_as_nested/opt_as_nested.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,6 @@
make_typechecker_field_hidden,
)

import os
import sys


from .ros_mappings import typechecker_from_rosfield_opttype


Expand Down
2 changes: 1 addition & 1 deletion pyros_msgs/typecheck/ros_mappings.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@

import six

from pyros_msgs.typecheck import (
from .typechecker import (
six_long,
Accepter, Sanitizer, Array, Any, MinMax, CodePoint,
TypeChecker,
Expand Down
6 changes: 0 additions & 6 deletions ros-site/README.md

This file was deleted.

1 change: 0 additions & 1 deletion ros-site/genmsg.pth

This file was deleted.

1 change: 0 additions & 1 deletion ros-site/genpy.pth

This file was deleted.

1 change: 0 additions & 1 deletion rosdeps/genmsg
Submodule genmsg deleted from 490b37
1 change: 0 additions & 1 deletion rosdeps/genpy
Submodule genpy deleted from cb0713
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)
Expand Down
21 changes: 0 additions & 21 deletions tests/opt_as_array/__init__.py

This file was deleted.

21 changes: 0 additions & 21 deletions tests/opt_as_nested/__init__.py

This file was deleted.

File renamed without changes.
17 changes: 17 additions & 0 deletions tests/test_pyros_msgs/opt_as_array/__init__.py
Original file line number Diff line number Diff line change
@@ -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()
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
14 changes: 14 additions & 0 deletions tests/test_pyros_msgs/opt_as_nested/__init__.py
Original file line number Diff line number Diff line change
@@ -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()
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
12 changes: 6 additions & 6 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit a441052

Please sign in to comment.