-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Provide a way to set environment variables outside of code.py #4212
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
It'll be simpler to support this through Also note the |
I had some notes on this, looked at other approaches, etc... might be helpful to look at before coding starts. https://gist.github.com/askpatrickw/610a83c489c6588055f6d1d3fd933fa7 |
os.getenv() will use it (when available) to load variables from /.env This will also be useful when we need secrets or config for CircuitPython outside of the VM (like WiFi credentials.) Fixes #4212
Formerly, py/formatfloat would print whole numbers inaccurately with nonzero digits beyond the decimal place. This resulted from its strategy of successive scaling of the argument by 0.1 which cannot be exactly represented in floating point. The change in this commit avoids scaling until the value is smaller than 1, so all whole numbers print with zero fractional part. Fixes issue adafruit#4212. Signed-off-by: Dan Ellis dan.ellis@gmail.com
Formerly, py/formatfloat would print whole numbers inaccurately with nonzero digits beyond the decimal place. This resulted from its strategy of successive scaling of the argument by 0.1 which cannot be exactly represented in floating point. The change in this commit avoids scaling until the value is smaller than 1, so all whole numbers print with zero fractional part. Fixes issue adafruit#4212. Signed-off-by: Dan Ellis dan.ellis@gmail.com
For anyone else arriving here, this appears to be replaced by settings.toml now - see https://learn.adafruit.com/scrolling-countdown-timer/create-your-settings-toml-file and https://docs.circuitpython.org/en/latest/docs/environment.html |
Once we have a way, we can replace
secrets.py
use with it.os.environ
is the common way for sharing secrets in CPython. For example, GitHub Actions secrets are provided as environment variables.The text was updated successfully, but these errors were encountered: