Issues with tox for running tests

Hi,

I have just set up the dev environment for playing around with the HA code.
I want to help adding a few features to some components / platform.

When I run tox for local testing, I have errors at the dependency installation step for requirements_all.txt.

Here is the error :

 actionid: py34
msg: getenv
cmdargs: [local('/media/USER/home-assistant/.tox/py34/bin/pip'), 'install', '-r/media/USER/home-assistant/requirements_all.txt', '-r/media/USER/home-assistant/requirements_test.txt']
env: {'HOME': '/home/USER', 'LANGUAGE': 'fr:en_GB', 'SHELL': '/bin/bash', 'KONSOLE_DBUS_SERVICE': ':1.37', 'COLORFGBG': '15;0', 'XCURSOR_THEME': 'breeze_cursors', 'MAVEN_OPTS': '-Xmx512m', 'DISPLAY': ':0', 'DESKTOP_SESSION': '/usr/share/xsessions/plasma', 'XAUTHORITY': '/tmp/xauth-1000-_0', 'XDG_SESSION_TYPE': 'x11', 'XDG_SESSION_CLASS': 'user', 'XDG_SESSION_DESKTOP': 'KDE', 'USER': 'USER', 'XDG_SESSION_PATH': '/org/freedesktop/DisplayManager/Session1', 'XDG_RUNTIME_DIR': '/run/user/1000', 'TERM': 'xterm', 'PYTHONPATH': '/media/USER/home-assistant:/media/USER/home-assistant/homeassistant', 'LANG': 'en_US.UTF-8', 'XC8_TOOLCHAIN_ROOT': '/opt/microchip/xc8/v1.38', 'PROFILEHOME': '', 'SHLVL': '2', 'XDG_VTNR': '1', 'MOZ_PLUGIN_PATH': '/usr/lib/mozilla/plugins', 'VIRTUAL_ENV': '/media/USER/home-assistant/.tox/py34', 'KONSOLE_DBUS_SESSION': '/Sessions/2', 'KONSOLE_PROFILE_NAME': 'Default', 'XDG_SESSION_ID': 'c3', 'QT_AUTO_SCREEN_SCALE_FACTOR': '0', 'VISUAL': 'vim', 'XDG_SEAT': 'seat0', 'XDG_DATA_DIRS': '/usr/share:/usr/share:/usr/local/share', 'LOGNAME': 'USER', 'KONSOLE_DBUS_WINDOW': '/Windows/1', 'GTK2_RC_FILES': '/etc/gtk-2.0/gtkrc:/home/USER/.gtkrc-2.0:/home/USER/.config/gtkrc-2.0', 'XC16_TOOLCHAIN_ROOT': '/opt/microchip/xc16/v1.25', 'XDG_CURRENT_DESKTOP': 'KDE', 'PWD': '/home/USER/Logiciels/home-assistant', 'GTK_MODULES': 'canberra-gtk-module', 'XDG_SEAT_PATH': '/org/freedesktop/DisplayManager/Seat0', 'GS_LIB': '/home/USER/.fonts', 'MAIL': '/var/spool/mail/USER', 'OLDPWD': '/home/USER/Logiciels', 'KDE_MULTIHEAD': 'false', 'PATH': '/media/USER/home-assistant/.tox/py34/bin:/usr/lib/hardening-wrapper/bin:/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/lib/jvm/default/bin:/opt/microchip/xc16/v1.26/bin:/opt/microchip/xc8/v1.38/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl:/opt/microchip/xc16/v1.25/bin', 'KDE_SESSION_UID': '1000', 'PYTHONHASHSEED': '1805439065', 'DBUS_SESSION_BUS_ADDRESS': 'unix:path=/run/user/1000/bus', 'SHELL_SESSION_ID': '79fd102eedbf4000b62ac72ab88ec919', '_': '/usr/bin/tox', 'SESSION_MANAGER': 'local/pc-arch:@/tmp/.ICE-unix/1261,unix/pc-arch:/tmp/.ICE-unix/1261', 'ANT_HOME': '/usr/share/apache-ant', 'KDE_FULL_SESSION': 'true', 'WINDOWID': '2097158', 'GTK_RC_FILES': '/etc/gtk/gtkrc:/home/USER/.gtkrc:/home/USER/.config/gtkrc', 'KDE_SESSION_VERSION': '5'}
Collecting https://github.com/Danielhiversen/flux_led/archive/0.6.zip#flux_led==0.6 (from -r /media/USER/home-assistant/requirements_all.txt (line 132))
  Downloading https://github.com/Danielhiversen/flux_led/archive/0.6.zip
Collecting https://github.com/LinuxChristian/pyW215/archive/v0.3.4.zip#pyW215==0.3.4 (from -r /media/USER/home-assistant/requirements_all.txt (line 135))
  Downloading https://github.com/LinuxChristian/pyW215/archive/v0.3.4.zip
Collecting https://github.com/TheRealLink/pylgtv/archive/v0.1.2.zip#pylgtv==0.1.2 (from -r /media/USER/home-assistant/requirements_all.txt (line 139))
  Downloading https://github.com/TheRealLink/pylgtv/archive/v0.1.2.zip
Collecting https://github.com/TheRealLink/pythinkingcleaner/archive/v0.0.2.zip#pythinkingcleaner==0.0.2 (from -r /media/USER/home-assistant/requirements_all.txt (line 143))
  Downloading https://github.com/TheRealLink/pythinkingcleaner/archive/v0.0.2.zip
Collecting https://github.com/Xorso/pyalarmdotcom/archive/0.1.1.zip#pyalarmdotcom==0.1.1 (from -r /media/USER/home-assistant/requirements_all.txt (line 146))
  Downloading https://github.com/Xorso/pyalarmdotcom/archive/0.1.1.zip
Collecting https://github.com/aparraga/braviarc/archive/0.3.5.zip#braviarc==0.3.5 (from -r /media/USER/home-assistant/requirements_all.txt (line 149))
  Downloading https://github.com/aparraga/braviarc/archive/0.3.5.zip
Collecting https://github.com/bah2830/python-roku/archive/3.1.2.zip#roku==3.1.2 (from -r /media/USER/home-assistant/requirements_all.txt (line 152))
  Downloading https://github.com/bah2830/python-roku/archive/3.1.2.zip
Collecting https://github.com/bashwork/pymodbus/archive/d7fc4f1cc975631e0a9011390e8017f64b612661.zip#pymodbus==1.2.0 (from -r /media/USER/home-assistant/requirements_all.txt (line 155))
  Downloading https://github.com/bashwork/pymodbus/archive/d7fc4f1cc975631e0a9011390e8017f64b612661.zip (1.5MB)
Collecting https://github.com/danieljkemp/onkyo-eiscp/archive/python3.zip#onkyo-eiscp==0.9.2 (from -r /media/USER/home-assistant/requirements_all.txt (line 158))
  Downloading https://github.com/danieljkemp/onkyo-eiscp/archive/python3.zip (64kB)
Collecting https://github.com/gadgetreactor/pyHS100/archive/master.zip#pyHS100==0.1.2 (from -r /media/USER/home-assistant/requirements_all.txt (line 164))
  Downloading https://github.com/gadgetreactor/pyHS100/archive/master.zip
Collecting https://github.com/jabesq/netatmo-api-python/archive/master.zip#lnetatmo==0.5.0 (from -r /media/USER/home-assistant/requirements_all.txt (line 167))
  Downloading https://github.com/jabesq/netatmo-api-python/archive/master.zip
Collecting https://github.com/jamespcole/home-assistant-nzb-clients/archive/616cad59154092599278661af17e2a9f2cf5e2a9.zip#python-sabnzbd==0.1 (from -r /media/USER/home-assistant/requirements_all.txt (line 170))
  Downloading https://github.com/jamespcole/home-assistant-nzb-clients/archive/616cad59154092599278661af17e2a9f2cf5e2a9.zip
Collecting https://github.com/kellerza/pyqwikswitch/archive/v0.4.zip#pyqwikswitch==0.4 (from -r /media/USER/home-assistant/requirements_all.txt (line 173))
  Downloading https://github.com/kellerza/pyqwikswitch/archive/v0.4.zip
Collecting https://github.com/laf/russound/archive/0.1.6.zip#russound==0.1.6 (from -r /media/USER/home-assistant/requirements_all.txt (line 176))
  Downloading https://github.com/laf/russound/archive/0.1.6.zip
