[chirp_devel] Using TOX to test on MS Windows

Eric A. Cottrell
Sun Dec 3 12:32:12 PST 2017


On 12/3/2017 12:29 PM, Dan Smith via chirp_devel wrote:
>> Yeah. I think I posted a comment after the change that
>> "run_all_test.bat" is broken. I had to edit the batch file to get it
>> to run.
> Ah, okay, wanna send a patch for that in the meantime at least?
>
>> So what is this TOX thing?
> The tox tool is a thing that builds virtual environments for the purposes of running tests. It insulates the running tests from your actual system to a high degree, which means that tests should be a little easier to run in more places. It installs the packages that we need and properly “installs” chirp to run the tests. It’s a lot better for the build system, which means it should break less and require less maintenance from me.
>
> Now, if you have tox installed, all you should need to do to run the tests is type “tox”. It’ll build the venvs for driver and style checks the first time and then run the tests. I also have made the driver tests fit into the standard python testing infrastructure so we can use the regular test runners. In the future, that will let me run them in parallel more easily, which will make it much quicker to get a test result.
>
> On windows, try running this to install too:
>
>    python -mpip install tox
>
> Let’s see what Eric reports about what isn’t working to see if it’s something easy. Luckily, I was able to do all of the above without disturbing the regular way of running tests, so you can continue to do that until we sort it out.
>
> —Dan
> _______________________________________________
Hello,

I was using tox. I just tried run_all_test.bat which partly works. The 
run_all_test.bat problem is the "python tests\run_tests" line in the 
batch file will run the run_tests shell script instead of the 
run_tests.py file. If I enter python tests\run_tests.py on the command 
line it works.

The problem with tox seems to be the zip file under .tox/dist is not 
named with the right version number and is missing most of the needed 
files. I have included the output/logs of running tox.

73 Eric
-------------- next part --------------
GLOB sdist-make: C:\Projects\Radio\CHIRP\setup.py
unit create: C:\Projects\Radio\CHIRP\.tox\unit
unit installdeps: nose
unit inst: C:\Projects\Radio\CHIRP\.tox\dist\UNKNOWN-0.0.0.zip
ERROR: invocation failed (exit code 1), logfile: C:\Projects\Radio\CHIRP\.tox\unit\log\unit-2.log
ERROR: actionid: unit
msg: installpkg
cmdargs: ['C:\\Projects\\Radio\\CHIRP\\.tox\\unit\\Scripts\\pip.EXE', 'install', 'C:\\Projects\\Radio\\CHIRP\\.tox\\dist\\UNKNOWN-0.0.0.zip']

Processing c:\projects\radio\chirp\.tox\dist\unknown-0.0.0.zip
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "c:\users\ericc\appdata\local\temp\pip-jgef7j-build\setup.py", line 5, in <module>
        from chirp import CHIRP_VERSION
    ImportError: No module named chirp
    
    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in c:\users\ericc\appdata\local\temp\pip-jgef7j-build\

unit installed: libxml2-python==2.7.7,mox==0.5.3,nose==1.3.7,pep8==1.7.1,pluggy==0.6.0,py==1.5.2,py2exe==0.6.9,pycairo==1.8.10,pygobject==2.28.3,pygtk==2.24.0,pyserial==2.7,pywin32==221,six==1.11.0,tox==2.9.1,virtualenv==15.1.0
driver create: C:\Projects\Radio\CHIRP\.tox\driver
driver inst: C:\Projects\Radio\CHIRP\.tox\dist\UNKNOWN-0.0.0.zip
ERROR: invocation failed (exit code 1), logfile: C:\Projects\Radio\CHIRP\.tox\driver\log\driver-1.log
ERROR: actionid: driver
msg: installpkg
cmdargs: ['C:\\Projects\\Radio\\CHIRP\\.tox\\driver\\Scripts\\pip.EXE', 'install', 'C:\\Projects\\Radio\\CHIRP\\.tox\\dist\\UNKNOWN-0.0.0.zip']

Processing c:\projects\radio\chirp\.tox\dist\unknown-0.0.0.zip
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "c:\users\ericc\appdata\local\temp\pip-bb4ox5-build\setup.py", line 5, in <module>
        from chirp import CHIRP_VERSION
    ImportError: No module named chirp
    
    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in c:\users\ericc\appdata\local\temp\pip-bb4ox5-build\

