Ran black, updated to pylint 2.x
This commit is contained in:
parent
0d615c4323
commit
dd954e8531
5 changed files with 205 additions and 121 deletions
2
.github/workflows/build.yml
vendored
2
.github/workflows/build.yml
vendored
|
|
@ -40,7 +40,7 @@ jobs:
|
|||
source actions-ci/install.sh
|
||||
- name: Pip install pylint, black, & Sphinx
|
||||
run: |
|
||||
pip install --force-reinstall pylint==1.9.2 black==19.10b0 Sphinx sphinx-rtd-theme
|
||||
pip install pylint black==19.10b0 Sphinx sphinx-rtd-theme
|
||||
- name: Library version
|
||||
run: git describe --dirty --always --tags
|
||||
- name: PyLint
|
||||
|
|
|
|||
16
.pylintrc
16
.pylintrc
|
|
@ -18,6 +18,7 @@ ignore-patterns=
|
|||
#init-hook=
|
||||
|
||||
# Use multiple processes to speed up Pylint.
|
||||
# jobs=1
|
||||
jobs=2
|
||||
|
||||
# List of plugins (as comma separated values of python modules names) to load,
|
||||
|
|
@ -50,7 +51,8 @@ confidence=
|
|||
# --enable=similarities". If you want to run only the classes checker, but have
|
||||
# no Warning level messages displayed, use"--disable=all --enable=classes
|
||||
# --disable=W"
|
||||
disable=print-statement,parameter-unpacking,unpacking-in-except,old-raise-syntax,backtick,long-suffix,old-ne-operator,old-octal-literal,import-star-module-level,raw-checker-failed,bad-inline-option,locally-disabled,locally-enabled,file-ignored,suppressed-message,useless-suppression,deprecated-pragma,apply-builtin,basestring-builtin,buffer-builtin,cmp-builtin,coerce-builtin,execfile-builtin,file-builtin,long-builtin,raw_input-builtin,reduce-builtin,standarderror-builtin,unicode-builtin,xrange-builtin,coerce-method,delslice-method,getslice-method,setslice-method,no-absolute-import,old-division,dict-iter-method,dict-view-method,next-method-called,metaclass-assignment,indexing-exception,raising-string,reload-builtin,oct-method,hex-method,nonzero-method,cmp-method,input-builtin,round-builtin,intern-builtin,unichr-builtin,map-builtin-not-iterating,zip-builtin-not-iterating,range-builtin-not-iterating,filter-builtin-not-iterating,using-cmp-argument,eq-without-hash,div-method,idiv-method,rdiv-method,exception-message-attribute,invalid-str-codec,sys-max-int,bad-python3-import,deprecated-string-function,deprecated-str-translate-call,import-error
|
||||
# disable=import-error,print-statement,parameter-unpacking,unpacking-in-except,old-raise-syntax,backtick,long-suffix,old-ne-operator,old-octal-literal,import-star-module-level,raw-checker-failed,bad-inline-option,locally-disabled,locally-enabled,file-ignored,suppressed-message,useless-suppression,deprecated-pragma,apply-builtin,basestring-builtin,buffer-builtin,cmp-builtin,coerce-builtin,execfile-builtin,file-builtin,long-builtin,raw_input-builtin,reduce-builtin,standarderror-builtin,unicode-builtin,xrange-builtin,coerce-method,delslice-method,getslice-method,setslice-method,no-absolute-import,old-division,dict-iter-method,dict-view-method,next-method-called,metaclass-assignment,indexing-exception,raising-string,reload-builtin,oct-method,hex-method,nonzero-method,cmp-method,input-builtin,round-builtin,intern-builtin,unichr-builtin,map-builtin-not-iterating,zip-builtin-not-iterating,range-builtin-not-iterating,filter-builtin-not-iterating,using-cmp-argument,eq-without-hash,div-method,idiv-method,rdiv-method,exception-message-attribute,invalid-str-codec,sys-max-int,bad-python3-import,deprecated-string-function,deprecated-str-translate-call
|
||||
disable=print-statement,parameter-unpacking,unpacking-in-except,old-raise-syntax,backtick,long-suffix,old-ne-operator,old-octal-literal,import-star-module-level,raw-checker-failed,bad-inline-option,locally-disabled,locally-enabled,file-ignored,suppressed-message,useless-suppression,deprecated-pragma,apply-builtin,basestring-builtin,buffer-builtin,cmp-builtin,coerce-builtin,execfile-builtin,file-builtin,long-builtin,raw_input-builtin,reduce-builtin,standarderror-builtin,unicode-builtin,xrange-builtin,coerce-method,delslice-method,getslice-method,setslice-method,no-absolute-import,old-division,dict-iter-method,dict-view-method,next-method-called,metaclass-assignment,indexing-exception,raising-string,reload-builtin,oct-method,hex-method,nonzero-method,cmp-method,input-builtin,round-builtin,intern-builtin,unichr-builtin,map-builtin-not-iterating,zip-builtin-not-iterating,range-builtin-not-iterating,filter-builtin-not-iterating,using-cmp-argument,eq-without-hash,div-method,idiv-method,rdiv-method,exception-message-attribute,invalid-str-codec,sys-max-int,bad-python3-import,deprecated-string-function,deprecated-str-translate-call,import-error,bad-continuation
|
||||
|
||||
# Enable the message, report, category or checker with the given id(s). You can
|
||||
# either give multiple identifier separated by comma (,) or put this option
|
||||
|
|
@ -117,7 +119,8 @@ spelling-store-unknown-words=no
|
|||
[MISCELLANEOUS]
|
||||
|
||||
# List of note tags to take in consideration, separated by a comma.
|
||||
notes=FIXME,XXX,TODO
|
||||
# notes=FIXME,XXX,TODO
|
||||
notes=FIXME,XXX
|
||||
|
||||
|
||||
[TYPECHECK]
|
||||
|
|
@ -200,6 +203,7 @@ redefining-builtins-modules=six.moves,future.builtins
|
|||
[FORMAT]
|
||||
|
||||
# Expected format of line ending, e.g. empty (any line ending), LF or CRLF.
|
||||
# expected-line-ending-format=
|
||||
expected-line-ending-format=LF
|
||||
|
||||
# Regexp for a line that is allowed to be longer than the limit.
|
||||
|
|
@ -272,9 +276,11 @@ class-attribute-name-hint=([A-Za-z_][A-Za-z0-9_]{2,30}|(__.*__))$
|
|||
class-attribute-rgx=([A-Za-z_][A-Za-z0-9_]{2,30}|(__.*__))$
|
||||
|
||||
# Naming hint for class names
|
||||
# class-name-hint=[A-Z_][a-zA-Z0-9]+$
|
||||
class-name-hint=[A-Z_][a-zA-Z0-9_]+$
|
||||
|
||||
# Regular expression matching correct class names
|
||||
# class-rgx=[A-Z_][a-zA-Z0-9]+$
|
||||
class-rgx=[A-Z_][a-zA-Z0-9_]+$
|
||||
|
||||
# Naming hint for constant names
|
||||
|
|
@ -294,7 +300,8 @@ function-name-hint=(([a-z][a-z0-9_]{2,30})|(_[a-z0-9_]*))$
|
|||
function-rgx=(([a-z][a-z0-9_]{2,30})|(_[a-z0-9_]*))$
|
||||
|
||||
# Good variable names which should always be accepted, separated by a comma
|
||||
good-names=r,g,b,i,j,k,n,ex,Run,_
|
||||
# good-names=i,j,k,ex,Run,_
|
||||
good-names=r,g,b,w,i,j,k,n,x,y,z,ex,ok,Run,_
|
||||
|
||||
# Include a hint for the correct naming format with invalid-name
|
||||
include-naming-hint=no
|
||||
|
|
@ -391,6 +398,7 @@ valid-metaclass-classmethod-first-arg=mcs
|
|||
max-args=5
|
||||
|
||||
# Maximum number of attributes for a class (see R0902).
|
||||
# max-attributes=7
|
||||
max-attributes=11
|
||||
|
||||
# Maximum number of boolean expressions in a if statement
|
||||
|
|
@ -415,7 +423,7 @@ max-returns=6
|
|||
max-statements=50
|
||||
|
||||
# Minimum number of public methods for a class (see R0903).
|
||||
min-public-methods=2
|
||||
min-public-methods=1
|
||||
|
||||
|
||||
[EXCEPTIONS]
|
||||
|
|
|
|||
|
|
@ -50,6 +50,7 @@ Implementation Notes
|
|||
import time
|
||||
import math
|
||||
from micropython import const
|
||||
|
||||
try:
|
||||
import struct
|
||||
except ImportError:
|
||||
|
|
@ -86,20 +87,49 @@ _BME680_FILTERSIZES = (0, 1, 3, 7, 15, 31, 63, 127)
|
|||
|
||||
_BME680_RUNGAS = const(0x10)
|
||||
|
||||
_LOOKUP_TABLE_1 = (2147483647.0, 2147483647.0, 2147483647.0, 2147483647.0, 2147483647.0,
|
||||
2126008810.0, 2147483647.0, 2130303777.0, 2147483647.0, 2147483647.0,
|
||||
2143188679.0, 2136746228.0, 2147483647.0, 2126008810.0, 2147483647.0,
|
||||
2147483647.0)
|
||||
_LOOKUP_TABLE_1 = (
|
||||
2147483647.0,
|
||||
2147483647.0,
|
||||
2147483647.0,
|
||||
2147483647.0,
|
||||
2147483647.0,
|
||||
2126008810.0,
|
||||
2147483647.0,
|
||||
2130303777.0,
|
||||
2147483647.0,
|
||||
2147483647.0,
|
||||
2143188679.0,
|
||||
2136746228.0,
|
||||
2147483647.0,
|
||||
2126008810.0,
|
||||
2147483647.0,
|
||||
2147483647.0,
|
||||
)
|
||||
|
||||
_LOOKUP_TABLE_2 = (4096000000.0, 2048000000.0, 1024000000.0, 512000000.0, 255744255.0, 127110228.0,
|
||||
64000000.0, 32258064.0, 16016016.0, 8000000.0, 4000000.0, 2000000.0, 1000000.0,
|
||||
500000.0, 250000.0, 125000.0)
|
||||
_LOOKUP_TABLE_2 = (
|
||||
4096000000.0,
|
||||
2048000000.0,
|
||||
1024000000.0,
|
||||
512000000.0,
|
||||
255744255.0,
|
||||
127110228.0,
|
||||
64000000.0,
|
||||
32258064.0,
|
||||
16016016.0,
|
||||
8000000.0,
|
||||
4000000.0,
|
||||
2000000.0,
|
||||
1000000.0,
|
||||
500000.0,
|
||||
250000.0,
|
||||
125000.0,
|
||||
)
|
||||
|
||||
|
||||
def _read24(arr):
|
||||
"""Parse an unsigned 24-bit value as a floating point and return it."""
|
||||
ret = 0.0
|
||||
#print([hex(i) for i in arr])
|
||||
# print([hex(i) for i in arr])
|
||||
for b in arr:
|
||||
ret *= 256.0
|
||||
ret += float(b & 0xFF)
|
||||
|
|
@ -111,6 +141,7 @@ class Adafruit_BME680:
|
|||
|
||||
:param int refresh_rate: Maximum number of readings per second. Faster property reads
|
||||
will be from the previous reading."""
|
||||
|
||||
def __init__(self, *, refresh_rate=10):
|
||||
"""Check the BME680 was found, read the coefficients and enable the sensor for continuous
|
||||
reads."""
|
||||
|
|
@ -120,7 +151,7 @@ class Adafruit_BME680:
|
|||
# Check device ID.
|
||||
chip_id = self._read_byte(_BME680_REG_CHIPID)
|
||||
if chip_id != _BME680_CHIPID:
|
||||
raise RuntimeError('Failed to find BME680! Chip ID 0x%x' % chip_id)
|
||||
raise RuntimeError("Failed to find BME680! Chip ID 0x%x" % chip_id)
|
||||
|
||||
self._read_calibration()
|
||||
|
||||
|
|
@ -199,7 +230,7 @@ class Adafruit_BME680:
|
|||
def temperature(self):
|
||||
"""The compensated temperature in degrees celsius."""
|
||||
self._perform_reading()
|
||||
calc_temp = (((self._t_fine * 5) + 128) / 256)
|
||||
calc_temp = ((self._t_fine * 5) + 128) / 256
|
||||
return calc_temp / 100
|
||||
|
||||
@property
|
||||
|
|
@ -211,31 +242,49 @@ class Adafruit_BME680:
|
|||
var2 = (var2 * self._pressure_calibration[5]) / 4
|
||||
var2 = var2 + (var1 * self._pressure_calibration[4] * 2)
|
||||
var2 = (var2 / 4) + (self._pressure_calibration[3] * 65536)
|
||||
var1 = (((((var1 / 4) * (var1 / 4)) / 8192) *
|
||||
(self._pressure_calibration[2] * 32) / 8) +
|
||||
((self._pressure_calibration[1] * var1) / 2))
|
||||
var1 = (
|
||||
(((var1 / 4) * (var1 / 4)) / 8192)
|
||||
* (self._pressure_calibration[2] * 32)
|
||||
/ 8
|
||||
) + ((self._pressure_calibration[1] * var1) / 2)
|
||||
var1 = var1 / 262144
|
||||
var1 = ((32768 + var1) * self._pressure_calibration[0]) / 32768
|
||||
calc_pres = 1048576 - self._adc_pres
|
||||
calc_pres = (calc_pres - (var2 / 4096)) * 3125
|
||||
calc_pres = (calc_pres / var1) * 2
|
||||
var1 = (self._pressure_calibration[8] * (((calc_pres / 8) * (calc_pres / 8)) / 8192)) / 4096
|
||||
var1 = (
|
||||
self._pressure_calibration[8] * (((calc_pres / 8) * (calc_pres / 8)) / 8192)
|
||||
) / 4096
|
||||
var2 = ((calc_pres / 4) * self._pressure_calibration[7]) / 8192
|
||||
var3 = (((calc_pres / 256) ** 3) * self._pressure_calibration[9]) / 131072
|
||||
calc_pres += ((var1 + var2 + var3 + (self._pressure_calibration[6] * 128)) / 16)
|
||||
return calc_pres/100
|
||||
calc_pres += (var1 + var2 + var3 + (self._pressure_calibration[6] * 128)) / 16
|
||||
return calc_pres / 100
|
||||
|
||||
@property
|
||||
def humidity(self):
|
||||
"""The relative humidity in RH %"""
|
||||
self._perform_reading()
|
||||
temp_scaled = ((self._t_fine * 5) + 128) / 256
|
||||
var1 = ((self._adc_hum - (self._humidity_calibration[0] * 16)) -
|
||||
((temp_scaled * self._humidity_calibration[2]) / 200))
|
||||
var2 = (self._humidity_calibration[1] *
|
||||
(((temp_scaled * self._humidity_calibration[3]) / 100) +
|
||||
(((temp_scaled * ((temp_scaled * self._humidity_calibration[4]) / 100)) /
|
||||
64) / 100) + 16384)) / 1024
|
||||
var1 = (self._adc_hum - (self._humidity_calibration[0] * 16)) - (
|
||||
(temp_scaled * self._humidity_calibration[2]) / 200
|
||||
)
|
||||
var2 = (
|
||||
self._humidity_calibration[1]
|
||||
* (
|
||||
((temp_scaled * self._humidity_calibration[3]) / 100)
|
||||
+ (
|
||||
(
|
||||
(
|
||||
temp_scaled
|
||||
* ((temp_scaled * self._humidity_calibration[4]) / 100)
|
||||
)
|
||||
/ 64
|
||||
)
|
||||
/ 100
|
||||
)
|
||||
+ 16384
|
||||
)
|
||||
) / 1024
|
||||
var3 = var1 * var2
|
||||
var4 = self._humidity_calibration[5] * 128
|
||||
var4 = (var4 + ((temp_scaled * self._humidity_calibration[6]) / 100)) / 16
|
||||
|
|
@ -254,14 +303,16 @@ class Adafruit_BME680:
|
|||
def altitude(self):
|
||||
"""The altitude based on current ``pressure`` vs the sea level pressure
|
||||
(``sea_level_pressure``) - which you must enter ahead of time)"""
|
||||
pressure = self.pressure # in Si units for hPascal
|
||||
pressure = self.pressure # in Si units for hPascal
|
||||
return 44330 * (1.0 - math.pow(pressure / self.sea_level_pressure, 0.1903))
|
||||
|
||||
@property
|
||||
def gas(self):
|
||||
"""The gas resistance in ohms"""
|
||||
self._perform_reading()
|
||||
var1 = ((1340 + (5 * self._sw_err)) * (_LOOKUP_TABLE_1[self._gas_range])) / 65536
|
||||
var1 = (
|
||||
(1340 + (5 * self._sw_err)) * (_LOOKUP_TABLE_1[self._gas_range])
|
||||
) / 65536
|
||||
var2 = ((self._adc_gas * 32768) - 16777216) + var1
|
||||
var3 = (_LOOKUP_TABLE_2[self._gas_range] * var1) / 512
|
||||
calc_gas_res = (var3 + (var2 / 2)) / var2
|
||||
|
|
@ -276,8 +327,10 @@ class Adafruit_BME680:
|
|||
# set filter
|
||||
self._write(_BME680_REG_CONFIG, [self._filter << 2])
|
||||
# turn on temp oversample & pressure oversample
|
||||
self._write(_BME680_REG_CTRL_MEAS,
|
||||
[(self._temp_oversample << 5)|(self._pressure_oversample << 2)])
|
||||
self._write(
|
||||
_BME680_REG_CTRL_MEAS,
|
||||
[(self._temp_oversample << 5) | (self._pressure_oversample << 2)],
|
||||
)
|
||||
# turn on humidity oversample
|
||||
self._write(_BME680_REG_CTRL_HUM, [self._humidity_oversample])
|
||||
# gas measurements enabled
|
||||
|
|
@ -295,8 +348,8 @@ class Adafruit_BME680:
|
|||
|
||||
self._adc_pres = _read24(data[2:5]) / 16
|
||||
self._adc_temp = _read24(data[5:8]) / 16
|
||||
self._adc_hum = struct.unpack('>H', bytes(data[8:10]))[0]
|
||||
self._adc_gas = int(struct.unpack('>H', bytes(data[13:15]))[0] / 64)
|
||||
self._adc_hum = struct.unpack(">H", bytes(data[8:10]))[0]
|
||||
self._adc_gas = int(struct.unpack(">H", bytes(data[13:15]))[0] / 64)
|
||||
self._gas_range = data[14] & 0x0F
|
||||
|
||||
var1 = (self._adc_temp / 8) - (self._temp_calibration[0] * 2)
|
||||
|
|
@ -310,11 +363,13 @@ class Adafruit_BME680:
|
|||
coeff = self._read(_BME680_BME680_COEFF_ADDR1, 25)
|
||||
coeff += self._read(_BME680_BME680_COEFF_ADDR2, 16)
|
||||
|
||||
coeff = list(struct.unpack('<hbBHhbBhhbbHhhBBBHbbbBbHhbb', bytes(coeff[1:39])))
|
||||
#print("\n\n",coeff)
|
||||
coeff = list(struct.unpack("<hbBHhbBhhbbHhhBBBHbbbBbHhbb", bytes(coeff[1:39])))
|
||||
# print("\n\n",coeff)
|
||||
coeff = [float(i) for i in coeff]
|
||||
self._temp_calibration = [coeff[x] for x in [23, 0, 1]]
|
||||
self._pressure_calibration = [coeff[x] for x in [3, 4, 5, 7, 8, 10, 9, 12, 13, 14]]
|
||||
self._pressure_calibration = [
|
||||
coeff[x] for x in [3, 4, 5, 7, 8, 10, 9, 12, 13, 14]
|
||||
]
|
||||
self._humidity_calibration = [coeff[x] for x in [17, 16, 18, 19, 20, 21, 22]]
|
||||
self._gas_calibration = [coeff[x] for x in [25, 24, 26]]
|
||||
|
||||
|
|
@ -345,9 +400,13 @@ class Adafruit_BME680_I2C(Adafruit_BME680):
|
|||
:param bool debug: Print debug statements when True.
|
||||
:param int refresh_rate: Maximum number of readings per second. Faster property reads
|
||||
will be from the previous reading."""
|
||||
|
||||
def __init__(self, i2c, address=0x77, debug=False, *, refresh_rate=10):
|
||||
"""Initialize the I2C device at the 'address' given"""
|
||||
from adafruit_bus_device import i2c_device
|
||||
from adafruit_bus_device import ( # pylint: disable=import-outside-toplevel
|
||||
i2c_device,
|
||||
)
|
||||
|
||||
self._i2c = i2c_device.I2CDevice(i2c, address)
|
||||
self._debug = debug
|
||||
super().__init__(refresh_rate=refresh_rate)
|
||||
|
|
@ -386,30 +445,33 @@ class Adafruit_BME680_SPI(Adafruit_BME680):
|
|||
"""
|
||||
|
||||
def __init__(self, spi, cs, baudrate=100000, debug=False, *, refresh_rate=10):
|
||||
from adafruit_bus_device import spi_device
|
||||
from adafruit_bus_device import ( # pylint: disable=import-outside-toplevel
|
||||
spi_device,
|
||||
)
|
||||
|
||||
self._spi = spi_device.SPIDevice(spi, cs, baudrate=baudrate)
|
||||
self._debug = debug
|
||||
super().__init__(refresh_rate=refresh_rate)
|
||||
|
||||
def _read(self, register, length):
|
||||
if register != _BME680_REG_STATUS:
|
||||
#_BME680_REG_STATUS exists in both SPI memory pages
|
||||
#For all other registers, we must set the correct memory page
|
||||
# _BME680_REG_STATUS exists in both SPI memory pages
|
||||
# For all other registers, we must set the correct memory page
|
||||
self._set_spi_mem_page(register)
|
||||
|
||||
register = (register | 0x80) & 0xFF # Read single, bit 7 high.
|
||||
with self._spi as spi:
|
||||
spi.write(bytearray([register])) #pylint: disable=no-member
|
||||
spi.write(bytearray([register])) # pylint: disable=no-member
|
||||
result = bytearray(length)
|
||||
spi.readinto(result) #pylint: disable=no-member
|
||||
spi.readinto(result) # pylint: disable=no-member
|
||||
if self._debug:
|
||||
print("\t$%02X => %s" % (register, [hex(i) for i in result]))
|
||||
return result
|
||||
|
||||
def _write(self, register, values):
|
||||
if register != _BME680_REG_STATUS:
|
||||
#_BME680_REG_STATUS exists in both SPI memory pages
|
||||
#For all other registers, we must set the correct memory page
|
||||
# _BME680_REG_STATUS exists in both SPI memory pages
|
||||
# For all other registers, we must set the correct memory page
|
||||
self._set_spi_mem_page(register)
|
||||
register &= 0x7F # Write, bit 7 low.
|
||||
with self._spi as spi:
|
||||
|
|
@ -417,7 +479,7 @@ class Adafruit_BME680_SPI(Adafruit_BME680):
|
|||
for i, value in enumerate(values):
|
||||
buffer[2 * i] = register + i
|
||||
buffer[2 * i + 1] = value & 0xFF
|
||||
spi.write(buffer) #pylint: disable=no-member
|
||||
spi.write(buffer) # pylint: disable=no-member
|
||||
if self._debug:
|
||||
print("\t$%02X <= %s" % (values[0], [hex(i) for i in values[1:]]))
|
||||
|
||||
|
|
|
|||
114
docs/conf.py
114
docs/conf.py
|
|
@ -2,7 +2,8 @@
|
|||
|
||||
import os
|
||||
import sys
|
||||
sys.path.insert(0, os.path.abspath('..'))
|
||||
|
||||
sys.path.insert(0, os.path.abspath(".."))
|
||||
|
||||
# -- General configuration ------------------------------------------------
|
||||
|
||||
|
|
@ -10,34 +11,41 @@ sys.path.insert(0, os.path.abspath('..'))
|
|||
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
|
||||
# ones.
|
||||
extensions = [
|
||||
'sphinx.ext.autodoc',
|
||||
'sphinx.ext.intersphinx',
|
||||
'sphinx.ext.viewcode',
|
||||
"sphinx.ext.autodoc",
|
||||
"sphinx.ext.intersphinx",
|
||||
"sphinx.ext.viewcode",
|
||||
]
|
||||
|
||||
intersphinx_mapping = {'python': ('https://docs.python.org/3.4', None),'BusDevice': ('https://circuitpython.readthedocs.io/projects/busdevice/en/latest/', None),'CircuitPython': ('https://circuitpython.readthedocs.io/en/latest/', None)}
|
||||
intersphinx_mapping = {
|
||||
"python": ("https://docs.python.org/3.4", None),
|
||||
"BusDevice": (
|
||||
"https://circuitpython.readthedocs.io/projects/busdevice/en/latest/",
|
||||
None,
|
||||
),
|
||||
"CircuitPython": ("https://circuitpython.readthedocs.io/en/latest/", None),
|
||||
}
|
||||
|
||||
# Add any paths that contain templates here, relative to this directory.
|
||||
templates_path = ['_templates']
|
||||
templates_path = ["_templates"]
|
||||
|
||||
source_suffix = '.rst'
|
||||
source_suffix = ".rst"
|
||||
|
||||
# The master toctree document.
|
||||
master_doc = 'index'
|
||||
master_doc = "index"
|
||||
|
||||
# General information about the project.
|
||||
project = u'Adafruit BME680 Library'
|
||||
copyright = u'2017 ladyada'
|
||||
author = u'ladyada'
|
||||
project = u"Adafruit BME680 Library"
|
||||
copyright = u"2017 ladyada"
|
||||
author = u"ladyada"
|
||||
|
||||
# The version info for the project you're documenting, acts as replacement for
|
||||
# |version| and |release|, also used in various other places throughout the
|
||||
# built documents.
|
||||
#
|
||||
# The short X.Y version.
|
||||
version = u'1.0'
|
||||
version = u"1.0"
|
||||
# The full version, including alpha/beta/rc tags.
|
||||
release = u'1.0'
|
||||
release = u"1.0"
|
||||
|
||||
# The language for content autogenerated by Sphinx. Refer to documentation
|
||||
# for a list of supported languages.
|
||||
|
|
@ -49,7 +57,7 @@ language = None
|
|||
# List of patterns, relative to source directory, that match files and
|
||||
# directories to ignore when looking for source files.
|
||||
# This patterns also effect to html_static_path and html_extra_path
|
||||
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store', '.env', 'CODE_OF_CONDUCT.md']
|
||||
exclude_patterns = ["_build", "Thumbs.db", ".DS_Store", ".env", "CODE_OF_CONDUCT.md"]
|
||||
|
||||
# The reST default role (used for this markup: `text`) to use for all
|
||||
# documents.
|
||||
|
|
@ -61,7 +69,7 @@ default_role = "any"
|
|||
add_function_parentheses = True
|
||||
|
||||
# The name of the Pygments (syntax highlighting) style to use.
|
||||
pygments_style = 'sphinx'
|
||||
pygments_style = "sphinx"
|
||||
|
||||
# If true, `todo` and `todoList` produce output, else they produce nothing.
|
||||
todo_include_todos = False
|
||||
|
|
@ -75,59 +83,62 @@ todo_emit_warnings = True
|
|||
# The theme to use for HTML and HTML Help pages. See the documentation for
|
||||
# a list of builtin themes.
|
||||
#
|
||||
on_rtd = os.environ.get('READTHEDOCS', None) == 'True'
|
||||
on_rtd = os.environ.get("READTHEDOCS", None) == "True"
|
||||
|
||||
if not on_rtd: # only import and set the theme if we're building docs locally
|
||||
try:
|
||||
import sphinx_rtd_theme
|
||||
html_theme = 'sphinx_rtd_theme'
|
||||
html_theme_path = [sphinx_rtd_theme.get_html_theme_path(), '.']
|
||||
|
||||
html_theme = "sphinx_rtd_theme"
|
||||
html_theme_path = [sphinx_rtd_theme.get_html_theme_path(), "."]
|
||||
except:
|
||||
html_theme = 'default'
|
||||
html_theme_path = ['.']
|
||||
html_theme = "default"
|
||||
html_theme_path = ["."]
|
||||
else:
|
||||
html_theme_path = ['.']
|
||||
html_theme_path = ["."]
|
||||
|
||||
# Add any paths that contain custom static files (such as style sheets) here,
|
||||
# relative to this directory. They are copied after the builtin static files,
|
||||
# so a file named "default.css" will overwrite the builtin "default.css".
|
||||
html_static_path = ['_static']
|
||||
html_static_path = ["_static"]
|
||||
|
||||
# The name of an image file (relative to this directory) to use as a favicon of
|
||||
# the docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32
|
||||
# pixels large.
|
||||
#
|
||||
html_favicon = '_static/favicon.ico'
|
||||
html_favicon = "_static/favicon.ico"
|
||||
|
||||
# Output file base name for HTML help builder.
|
||||
htmlhelp_basename = 'AdafruitBME680Librarydoc'
|
||||
htmlhelp_basename = "AdafruitBME680Librarydoc"
|
||||
|
||||
# -- Options for LaTeX output ---------------------------------------------
|
||||
|
||||
latex_elements = {
|
||||
# The paper size ('letterpaper' or 'a4paper').
|
||||
#
|
||||
# 'papersize': 'letterpaper',
|
||||
|
||||
# The font size ('10pt', '11pt' or '12pt').
|
||||
#
|
||||
# 'pointsize': '10pt',
|
||||
|
||||
# Additional stuff for the LaTeX preamble.
|
||||
#
|
||||
# 'preamble': '',
|
||||
|
||||
# Latex figure (float) alignment
|
||||
#
|
||||
# 'figure_align': 'htbp',
|
||||
# The paper size ('letterpaper' or 'a4paper').
|
||||
#
|
||||
# 'papersize': 'letterpaper',
|
||||
# The font size ('10pt', '11pt' or '12pt').
|
||||
#
|
||||
# 'pointsize': '10pt',
|
||||
# Additional stuff for the LaTeX preamble.
|
||||
#
|
||||
# 'preamble': '',
|
||||
# Latex figure (float) alignment
|
||||
#
|
||||
# 'figure_align': 'htbp',
|
||||
}
|
||||
|
||||
# Grouping the document tree into LaTeX files. List of tuples
|
||||
# (source start file, target name, title,
|
||||
# author, documentclass [howto, manual, or own class]).
|
||||
latex_documents = [
|
||||
(master_doc, 'AdafruitBME680Library.tex', u'Adafruit BME680 Library Documentation',
|
||||
author, 'manual'),
|
||||
(
|
||||
master_doc,
|
||||
"AdafruitBME680Library.tex",
|
||||
u"Adafruit BME680 Library Documentation",
|
||||
author,
|
||||
"manual",
|
||||
),
|
||||
]
|
||||
|
||||
# -- Options for manual page output ---------------------------------------
|
||||
|
|
@ -135,8 +146,13 @@ latex_documents = [
|
|||
# One entry per manual page. List of tuples
|
||||
# (source start file, name, description, authors, manual section).
|
||||
man_pages = [
|
||||
(master_doc, 'adafruitBME680library', u'Adafruit BME680 Library Documentation',
|
||||
[author], 1)
|
||||
(
|
||||
master_doc,
|
||||
"adafruitBME680library",
|
||||
u"Adafruit BME680 Library Documentation",
|
||||
[author],
|
||||
1,
|
||||
)
|
||||
]
|
||||
|
||||
# -- Options for Texinfo output -------------------------------------------
|
||||
|
|
@ -145,7 +161,13 @@ man_pages = [
|
|||
# (source start file, target name, title, author,
|
||||
# dir menu entry, description, category)
|
||||
texinfo_documents = [
|
||||
(master_doc, 'AdafruitBME680Library', u'Adafruit BME680 Library Documentation',
|
||||
author, 'AdafruitBME680Library', 'One line description of project.',
|
||||
'Miscellaneous'),
|
||||
(
|
||||
master_doc,
|
||||
"AdafruitBME680Library",
|
||||
u"Adafruit BME680 Library Documentation",
|
||||
author,
|
||||
"AdafruitBME680Library",
|
||||
"One line description of project.",
|
||||
"Miscellaneous",
|
||||
),
|
||||
]
|
||||
|
|
|
|||
52
setup.py
52
setup.py
|
|
@ -7,6 +7,7 @@ https://github.com/pypa/sampleproject
|
|||
|
||||
# Always prefer setuptools over distutils
|
||||
from setuptools import setup, find_packages
|
||||
|
||||
# To use a consistent encoding
|
||||
from codecs import open
|
||||
from os import path
|
||||
|
|
@ -14,48 +15,39 @@ from os import path
|
|||
here = path.abspath(path.dirname(__file__))
|
||||
|
||||
# Get the long description from the README file
|
||||
with open(path.join(here, 'README.rst'), encoding='utf-8') as f:
|
||||
with open(path.join(here, "README.rst"), encoding="utf-8") as f:
|
||||
long_description = f.read()
|
||||
|
||||
setup(
|
||||
name='adafruit-circuitpython-bme680',
|
||||
|
||||
name="adafruit-circuitpython-bme680",
|
||||
use_scm_version=True,
|
||||
setup_requires=['setuptools_scm'],
|
||||
|
||||
description='CircuitPython library for BME680 temperature, pressure and humidity sensor.',
|
||||
setup_requires=["setuptools_scm"],
|
||||
description="CircuitPython library for BME680 temperature, pressure and humidity sensor.",
|
||||
long_description=long_description,
|
||||
long_description_content_type='text/x-rst',
|
||||
|
||||
long_description_content_type="text/x-rst",
|
||||
# The project's main homepage.
|
||||
url='https://github.com/adafruit/Adafruit_CircuitPython_BME680',
|
||||
|
||||
url="https://github.com/adafruit/Adafruit_CircuitPython_BME680",
|
||||
# Author details
|
||||
author='Adafruit Industries',
|
||||
author_email='circuitpython@adafruit.com',
|
||||
|
||||
install_requires=['Adafruit-Blinka', 'adafruit-circuitpython-busdevice'],
|
||||
|
||||
author="Adafruit Industries",
|
||||
author_email="circuitpython@adafruit.com",
|
||||
install_requires=["Adafruit-Blinka", "adafruit-circuitpython-busdevice"],
|
||||
# Choose your license
|
||||
license='MIT',
|
||||
|
||||
license="MIT",
|
||||
# See https://pypi.python.org/pypi?%3Aaction=list_classifiers
|
||||
classifiers=[
|
||||
'Development Status :: 3 - Alpha',
|
||||
'Intended Audience :: Developers',
|
||||
'Topic :: Software Development :: Libraries',
|
||||
'Topic :: System :: Hardware',
|
||||
'License :: OSI Approved :: MIT License',
|
||||
'Programming Language :: Python :: 3',
|
||||
'Programming Language :: Python :: 3.4',
|
||||
'Programming Language :: Python :: 3.5',
|
||||
"Development Status :: 3 - Alpha",
|
||||
"Intended Audience :: Developers",
|
||||
"Topic :: Software Development :: Libraries",
|
||||
"Topic :: System :: Hardware",
|
||||
"License :: OSI Approved :: MIT License",
|
||||
"Programming Language :: Python :: 3",
|
||||
"Programming Language :: Python :: 3.4",
|
||||
"Programming Language :: Python :: 3.5",
|
||||
],
|
||||
|
||||
# What does your project relate to?
|
||||
keywords='adafruit blinka circuitpython micropython bme680 hardware temperature pressure '
|
||||
'humidity gas',
|
||||
|
||||
keywords="adafruit blinka circuitpython micropython bme680 hardware temperature pressure "
|
||||
"humidity gas",
|
||||
# You can just specify the packages manually here if your project is
|
||||
# simple. Or you can use find_packages().
|
||||
py_modules=['adafruit_bme680'],
|
||||
py_modules=["adafruit_bme680"],
|
||||
)
|
||||
|
|
|
|||
Loading…
Reference in a new issue