Skip to content

Travis CI failing #98

@stwirth

Description

@stwirth

Since #93 got merged, it seems that Travis CI is failing with

======================================================================
ERROR: Failure: ImportError (No module named pycodestyle)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/travis/virtualenv/python2.7.17/lib/python2.7/site-packages/nose/loader.py", line 418, in loadTestsFromName
    addr.filename, addr.module)
  File "/home/travis/virtualenv/python2.7.17/lib/python2.7/site-packages/nose/importer.py", line 47, in importFromPath
    return self.importFromDir(dir_path, fqname)
  File "/home/travis/virtualenv/python2.7.17/lib/python2.7/site-packages/nose/importer.py", line 94, in importFromDir
    mod = load_module(part_fqname, fh, filename, desc)
  File "/tmp/capabilities_build/src/capabilities/test/unit/test_code_quality.py", line 1, in <module>
    import pycodestyle
ImportError: No module named pycodestyle

e.g. https://travis-ci.org/github/osrf/capabilities/builds/681663229

The package.xml defines a rosdep on python-pycodestyle:

capabilities/package.xml

Lines 44 to 45 in df54fa8

<test_depend condition="$ROS_PYTHON_VERSION == 2">python-pycodestyle</test_depend>
<test_depend condition="$ROS_PYTHON_VERSION == 3">python3-pycodestyle</test_depend>

.travis.yml installs other python rosdeps via pip but not pycodestyle:

install:
- pip install nose coverage pep8 PyYAML catkin_pkg rospkg empy python-coveralls
- sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu bionic main" > /etc/apt/sources.list.d/ros-latest.list'
- wget http://packages.ros.org/ros.key -O - | sudo apt-key add -
- sudo apt-get update
- sudo apt-get install python-rosdep
- sudo `which rosdep` init
- rosdep update
- rosdep install --from-paths ./ --rosdistro melodic -y

I think python-pycodestyle might not be installed automatically during the rosdep install because ROS_PYTHON_VERSION is not set yet at this point.

Solution A: Add pycodestyle to line 7 in travis.yml

Solution B: Set ROS_PYTHON_VERSION=2 before line 14 in travis.yml (and cleanup line 7: remove the packages that are installed via rosdep)

If B works I think it would be the better solution.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions