Starting to work on #91, I realized that I miss a bunch of development environment goodies I'm used to when working on Python. This PR aims to fix that, without breaking anything else. The specific choices are subjective, open to "no, let's use X instead". To wit:
Poetry for package management (because it's the only Python package manager I've used that doesn't make me absolutely bloody furious)
Dockerfile updated to use the associated pyproject.toml
Configuration to make all of these play nice together, including with VSCode
I did touch the code a bit, namely:
Fixed lints (explicitly disabled 2 warnings that are unavoidable due to a library throwing a straight Exception)
Removed unused imports
Added a main function
Updated use of adafruit_dps310; a recent release split it into a adafruit_dps310.basic and adafruit_dps310.advanced version; former for low-memory environments. I guessed we can (and want) to use the advanced version, but this is trivial to change.
Note also: AFAICT the version for this was not pinned before, so I expect any new build without this change to fail at runtime on the import. Poetry includes version locking, so this PR also avoids problems like this in the future.
Added basic heuristic for finding the correct I2C bus depending on hardware (with an ENV var override)
Added an ENV var that can be used to skip sending to InfluxDB (to make deployment / running without InfluxDB credentials possible)
Starting to work on #91, I realized that I miss a bunch of development environment goodies I'm used to when working on Python. This PR aims to fix that, without breaking anything else. The specific choices are subjective, open to "no, let's use X instead". To wit:
Dockerfile
updated to use the associatedpyproject.toml
.gitignore
because obviouslyI did touch the code a bit, namely:
Exception
)main
functionadafruit_dps310
; a recent release split it into aadafruit_dps310.basic
andadafruit_dps310.advanced
version; former for low-memory environments. I guessed we can (and want) to use theadvanced
version, but this is trivial to change.