module: support Python 3 only

This commit is contained in:
cn 2019-12-15 23:12:15 +01:00
parent 6df7edf079
commit 1a6ebcd15d
4 changed files with 4 additions and 5 deletions

View File

@ -16,7 +16,6 @@ jobs:
strategy:
matrix:
python-version:
- '2.7'
# Python 3.4 on GHA doesn't work due to fastdiff==0.2.0 failing with:
# pkg_resources.DistributionNotFound: The 'setuptools_scm>=1.15.0' distribution was not found and is required by the application
#- '3.4'

View File

@ -52,7 +52,7 @@ FILTER_8 = 0x03
FILTER_16 = 0x04 # and all higher
class Bme280(object): # pylint: disable=bad-option-value,useless-object-inheritance
class Bme280():
def __init__(self, i2c_bus=1, sensor_address=ADDR):
self.bus = smbus.SMBus(i2c_bus)
self.sensor_address = sensor_address
@ -179,7 +179,7 @@ class Bme280(object): # pylint: disable=bad-option-value,useless-object-inherit
for i in range(0xE1, 0xE1 + 7):
calibration_regs.append(self.bus.read_byte_data(self.sensor_address, i))
# pylint: disable=bad-whitespace
# pylint: disable=bad-option-value,bad-whitespace
# reorganize 8-bit words into compensation words (without correct sign)
self.digT = []

View File

@ -11,7 +11,7 @@ license = "MIT"
homepage = "https://dev.mycrobase.de/gitea/cn/python-bme280"
[tool.poetry.dependencies]
python = "^2.7 || ^3.4"
python = "^3.4"
smbus2 = "*"
[tool.poetry.dev-dependencies]

View File

@ -14,7 +14,7 @@ import bme280 # pylint: disable=wrong-import-position
# inspired by https://github.com/adafruit/Adafruit_Python_GPIO/blob/master/Adafruit_GPIO/I2C.py
class MockSMBus(object): # pylint: disable=bad-option-value,useless-object-inheritance
class MockSMBus():
def __init__(self, initial_read=None):
self._log = []
self.initial_read = initial_read or {}