Collecting https://github.com/nkgilley/python-ecobee-api/archive/4856a704670c53afe1882178a89c209b5f98533d.zip#python-ecobee==0.0.6 (from -r /media/USER/home-assistant/requirements_all.txt (line 179))
  Downloading https://github.com/nkgilley/python-ecobee-api/archive/4856a704670c53afe1882178a89c209b5f98533d.zip
Collecting https://github.com/nkgilley/python-join-api/archive/3e1e849f1af0b4080f551b62270c6d244d5fbcbd.zip#python-join-api==0.0.1 (from -r /media/USER/home-assistant/requirements_all.txt (line 183))
  Downloading https://github.com/nkgilley/python-join-api/archive/3e1e849f1af0b4080f551b62270c6d244d5fbcbd.zip
Collecting https://github.com/rkabadi/pyedimax/archive/365301ce3ff26129a7910c501ead09ea625f3700.zip#pyedimax==0.1 (from -r /media/USER/home-assistant/requirements_all.txt (line 186))
  Downloading https://github.com/rkabadi/pyedimax/archive/365301ce3ff26129a7910c501ead09ea625f3700.zip
Collecting https://github.com/robbiet480/pygtfs/archive/00546724e4bbcb3053110d844ca44e2246267dd8.zip#pygtfs==0.1.3 (from -r /media/USER/home-assistant/requirements_all.txt (line 189))
  Downloading https://github.com/robbiet480/pygtfs/archive/00546724e4bbcb3053110d844ca44e2246267dd8.zip
Collecting https://github.com/sander76/powerviewApi/archive/master.zip#powerviewApi==0.2 (from -r /media/USER/home-assistant/requirements_all.txt (line 192))
  Downloading https://github.com/sander76/powerviewApi/archive/master.zip
Collecting https://github.com/theolind/pymysensors/archive/8ce98b7fb56f7921a808eb66845ce8b2c455c81e.zip#pymysensors==0.7.1 (from -r /media/USER/home-assistant/requirements_all.txt (line 195))
  Downloading https://github.com/theolind/pymysensors/archive/8ce98b7fb56f7921a808eb66845ce8b2c455c81e.zip
Collecting https://github.com/w1ll1am23/simplisafe-python/archive/586fede0e85fd69e56e516aaa8e97eb644ca8866.zip#simplisafe-python==0.0.1 (from -r /media/USER/home-assistant/requirements_all.txt (line 198))
  Downloading https://github.com/w1ll1am23/simplisafe-python/archive/586fede0e85fd69e56e516aaa8e97eb644ca8866.zip
Collecting https://github.com/web-push-libs/pywebpush/archive/e743dc92558fc62178d255c0018920d74fa778ed.zip#pywebpush==0.5.0 (from -r /media/USER/home-assistant/requirements_all.txt (line 201))
  Downloading https://github.com/web-push-libs/pywebpush/archive/e743dc92558fc62178d255c0018920d74fa778ed.zip
Collecting https://github.com/wokar/pylgnetcast/archive/v0.2.0.zip#pylgnetcast==0.2.0 (from -r /media/USER/home-assistant/requirements_all.txt (line 204))
  Downloading https://github.com/wokar/pylgnetcast/archive/v0.2.0.zip
Collecting requests<3,>=2 (from -r /media/USER/home-assistant/requirements_all.txt (line 2))
  Using cached requests-2.11.1-py2.py3-none-any.whl
Collecting pyyaml<4,>=3.11 (from -r /media/USER/home-assistant/requirements_all.txt (line 3))
  Using cached PyYAML-3.12.tar.gz
Collecting pytz>=2016.6.1 (from -r /media/USER/home-assistant/requirements_all.txt (line 4))
  Using cached pytz-2016.6.1-py2.py3-none-any.whl
Requirement already satisfied (use --upgrade to upgrade): pip>=7.0.0 in ./.tox/py34/lib/python3.4/site-packages (from -r /media/USER/home-assistant/requirements_all.txt (line 5))
Collecting jinja2>=2.8 (from -r /media/USER/home-assistant/requirements_all.txt (line 6))
  Using cached Jinja2-2.8-py2.py3-none-any.whl
