File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -23,9 +23,10 @@ install:
2323 - set PATH=%PYTHON_INSTALL%\\Scripts;%PATH%
2424
2525 # We need to install the python-can library itself
26- - " python -m pip install .[test]"
26+ - " python -m pip install .[test,neovi ]"
2727
2828build : off
2929
3030test_script :
31- - " pytest -v --timeout=300"
31+ - " pytest -v --timeout=300 --cov=can"
32+ - " codecov"
Original file line number Diff line number Diff line change @@ -45,12 +45,12 @@ matrix:
4545
4646install :
4747 - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo bash test/open_vcan.sh ; fi
48- - travis_retry pip install .[test]
4948 - travis_retry pip install sphinx
49+ - travis_retry pip install .[test]
5050
5151script :
52- - pytest -v --timeout=300
52+ - pytest -v --timeout=300 --cov=can
53+ - codecov
5354 # Build Docs with Sphinx
54- #
5555 # -a Write all files
56- - if [[ "$TRAVIS_PYTHON_VERSION" == "3.6" ]]; then python -m sphinx -an doc build; fi
56+ - if [[ "$TRAVIS_PYTHON_VERSION" == "3.6" ]]; then python -m sphinx -an doc build; fi
Original file line number Diff line number Diff line change @@ -136,7 +136,7 @@ def get_serial_number(device):
136136 def shutdown (self ):
137137 super (NeoViBus , self ).shutdown ()
138138 ics .close_device (self .dev )
139-
139+
140140 @staticmethod
141141 def _detect_available_configs ():
142142 """Detect all configurations/channels that this interface could
@@ -148,10 +148,18 @@ def _detect_available_configs():
148148 """
149149 if ics is None :
150150 return []
151+
152+ try :
153+ devices = ics .find_devices ()
154+ except Exception as e :
155+ logger .debug ("Failed to detect configs: %s" , e )
156+ return []
157+
151158 # TODO: add the channel(s)
152159 return [{
160+ 'interface' : 'neovi' ,
153161 'serial' : NeoViBus .get_serial_number (device )
154- } for device in ics . find_devices () ]
162+ } for device in devices ]
155163
156164 def _find_device (self , type_filter = None , serial = None ):
157165 if type_filter is not None :
Original file line number Diff line number Diff line change 2020 long_description = f .read ()
2121
2222# Dependencies
23+ extras_require = {
24+ 'serial' : ['pyserial ~= 3.0' ],
25+ 'neovi' : ['python-ics >= 2.12' ]
26+ }
27+
2328tests_require = [
2429 'mock ~= 2.0' ,
25- 'nose ~= 1.3.7 ' ,
30+ 'nose ~= 1.3' ,
2631 'pytest ~= 3.6' ,
2732 'pytest-timeout ~= 1.2' ,
28- 'pyserial ~= 3.0'
29- ]
33+ 'pytest-cov ~= 2.5' ,
34+ 'codecov ~= 2.0'
35+ ] + extras_require ['serial' ]
36+
37+ extras_require ['test' ] = tests_require
3038
3139setup (
3240 # Description
5866 install_requires = [
5967 'wrapt ~= 1.10' ,
6068 ],
61- extras_require = {
62- 'serial' : ['pyserial >= 3.0' ],
63- 'neovi' : ['python-ics >= 2.12' ],
64- 'test' : tests_require
65- },
69+ extras_require = extras_require ,
6670
6771 # Testing
6872 test_suite = "nose.collector" ,
You can’t perform that action at this time.
0 commit comments