-
-
Notifications
You must be signed in to change notification settings - Fork 23
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
feat: add development flag to scripts/configure.py #511
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -882,7 +882,7 @@ def add_tests(env, progress) -> List[Task]: | |
|
||
def install(os_deps=True, python_deps=True, web=True, restart_updater=False, | ||
display=True, audiodetector=True, firmware=True, password=True, | ||
progress=print_task_results) -> bool: | ||
progress=print_task_results, development=False) -> bool: | ||
""" Install and configure AmpliPi's dependencies """ | ||
# pylint: disable=too-many-return-statements | ||
tasks = [Task('setup')] | ||
|
@@ -893,7 +893,7 @@ def failed(): | |
return False | ||
|
||
env = _check_and_setup_platform() | ||
if not env['platform_supported']: | ||
if not env['platform_supported'] and not development: | ||
tasks[0].output = f'untested platform: {platform.platform()}. Please fix this script and make a PR to github.com/micro-nova/AmpliPi' | ||
else: | ||
tasks[0].output = str(env) | ||
|
@@ -980,14 +980,18 @@ def failed(): | |
help="Flash the latest firmware") | ||
parser.add_argument('--password', action='store_true', default=False, | ||
help="Generate and set a new default password for the pi user.") | ||
parser.add_argument('--development', action='store_true', default=False, | ||
help="Enable development mode.") | ||
flags = parser.parse_args() | ||
print('Configuring AmpliPi installation') | ||
has_args = flags.python_deps or flags.os_deps or flags.web or flags.restart_updater or flags.display or flags.firmware | ||
if not has_args: | ||
print(' WARNING: expected some arguments, check --help for more information') | ||
if sys.version_info.major < 3 or sys.version_info.minor < 7: | ||
print(' WARNING: minimum python version is 3.7') | ||
install(os_deps=flags.os_deps, python_deps=flags.python_deps, web=flags.web, | ||
result = install(os_deps=flags.os_deps, python_deps=flags.python_deps, web=flags.web, | ||
display=flags.display, audiodetector=flags.audiodetector, | ||
firmware=flags.firmware, password=flags.password, | ||
restart_updater=flags.restart_updater) | ||
restart_updater=flags.restart_updater, development=flags.development) | ||
if not result: | ||
sys.exit(1) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. note to self: test that updater successfully restarts after this change, cuz it uses There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Subprocess only exceptions on non-zero exit when since our use of the Popen constructor is basically throwaway ("send the reboot command and return without waiting"), this seems safe. this also functioned correctly when I tested. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
note to self: numpy is imported to speed up rendering on the TFT display, as recommended by https://github.com/adafruit/Adafruit_CircuitPython_RGB_Display . it's only used a small handful of places here and without a version bound; validate all potential versions of numpy haven't substantially changed the functions used here: https://github.com/adafruit/Adafruit_CircuitPython_RGB_Display/blob/main/adafruit_rgb_display/rgb.py and also that the TFT display works well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The only code that uses numpy in the Adafruit library is here: https://github.com/adafruit/Adafruit_CircuitPython_RGB_Display/blob/8cfb0db7d36eb46ef1e2a575b03f5e630bfc2c94/adafruit_rgb_display/rgb.py#L68
The functions & methods in question are:
On first brush with the documentation, these seem well supported (indeed, foundational) from 1.21 thru 1.26, the latest numpy release.
This still probably deserves a run on a box with a TFT display to validate.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I validated this functions on a box with a TFT display.