Skip to content

Commit

Permalink
Merge pull request #272 from k-okada/fix_travis
Browse files Browse the repository at this point in the history
fix travis: pip install pyyaml==5.4.1
  • Loading branch information
v4hn authored May 9, 2022
2 parents 1f77e71 + b8e37d7 commit 5d511e1
Show file tree
Hide file tree
Showing 8 changed files with 45 additions and 13 deletions.
15 changes: 14 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,20 @@
sudo: true
dist: bionic
language: python
python:
- "3.6"
addons:
apt:
packages:
- python2.7
- 2to3
env:
global:
- JOB_PATH=/tmp/devel_job
- ABORT_ON_TEST_FAILURE=1
- INDEX_URL=https://raw.githubusercontent.com/ros-infrastructure/ros_buildfarm_config/production/index.yaml
matrix:
- CHECK_PYTHON2_COMPILE=true
- CHECK_PYTHON3_COMPILE=true
- ROS_DISTRO_NAME=indigo OS_NAME=ubuntu OS_CODE_NAME=trusty ARCH=amd64 INDEX_URL=https://raw.githubusercontent.com/ros-infrastructure/ros_buildfarm_config/6a93d17/index.yaml
- ROS_DISTRO_NAME=kinetic OS_NAME=ubuntu OS_CODE_NAME=xenial ARCH=amd64 INDEX_URL=https://raw.githubusercontent.com/ros-infrastructure/ros_buildfarm_config/6a93d17/index.yaml
Expand All @@ -22,9 +30,12 @@ env:
# allow_failures:
# - env: ROS_DISTRO_NAME=melodic OS_NAME=ubuntu OS_CODE_NAME=bionic ARCH=amd64
install:
# check python2 compatibility
- if [ "${CHECK_PYTHON2_COMPILE}" == "true" ]; then python2 -m compileall .; exit $?; fi
# check python3 compatibility
- if [ "${CHECK_PYTHON3_COMPILE}" == "true" ]; then python3 -m compileall -x asmach .; exit $?; fi
- if [ "${CHECK_PYTHON3_COMPILE}" == "true" ]; then bash -c "ret=0; trap 'ret=1' ERR; python3 -m compileall .; 2to3 -w -f except -f execfile -f has_key -f import -f raw_input -f zip .; git diff --exit-code . > /dev/null; echo Exitting with \$ret; exit \$ret"; exit $?; fi
# either install the latest released version of ros_buildfarm
- pip install pyyaml==5.4.1 ## latest pyyaml raises TypeError: load() missing 1 required positional argument: 'Loader'
- pip install ros_buildfarm
# or checkout a specific branch
#- git clone -b master https://github.com/ros-infrastructure/ros_buildfarm /tmp/ros_buildfarm
Expand All @@ -38,6 +49,8 @@ install:
- cp -R $TRAVIS_BUILD_DIR $JOB_PATH/ws/src/
# generate the script to run a pre-release job for that target and repo
- generate_prerelease_script.py $INDEX_URL $ROS_DISTRO_NAME default $OS_NAME $OS_CODE_NAME $ARCH --output-dir $JOB_PATH
# update keys for trusty/xenial
- set -x; if [ "${OS_CODE_NAME}" = "trusty" ] || [ "${OS_CODE_NAME}" = "xenial" ]; then sed -i /0.key$/a'curl -s https://raw.githubusercontent.com/ros/rosdistro/master/ros.asc | tee $WORKSPACE/keys/0.key' $JOB_PATH/prerelease_build_*.sh; fi
# run the actual job which involves Docker
- cd $JOB_PATH; sh ./prerelease.sh -y
script:
Expand Down
2 changes: 1 addition & 1 deletion pr2_bringup/scripts/calibrate_pr2.py
Original file line number Diff line number Diff line change
Expand Up @@ -369,7 +369,7 @@ def main():
if recalibrate:
controller_list = list_controllers()
def is_running(c) : return c[1]=='running'
running_controllers = [c[0] for c in filter(is_running, zip(controller_list.controllers, controller_list.state))]
running_controllers = [c[0] for c in filter(is_running, list(zip(controller_list.controllers, controller_list.state)))]
print("Running controllers : ", running_controllers)
if not switch_controller([], running_controllers, SwitchControllerRequest.STRICT):
print("Failed to stop controllers")
Expand Down
2 changes: 1 addition & 1 deletion pr2_camera_synchronizer/scripts/plot_multi_trigger.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#! /usr/bin/env python

