From d8946eedd0f97aac31ccefa01df87314b058eba3 Mon Sep 17 00:00:00 2001 From: Patrick Baus Date: Wed, 14 Jul 2021 13:05:49 +0200 Subject: [PATCH] Added gpib-ctypes dependecy as an optional replacement for the linux-gpib python package --- async_gpib/async_gpib.py | 8 ++++++-- setup.py | 7 +++++-- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/async_gpib/async_gpib.py b/async_gpib/async_gpib.py index b1e5e6f..b894167 100644 --- a/async_gpib/async_gpib.py +++ b/async_gpib/async_gpib.py @@ -22,8 +22,12 @@ import logging # AsyncGpib -import Gpib -import gpib +try: + import Gpib + import gpib +except ModuleNotFoundError: + from gpib_ctypes import Gpib + from gpib_ctypes import gpib class AsyncGpib: @property diff --git a/setup.py b/setup.py index 1bb806e..5b081dc 100644 --- a/setup.py +++ b/setup.py @@ -5,7 +5,7 @@ setup( name='async_gpib', - version='1.0.0', + version='1.0.1', author='Patrick Baus', author_email='patrick.baus@physik.tu-darmstadt.de', url='https://github.com/PatrickBaus/pyAsyncGpib', @@ -23,5 +23,8 @@ license='GPL', license_files=('LICENSE',), packages=['async_gpib'], # same as name - install_requires=['gpib-ctypes',], # external packages as dependencies + install_requires=[], # external packages as dependencies + extras_require={ + 'GPIB': ['gpib-ctypes>=0.3',], + } )