driver installed: libxml2-python==2.7.7,mox==0.5.3,pep8==1.7.1,pluggy==0.6.0,py==1.5.2,py2exe==0.6.9,pycairo==1.8.10,pygobject==2.28.3,pygtk==2.24.0,pyserial==2.7,pywin32==221,six==1.11.0,tox==2.9.1,virtualenv==15.1.0
style create: C:\Projects\Radio\CHIRP\.tox\style
style installdeps: pep8==1.6.2
style inst: C:\Projects\Radio\CHIRP\.tox\dist\UNKNOWN-0.0.0.zip
ERROR: invocation failed (exit code 1), logfile: C:\Projects\Radio\CHIRP\.tox\style\log\style-2.log
ERROR: actionid: style
msg: installpkg
cmdargs: ['C:\\Projects\\Radio\\CHIRP\\.tox\\style\\Scripts\\pip.EXE', 'install', 'C:\\Projects\\Radio\\CHIRP\\.tox\\dist\\UNKNOWN-0.0.0.zip']

Processing c:\projects\radio\chirp\.tox\dist\unknown-0.0.0.zip
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "c:\users\ericc\appdata\local\temp\pip-iabo4i-build\setup.py", line 5, in <module>
        from chirp import CHIRP_VERSION
    ImportError: No module named chirp
    
    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in c:\users\ericc\appdata\local\temp\pip-iabo4i-build\

style installed: libxml2-python==2.7.7,mox==0.5.3,pep8==1.6.2,pluggy==0.6.0,py==1.5.2,py2exe==0.6.9,pycairo==1.8.10,pygobject==2.28.3,pygtk==2.24.0,pyserial==2.7,pywin32==221,six==1.11.0,tox==2.9.1,virtualenv==15.1.0
___________________________________ summary ___________________________________
ERROR:   unit: InvocationError: C:\Projects\Radio\CHIRP\.tox\unit\Scripts\pip.EXE install C:\Projects\Radio\CHIRP\.tox\dist\UNKNOWN-0.0.0.zip (see C:\Projects\Radio\CHIRP\.tox\unit\log\unit-2.log)
ERROR:   driver: InvocationError: C:\Projects\Radio\CHIRP\.tox\driver\Scripts\pip.EXE install C:\Projects\Radio\CHIRP\.tox\dist\UNKNOWN-0.0.0.zip (see C:\Projects\Radio\CHIRP\.tox\driver\log\driver-1.log)
ERROR:   style: InvocationError: C:\Projects\Radio\CHIRP\.tox\style\Scripts\pip.EXE install C:\Projects\Radio\CHIRP\.tox\dist\UNKNOWN-0.0.0.zip (see C:\Projects\Radio\CHIRP\.tox\style\log\style-2.log)
-------------- next part --------------
actionid: unit
msg: getenv
cmdargs: ['c:\\python27\\python.exe', '-m', 'virtualenv', '--system-site-packages', '--python', 'c:\\python27\\python.exe', 'unit']

Already using interpreter c:\python27\python.exe
New python executable in C:\Projects\Radio\CHIRP\.tox\unit\Scripts\python.exe
Installing setuptools, pip, wheel...done.
-------------- next part --------------
actionid: unit
msg: getenv
cmdargs: ['C:\\Projects\\Radio\\CHIRP\\.tox\\unit\\Scripts\\pip.EXE', 'install', 'nose']

Collecting nose
  Using cached nose-1.3.7-py2-none-any.whl
Installing collected packages: nose
Successfully installed nose-1.3.7
-------------- next part --------------
actionid: unit
msg: installpkg
cmdargs: ['C:\\Projects\\Radio\\CHIRP\\.tox\\unit\\Scripts\\pip.EXE', 'install', 'C:\\Projects\\Radio\\CHIRP\\.tox\\dist\\UNKNOWN-0.0.0.zip']

Processing c:\projects\radio\chirp\.tox\dist\unknown-0.0.0.zip
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "c:\users\ericc\appdata\local\temp\pip-jgef7j-build\setup.py", line 5, in <module>
        from chirp import CHIRP_VERSION
    ImportError: No module named chirp
    
    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in c:\users\ericc\appdata\local\temp\pip-jgef7j-build\
