pimoroni / bme680-python

Python library for the BME680 gas, temperature, humidity and pressure sensor.
https://shop.pimoroni.com/products/bme680
MIT License
260 stars 93 forks source link

Add dependency: smbus2 #29

Closed NicolaiSoeborg closed 3 years ago

NicolaiSoeborg commented 4 years ago

Fixes:

>>> import bme680                                                                                                                                                                                          
>>> sensor = bme680.BME680(bme680.I2C_ADDR_PRIMARY)                                                                                                                                                        
Traceback (most recent call last):                                                                                                                                                                         
  File "<stdin>", line 1, in <module>                                                                                                                                                                      
  File "/usr/local/lib/python3.7/dist-packages/bme680/__init__.py", line 22, in __init__                                                                                                                   
    import smbus                                                                                                                                                                                           
ModuleNotFoundError: No module named 'smbus'                                                                                                                                                               
coveralls commented 4 years ago

Pull Request Test Coverage Report for Build 34


Totals Coverage Status
Change from base Build 31: 0.0%
Covered Lines: 396
Relevant Lines: 459

💛 - Coveralls
Gadgetoid commented 3 years ago

Thank you!

I tend to rely on "smbus" from apt since - despite maintaining the PyPI package I'm not sure how up-to-date it is with the officially distributed apt package. This is a pain because a PyPI package cannot specify an apt package as a dependency (without some horrible gymnastics that have no place in setup.py).

smbus2 doesn't provide the smbus package, but it might be appropriate to depend on smbus here since it seems to work fine and, god knows, I'm never going to be on the ball with fixing/updating it if nobody is using it.

So, TLDR: this should be "smbus" not "smbus2".

Gadgetoid commented 3 years ago

Thank you! Now we pray my smbus package isn't subtly broken in some way!