from __future__ import with_statement
from __future__ import with_statement, print_function

PKG='pr2_camera_synchronizer'
import roslib; roslib.load_manifest(PKG)
Expand Down
2 changes: 1 addition & 1 deletion pr2_camera_synchronizer/test/test_classes.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ def issorted(l):
return copy == l

def interlace(l1, l2):
l = zip(l1, l2)
l = list(zip(l1, l2))
return list(sum(l, ()))

class TestProjector(unittest.TestCase):
Expand Down
25 changes: 20 additions & 5 deletions pr2_computer_monitor/scripts/cpu_monitor.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,8 @@ def check_ipmi():
stdout = subprocess.PIPE,
stderr = subprocess.PIPE, shell = True)
stdout, stderr = p.communicate()
stdout = stdout.decode()
stderr = stderr.decode()
retcode = p.returncode

if retcode != 0:
Expand Down Expand Up @@ -105,7 +107,7 @@ def check_ipmi():
if words[0].startswith('CPU') and words[0].strip().endswith('Temp'):
if words[1].strip().endswith('degrees C'):
tmp = ipmi_val.rstrip(' degrees C').lstrip()
if unicode(tmp).isnumeric():
if tmp.isnumeric():
temperature = float(tmp)
diag_vals.append(KeyValue(key = name + ' (C)', value = tmp))

Expand Down Expand Up @@ -133,7 +135,7 @@ def check_ipmi():
diag_vals.append(KeyValue(key = name + ' (C)', value = tmp))
# Give temp warning
dev_name = name.split()[0]
if unicode(tmp).isnumeric():
if tmp.isnumeric():
temperature = float(tmp)

if temperature >= 60 and temperature < 75:
Expand All @@ -153,7 +155,7 @@ def check_ipmi():
if (name.startswith('CPU') and name.endswith('Fan')) or name == 'MB Fan':
if ipmi_val.endswith('RPM'):
rpm = ipmi_val.rstrip(' RPM').lstrip()
if unicode(rpm).isnumeric():
if rpm.isnumeric():
if int(rpm) == 0:
diag_level = max(diag_level, DiagnosticStatus.ERROR)
diag_msgs.append('CPU Fan Off')
Expand Down Expand Up @@ -197,6 +199,8 @@ def check_core_temps(sys_temp_strings):
p = subprocess.Popen(cmd, stdout = subprocess.PIPE,
stderr = subprocess.PIPE, shell = True)
stdout, stderr = p.communicate()
stdout = stdout.decode()
stderr = stderr.decode()
retcode = p.returncode

if retcode != 0:
Expand All @@ -207,7 +211,7 @@ def check_core_temps(sys_temp_strings):
return diag_vals, diag_msgs, diag_level

tmp = stdout.strip()
if unicode(tmp).isnumeric():
if tmp.isnumeric():
temp = float(tmp) / 1000
diag_vals.append(KeyValue(key = 'Core %d Temp' % index, value = str(temp)))

Expand All @@ -234,6 +238,8 @@ def check_clock_speed(enforce_speed):
stdout = subprocess.PIPE,
stderr = subprocess.PIPE, shell = True)
stdout, stderr = p.communicate()
stdout = stdout.decode()
stderr = stderr.decode()
retcode = p.returncode

if retcode != 0:
Expand All @@ -251,7 +257,7 @@ def check_clock_speed(enforce_speed):

speed = words[1].strip().split('.')[0] # Conversion to float doesn't work with decimal
vals.append(KeyValue(key = 'Core %d MHz' % index, value = speed))
if unicode(speed).isnumeric():
if speed.isnumeric():
mhz = float(speed)