-------------- next part --------------
actionid: unit
msg: envreport
cmdargs: ['C:\\Projects\\Radio\\CHIRP\\.tox\\unit\\Scripts\\pip.EXE', 'freeze']

libxml2-python==2.7.7
mox==0.5.3
nose==1.3.7
pep8==1.7.1
pluggy==0.6.0
py==1.5.2
py2exe==0.6.9
pycairo==1.8.10
pygobject==2.28.3
pygtk==2.24.0
pyserial==2.7
pywin32==221
six==1.11.0
tox==2.9.1
virtualenv==15.1.0
-------------- next part --------------
actionid: tox
msg: packaging
cmdargs: ['c:\\python27\\python.exe', local('C:\\Projects\\Radio\\CHIRP\\setup.py'), 'sdist', '--formats=zip', '--dist-dir', local('C:\\Projects\\Radio\\CHIRP\\.tox\\dist')]

Set chirp/__init__.py::__all__ = ['bandplan', 'bandplan_au', 'bandplan_iaru_r1', 'bandplan_iaru_r2', 'bandplan_iaru_r3', 'bandplan_na', 'bitwise', 'bitwise_grammar', 'chirp_common', 'detect', 'directory', 'dmrmarc', 'elib_intl', 'errors', 'import_logic', 'logger', 'memmap', 'platform', 'pyPEG', 'radioreference', 'settings', 'util', 'xml_ll']
Set chirp/drivers/__init__.py::__all__ = ['alinco', 'anytone', 'anytone_ht', 'ap510', 'baofeng_common', 'baofeng_uv3r', 'baofeng_wp970i', 'bj9900', 'bjuv55', 'btech', 'fd268', 'ft1802', 'ft1d', 'ft2800', 'ft2900', 'ft2d', 'ft50', 'ft60', 'ft7800', 'ft8100', 'ft817', 'ft857', 'ft90', 'ftm3200d', 'ftm350', 'generic_csv', 'generic_tpe', 'generic_xml', 'gmrsuv1', 'h777', 'hobbypcb', 'ic208', 'ic2100', 'ic2200', 'ic2300', 'ic2720', 'ic2820', 'ic9x', 'ic9x_icf', 'ic9x_icf_ll', 'ic9x_ll', 'icf', 'icomciv', 'icp7', 'icq7', 'ict70', 'ict7h', 'ict8', 'icw32', 'icx8x', 'icx8x_ll', 'id31', 'id51', 'id51plus', 'id800', 'id880', 'idrp', 'kenwood_hmk', 'kenwood_itm', 'kenwood_live', 'kguv8d', 'kguv8dplus', 'kyd', 'kyd_IP620', 'leixen', 'lt725uv', 'puxing', 'puxing_px888k', 'radtel_t18', 'repeaterbook', 'retevis_rt1', 'retevis_rt21', 'retevis_rt22', 'retevis_rt23', 'rfinder', 'rh5r_v2', 'tdxone_tdq8a', 'template', 'th7800', 'th9000', 'th9800', 'th_uv3r', 'th_uv3r25', 'th_uvf8d', 'thd72', 'thuv1f', 'tk270', 'tk760', 'tk760g', 'tk8102', 'tmv71', 'tmv71_ll', 'ts2000', 'uv5r', 'uv5x3', 'uv6r', 'uvb5', 'vgc', 'vx170', 'vx2', 'vx3', 'vx5', 'vx510', 'vx6', 'vx7', 'vx8', 'vxa700', 'wouxun', 'wouxun_common', 'yaesu_clone']
running sdist
running check
warning: check: missing required meta-data: name, version, url

warning: check: missing meta-data: either (author and author_email) or (maintainer and maintainer_email) must be supplied

warning: sdist: standard file not found: should have one of README, README.txt

