Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions .appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,10 @@ install:
- set PATH=%PYTHON_INSTALL%\\Scripts;%PATH%

# We need to install the python-can library itself
- "python -m pip install .[test]"
- "python -m pip install .[test,neovi]"

build: off

test_script:
- "pytest -v --timeout=300"
- "pytest -v --timeout=300 --cov=can"
- "codecov"
8 changes: 4 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,12 @@ matrix:

install:
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo bash test/open_vcan.sh ; fi
- travis_retry pip install .[test]
- travis_retry pip install sphinx
- travis_retry pip install .[test]

script:
- pytest -v --timeout=300
- pytest -v --timeout=300 --cov=can
- codecov
# Build Docs with Sphinx
#
# -a Write all files
- if [[ "$TRAVIS_PYTHON_VERSION" == "3.6" ]]; then python -m sphinx -an doc build; fi
- if [[ "$TRAVIS_PYTHON_VERSION" == "3.6" ]]; then python -m sphinx -an doc build; fi
12 changes: 10 additions & 2 deletions can/interfaces/ics_neovi/neovi_bus.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ def get_serial_number(device):
def shutdown(self):
super(NeoViBus, self).shutdown()
ics.close_device(self.dev)

@staticmethod
def _detect_available_configs():
"""Detect all configurations/channels that this interface could
Expand All @@ -148,10 +148,18 @@ def _detect_available_configs():
"""
if ics is None:
return []

try:
devices = ics.find_devices()
except Exception as e:
logger.debug("Failed to detect configs: %s", e)
return []

# TODO: add the channel(s)
return [{
'interface': 'neovi',
'serial': NeoViBus.get_serial_number(device)
} for device in ics.find_devices()]
} for device in devices]

def _find_device(self, type_filter=None, serial=None):
if type_filter is not None:
Expand Down
20 changes: 12 additions & 8 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,21 @@
long_description = f.read()

# Dependencies
extras_require = {
'serial': ['pyserial ~= 3.0'],
'neovi': ['python-ics >= 2.12']
}

tests_require = [
'mock ~= 2.0',
'nose ~= 1.3.7',
'nose ~= 1.3',
'pytest ~= 3.6',
'pytest-timeout ~= 1.2',
'pyserial ~= 3.0'
]
'pytest-cov ~= 2.5',
'codecov ~= 2.0'
] + extras_require['serial']

extras_require['test'] = tests_require

setup(
# Description
Expand Down Expand Up @@ -58,11 +66,7 @@
install_requires=[
'wrapt ~= 1.10',
],
extras_require={
'serial': ['pyserial >= 3.0'],
'neovi': ['python-ics >= 2.12'],
'test': tests_require
},
extras_require=extras_require,

# Testing
test_suite="nose.collector",
Expand Down