Collecting voluptuous==0.9.2 (from -r /media/USER/home-assistant/requirements_all.txt (line 7))
  Using cached voluptuous-0.9.2.tar.gz
Collecting typing<4,>=3 (from -r /media/USER/home-assistant/requirements_all.txt (line 8))
  Using cached typing-3.5.2.2.tar.gz
Collecting PyISY==1.0.6 (from -r /media/USER/home-assistant/requirements_all.txt (line 11))
  Using cached PyISY-1.0.6.tar.gz
Collecting PyJWT==1.4.2 (from -r /media/USER/home-assistant/requirements_all.txt (line 14))
  Using cached PyJWT-1.4.2-py2.py3-none-any.whl
Collecting PyMata==2.12 (from -r /media/USER/home-assistant/requirements_all.txt (line 17))
  Using cached PyMata-2.12.tar.gz
Collecting SoCo==0.11.1 (from -r /media/USER/home-assistant/requirements_all.txt (line 23))
  Using cached soco-0.11.1-py2.py3-none-any.whl
Collecting TwitterAPI==2.4.2 (from -r /media/USER/home-assistant/requirements_all.txt (line 26))
  Using cached TwitterAPI-2.4.2.tar.gz
Collecting Werkzeug==0.11.11 (from -r /media/USER/home-assistant/requirements_all.txt (line 29))
  Using cached Werkzeug-0.11.11-py2.py3-none-any.whl
Collecting apcaccess==0.0.4 (from -r /media/USER/home-assistant/requirements_all.txt (line 32))
  Using cached apcaccess-0.0.4.tar.gz
Collecting astral==1.2 (from -r /media/USER/home-assistant/requirements_all.txt (line 35))
  Using cached astral-1.2-py2.py3-none-any.whl
Collecting batinfo==0.3 (from -r /media/USER/home-assistant/requirements_all.txt (line 38))
  Using cached batinfo-0.3.tar.gz
Collecting blinkstick==1.1.8 (from -r /media/USER/home-assistant/requirements_all.txt (line 41))
  Using cached BlinkStick-1.1.8.tar.gz
Collecting blockchain==1.3.3 (from -r /media/USER/home-assistant/requirements_all.txt (line 44))
  Using cached blockchain-1.3.3.tar.gz
Collecting boto3==1.3.1 (from -r /media/USER/home-assistant/requirements_all.txt (line 53))
  Using cached boto3-1.3.1-py2.py3-none-any.whl
Collecting cherrypy==7.1.0 (from -r /media/USER/home-assistant/requirements_all.txt (line 56))
  Using cached CherryPy-7.1.0-py3-none-any.whl
Collecting coinmarketcap==2.0.1 (from -r /media/USER/home-assistant/requirements_all.txt (line 59))
  Using cached coinmarketcap-2.0.1.tar.gz
Collecting colorlog<3,>2.1 (from -r /media/USER/home-assistant/requirements_all.txt (line 62))
  Using cached colorlog-2.7.0-py2.py3-none-any.whl
Collecting directpy==0.1 (from -r /media/USER/home-assistant/requirements_all.txt (line 65))
  Using cached directpy-0.1.zip
Collecting dnspython3==1.12.0 (from -r /media/USER/home-assistant/requirements_all.txt (line 68))
  Using cached dnspython3-1.12.0.zip
Collecting dweepy==0.2.0 (from -r /media/USER/home-assistant/requirements_all.txt (line 72))
  Using cached dweepy-0.2.0.tar.gz
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-build-c8_uqaa1/dweepy/setup.py", line 14, in <module>
        long_description=open('README.rst').read(),
      File "/media/USER/home-assistant/.tox/py34/lib/python3.4/encodings/ascii.py", line 26, in decode
        return codecs.ascii_decode(input, self.errors)[0]
    UnicodeDecodeError: 'ascii' codec can't decode byte 0xc2 in position 8404: ordinal not in range(128)
    
    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-c8_uqaa1/dweepy/

I have already modified a few python files but nothing that should give these type of error.

If someone has any idea of the origin of the error…

Regards,

1 Like

Seems to be a problem with the locale.
Running export LC_ALL=en_US.UTF-8 first, solved it for me.

1 Like

Thx.

Just in case someone is interested in the FreeBSD (tcsh) variant of this:
export LC_ALL=en_US.UTF-8