reading manifest template 'MANIFEST.in'
writing manifest file 'MANIFEST'
creating UNKNOWN-0.0.0
creating UNKNOWN-0.0.0\share
creating UNKNOWN-0.0.0\stock_configs
copying files to UNKNOWN-0.0.0...
copying COPYING -> UNKNOWN-0.0.0
copying chirp.xsd -> UNKNOWN-0.0.0
copying chirp_banks.xsd -> UNKNOWN-0.0.0
copying chirp_memory.xsd -> UNKNOWN-0.0.0
copying setup.cfg -> UNKNOWN-0.0.0
copying setup.py -> UNKNOWN-0.0.0
copying share\chirp.desktop -> UNKNOWN-0.0.0\share
copying share\chirp.png -> UNKNOWN-0.0.0\share
copying share\chirpw.1 -> UNKNOWN-0.0.0\share
copying stock_configs\DE Freenet Frequencies.csv -> UNKNOWN-0.0.0\stock_configs
copying stock_configs\EU LPD and PMR Channels.csv -> UNKNOWN-0.0.0\stock_configs
copying stock_configs\FR Marine VHF Channels.csv -> UNKNOWN-0.0.0\stock_configs
copying stock_configs\KDR444.csv -> UNKNOWN-0.0.0\stock_configs
copying stock_configs\NOAA Weather Alert.csv -> UNKNOWN-0.0.0\stock_configs
copying stock_configs\UK Business Radio Simple Light Frequencies.csv -> UNKNOWN-0.0.0\stock_configs
copying stock_configs\US 60 meter channels (Center).csv -> UNKNOWN-0.0.0\stock_configs
copying stock_configs\US 60 meter channels (Dial).csv -> UNKNOWN-0.0.0\stock_configs
copying stock_configs\US CA Railroad Channels.csv -> UNKNOWN-0.0.0\stock_configs
copying stock_configs\US Calling Frequencies.csv -> UNKNOWN-0.0.0\stock_configs
copying stock_configs\US FRS and GMRS Channels.csv -> UNKNOWN-0.0.0\stock_configs
copying stock_configs\US MURS Channels.csv -> UNKNOWN-0.0.0\stock_configs
copying stock_configs\US Marine VHF Channels.csv -> UNKNOWN-0.0.0\stock_configs
creating C:\Projects\Radio\CHIRP\.tox\dist
creating 'C:\Projects\Radio\CHIRP\.tox\dist\UNKNOWN-0.0.0.zip' and adding 'UNKNOWN-0.0.0' to it
adding 'UNKNOWN-0.0.0\chirp.xsd'
adding 'UNKNOWN-0.0.0\chirp_banks.xsd'
adding 'UNKNOWN-0.0.0\chirp_memory.xsd'
adding 'UNKNOWN-0.0.0\COPYING'
adding 'UNKNOWN-0.0.0\PKG-INFO'
adding 'UNKNOWN-0.0.0\setup.cfg'
adding 'UNKNOWN-0.0.0\setup.py'
adding 'UNKNOWN-0.0.0\share\chirp.desktop'
adding 'UNKNOWN-0.0.0\share\chirp.png'
adding 'UNKNOWN-0.0.0\share\chirpw.1'
adding 'UNKNOWN-0.0.0\stock_configs\DE Freenet Frequencies.csv'
adding 'UNKNOWN-0.0.0\stock_configs\EU LPD and PMR Channels.csv'
adding 'UNKNOWN-0.0.0\stock_configs\FR Marine VHF Channels.csv'
adding 'UNKNOWN-0.0.0\stock_configs\KDR444.csv'
adding 'UNKNOWN-0.0.0\stock_configs\NOAA Weather Alert.csv'
adding 'UNKNOWN-0.0.0\stock_configs\UK Business Radio Simple Light Frequencies.csv'
adding 'UNKNOWN-0.0.0\stock_configs\US 60 meter channels (Center).csv'
adding 'UNKNOWN-0.0.0\stock_configs\US 60 meter channels (Dial).csv'
adding 'UNKNOWN-0.0.0\stock_configs\US CA Railroad Channels.csv'
adding 'UNKNOWN-0.0.0\stock_configs\US Calling Frequencies.csv'
adding 'UNKNOWN-0.0.0\stock_configs\US FRS and GMRS Channels.csv'
adding 'UNKNOWN-0.0.0\stock_configs\US Marine VHF Channels.csv'
adding 'UNKNOWN-0.0.0\stock_configs\US MURS Channels.csv'
removing 'UNKNOWN-0.0.0' (and everything under it)


More information about the chirp_devel mailing list