if mhz < 2240 and mhz > 2150:
Expand Down Expand Up @@ -291,6 +297,8 @@ def check_uptime(load1_threshold, load5_threshold):
p = subprocess.Popen('uptime', stdout = subprocess.PIPE,
stderr = subprocess.PIPE, shell = True)
stdout, stderr = p.communicate()
stdout = stdout.decode()
stderr = stderr.decode()
retcode = p.returncode

if retcode != 0:
Expand Down Expand Up @@ -336,6 +344,7 @@ def check_memory():
stdout = subprocess.PIPE,
stderr = subprocess.PIPE, shell = True)
stdout, stderr = p.communicate()
stdout = stdout.decode()
retcode = p.returncode

if retcode != 0:
Expand Down Expand Up @@ -386,6 +395,8 @@ def check_mpstat(core_count = -1):
stdout = subprocess.PIPE,
stderr = subprocess.PIPE, shell = True)
stdout, stderr = p.communicate()
stdout = stdout.decode()
stderr = stderr.decode()
retcode = p.returncode

if retcode != 0:
Expand Down Expand Up @@ -478,6 +489,8 @@ def get_core_temp_names():
stdout = subprocess.PIPE,
stderr = subprocess.PIPE, shell = True)
stdout, stderr = p.communicate()
stdout = stdout.decode()
stderr = stderr.decode()
retcode = p.returncode

if retcode != 0:
Expand Down Expand Up @@ -622,6 +635,8 @@ def check_nfs_stat(self):
stdout = subprocess.PIPE,
stderr = subprocess.PIPE, shell = True)
stdout, stderr = p.communicate()
stdout = stdout.decode()
stderr = stderr.decode()
retcode = p.returncode

if retcode != 0:
Expand Down
8 changes: 5 additions & 3 deletions pr2_computer_monitor/scripts/hd_monitor.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ def get_hddtemp_data(hostname = 'localhost', port = 7634):
newdat = hd_sock.recv(1024)
if len(newdat) == 0:
break
newdat = newdat.decode()
sock_data = sock_data + newdat
hd_sock.close()

Expand Down Expand Up @@ -201,10 +202,10 @@ def check_temps(self):
for index in range(0, len(drives)):
temp = temps[index]

if not unicode(temp).isnumeric() and drives[index] not in REMOVABLE:
if not temp.isnumeric() and drives[index] not in REMOVABLE:
temp_level = DiagnosticStatus.ERROR
temp_ok = False
elif not unicode(temp).isnumeric() and drives[index] in REMOVABLE:
elif not temp.isnumeric() and drives[index] in REMOVABLE:
temp_level = DiagnosticStatus.OK
temp = "Removed"
else:
Expand Down Expand Up @@ -258,6 +259,7 @@ def check_disk_usage(self):
p = subprocess.Popen(["df", "-P", "--block-size=1G", self._home_dir],
stdout=subprocess.PIPE, stderr=subprocess.PIPE)
stdout, stderr = p.communicate()
stdout = stdout.decode()
retcode = p.returncode

if (retcode == 0):
Expand All @@ -267,7 +269,7 @@ def check_disk_usage(self):
for row in stdout.split('\n'):
if len(row.split()) < 2:
continue
if not unicode(row.split()[1]).isnumeric() or float(row.split()[1]) < 10: # Ignore small drives
if not row.split()[1].isnumeric() or float(row.split()[1]) < 10: # Ignore small drives
continue

row_count += 1
Expand Down
2 changes: 2 additions & 0 deletions pr2_computer_monitor/scripts/ntp_monitor.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,8 @@ def ntp_monitor(ntp_hostname, offset=500, self_offset=500, diag_hostname=None,
p = Popen(["ntpdate", "-q", host], stdout=PIPE, stdin=PIPE, stderr=PIPE)
res = p.wait()
(o,e) = p.communicate()
o = o.decode()
e = e.decode()
except OSError as e:
(errno, msg) = e.args
if errno == 4:
Expand Down
2 changes: 1 addition & 1 deletion pr2_computer_monitor/src/pr2_computer_monitor/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
from nvidia_smi_util import gpu_status_to_diag, parse_smi_output, get_gpu_status
from .nvidia_smi_util import gpu_status_to_diag, parse_smi_output, get_gpu_status

0 comments on commit 5d511e1

Please sign in to comment.