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

Travis CI failing #98

Open
stwirth opened this issue Jan 25, 2022 · 0 comments · May be fixed by #99
Open

Travis CI failing #98

stwirth opened this issue Jan 25, 2022 · 0 comments · May be fixed by #99

Comments

@stwirth
Copy link

stwirth commented Jan 25, 2022

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.

@stwirth stwirth changed the title Fix Travis CI Travis CI failing Jan 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant