Compare commits

...

2 Commits

Author SHA1 Message Date
c4e253b4e0
tweak the debugging output of getting protobuf modules
Signed-off-by: Brian S. Stephan <bss@incorporeal.org>
2024-12-17 12:18:34 -06:00
1801f43d38
version bumps, which necessitated a small version update
for some reason the GUI pilot server for testing doesn't go to the end
of the input field for edits, so the things that backspaced over old
values need an extra 'end' keypress now. I didn't look into why this is,
because it's fine in the actual GUI regardless

Signed-off-by: Brian S. Stephan <bss@incorporeal.org>
2024-12-17 08:22:03 -06:00
4 changed files with 52 additions and 48 deletions

View File

@ -55,16 +55,18 @@ def get_config_pb2():
# try to just import a precompiled module if we have been given it in our path # try to just import a precompiled module if we have been given it in our path
# (perhaps someone already compiled it for us for whatever reason) # (perhaps someone already compiled it for us for whatever reason)
try: try:
logger.debug("Trying precompiled protobuf modules...")
return importlib.import_module('config_pb2') return importlib.import_module('config_pb2')
except ModuleNotFoundError: except ModuleNotFoundError:
# no found precompiled config, try to compile the proto files in realtime # no found precompiled config, try to compile the proto files in realtime
# because it's possible someone put them on the path # because it's possible someone put them on the path
try: try:
logger.info("Invoking gRPC tool to compile config.proto...") logger.debug("No precompiled protobuf modules found, invoking gRPC tool to compile config.proto...")
return grpc.protos('config.proto') return grpc.protos('config.proto')
except (ModuleNotFoundError, TypeError): except (ModuleNotFoundError, TypeError):
# (TypeError could be the windows bug https://github.com/protocolbuffers/protobuf/issues/14345) # (TypeError could be the windows bug https://github.com/protocolbuffers/protobuf/issues/14345)
# that failed, import the snapshot (may be lagging what's in GP2040-CE) # that failed, import the snapshot (may be lagging what's in GP2040-CE)
logger.warning("using the fallback .proto files! please supply your files with -P if you can!") logger.warning("using the fallback .proto files! please supply your files with -P if you can!")
sys.path.append(os.path.join(pathlib.Path(__file__).parent.resolve(), 'proto_snapshot')) sys.path.append(os.path.join(pathlib.Path(__file__).parent.resolve(), 'proto_snapshot'))
logger.debug("Invoking gRPC tool again to compile shipped config.proto...")
return grpc.protos('config.proto') return grpc.protos('config.proto')

View File

@ -4,22 +4,22 @@
# #
# pip-compile --extra=dev --output-file=requirements/requirements-dev.txt # pip-compile --extra=dev --output-file=requirements/requirements-dev.txt
# #
aiohappyeyeballs==2.4.2 aiohappyeyeballs==2.4.4
# via aiohttp # via aiohttp
aiohttp==3.10.8 aiohttp==3.11.10
# via # via
# aiohttp-jinja2 # aiohttp-jinja2
# textual-dev # textual-dev
# textual-serve # textual-serve
aiohttp-jinja2==1.6 aiohttp-jinja2==1.6
# via textual-serve # via textual-serve
aiosignal==1.3.1 aiosignal==1.3.2
# via aiohttp # via aiohttp
attrs==24.2.0 attrs==24.3.0
# via # via
# aiohttp # aiohttp
# reuse # reuse
bandit==1.7.10 bandit==1.8.0
# via gp2040ce-binary-tools (pyproject.toml) # via gp2040ce-binary-tools (pyproject.toml)
binaryornot==0.4.4 binaryornot==0.4.4
# via reuse # via reuse
@ -27,11 +27,11 @@ boolean-py==4.0
# via # via
# license-expression # license-expression
# reuse # reuse
build==1.2.2 build==1.2.2.post1
# via pip-tools # via pip-tools
cachetools==5.5.0 cachetools==5.5.0
# via tox # via tox
certifi==2024.8.30 certifi==2024.12.14
# via requests # via requests
cffi==1.17.1 cffi==1.17.1
# via cryptography # via cryptography
@ -40,21 +40,22 @@ chardet==5.2.0
# binaryornot # binaryornot
# python-debian # python-debian
# tox # tox
charset-normalizer==3.3.2 charset-normalizer==3.4.0
# via requests # via requests
click==8.1.7 click==8.1.7
# via # via
# pip-tools # pip-tools
# reuse
# textual-dev # textual-dev
colorama==0.4.6 colorama==0.4.6
# via tox # via tox
coverage[toml]==7.6.1 coverage[toml]==7.6.9
# via pytest-cov # via pytest-cov
cryptography==43.0.1 cryptography==44.0.0
# via secretstorage # via secretstorage
decorator==5.1.1 decorator==5.1.1
# via gp2040ce-binary-tools (pyproject.toml) # via gp2040ce-binary-tools (pyproject.toml)
distlib==0.3.8 distlib==0.3.9
# via virtualenv # via virtualenv
docutils==0.21.2 docutils==0.21.2
# via readme-renderer # via readme-renderer
@ -89,20 +90,18 @@ flake8-mutable==1.2.0
# via gp2040ce-binary-tools (pyproject.toml) # via gp2040ce-binary-tools (pyproject.toml)
flake8-pyproject==1.2.3 flake8-pyproject==1.2.3
# via gp2040ce-binary-tools (pyproject.toml) # via gp2040ce-binary-tools (pyproject.toml)
frozenlist==1.4.1 frozenlist==1.5.0
# via # via
# aiohttp # aiohttp
# aiosignal # aiosignal
grpcio==1.66.2 grpcio==1.68.1
# via grpcio-tools # via grpcio-tools
grpcio-tools==1.66.2 grpcio-tools==1.68.1
# via gp2040ce-binary-tools (pyproject.toml) # via gp2040ce-binary-tools (pyproject.toml)
idna==3.10 idna==3.10
# via # via
# requests # requests
# yarl # yarl
importlib-metadata==8.5.0
# via twine
iniconfig==2.0.0 iniconfig==2.0.0
# via pytest # via pytest
isort==5.13.2 isort==5.13.2
@ -122,9 +121,9 @@ jinja2==3.1.4
# aiohttp-jinja2 # aiohttp-jinja2
# reuse # reuse
# textual-serve # textual-serve
keyring==25.4.1 keyring==25.5.0
# via twine # via twine
license-expression==30.3.1 license-expression==30.4.0
# via reuse # via reuse
linkify-it-py==2.0.3 linkify-it-py==2.0.3
# via markdown-it-py # via markdown-it-py
@ -133,7 +132,7 @@ markdown-it-py[linkify,plugins]==3.0.0
# mdit-py-plugins # mdit-py-plugins
# rich # rich
# textual # textual
markupsafe==2.1.5 markupsafe==3.0.2
# via jinja2 # via jinja2
mccabe==0.7.0 mccabe==0.7.0
# via flake8 # via flake8
@ -151,24 +150,25 @@ multidict==6.1.0
# via # via
# aiohttp # aiohttp
# yarl # yarl
mypy==1.11.2 mypy==1.13.0
# via gp2040ce-binary-tools (pyproject.toml) # via gp2040ce-binary-tools (pyproject.toml)
mypy-extensions==1.0.0 mypy-extensions==1.0.0
# via mypy # via mypy
nh3==0.2.18 nh3==0.2.20
# via readme-renderer # via readme-renderer
packaging==24.1 packaging==24.2
# via # via
# build # build
# pyproject-api # pyproject-api
# pytest # pytest
# setuptools-scm # setuptools-scm
# tox # tox
# twine
pbr==6.1.0 pbr==6.1.0
# via stevedore # via stevedore
pip-tools==7.4.1 pip-tools==7.4.1
# via gp2040ce-binary-tools (pyproject.toml) # via gp2040ce-binary-tools (pyproject.toml)
pkginfo==1.10.0 pkginfo==1.12.0
# via twine # via twine
platformdirs==4.3.6 platformdirs==4.3.6
# via # via
@ -179,7 +179,11 @@ pluggy==1.5.0
# via # via
# pytest # pytest
# tox # tox
protobuf==5.28.2 propcache==0.2.1
# via
# aiohttp
# yarl
protobuf==5.29.1
# via grpcio-tools # via grpcio-tools
pycodestyle==2.12.1 pycodestyle==2.12.1
# via flake8 # via flake8
@ -199,14 +203,14 @@ pyproject-hooks==1.2.0
# via # via
# build # build
# pip-tools # pip-tools
pytest==8.3.3 pytest==8.3.4
# via # via
# gp2040ce-binary-tools (pyproject.toml) # gp2040ce-binary-tools (pyproject.toml)
# pytest-asyncio # pytest-asyncio
# pytest-cov # pytest-cov
pytest-asyncio==0.24.0 pytest-asyncio==0.25.0
# via gp2040ce-binary-tools (pyproject.toml) # via gp2040ce-binary-tools (pyproject.toml)
pytest-cov==5.0.0 pytest-cov==6.0.0
# via gp2040ce-binary-tools (pyproject.toml) # via gp2040ce-binary-tools (pyproject.toml)
python-debian==0.1.49 python-debian==0.1.49
# via reuse # via reuse
@ -222,11 +226,11 @@ requests==2.32.3
# twine # twine
requests-toolbelt==1.0.0 requests-toolbelt==1.0.0
# via twine # via twine
reuse==4.0.3 reuse==5.0.2
# via gp2040ce-binary-tools (pyproject.toml) # via gp2040ce-binary-tools (pyproject.toml)
rfc3986==2.0.0 rfc3986==2.0.0
# via twine # via twine
rich==13.8.1 rich==13.9.4
# via # via
# bandit # bandit
# textual # textual
@ -238,22 +242,22 @@ setuptools-scm==8.1.0
# via gp2040ce-binary-tools (pyproject.toml) # via gp2040ce-binary-tools (pyproject.toml)
snowballstemmer==2.2.0 snowballstemmer==2.2.0
# via pydocstyle # via pydocstyle
stevedore==5.3.0 stevedore==5.4.0
# via bandit # via bandit
textual==0.81.0 textual==1.0.0
# via # via
# gp2040ce-binary-tools (pyproject.toml) # gp2040ce-binary-tools (pyproject.toml)
# textual-dev # textual-dev
# textual-serve # textual-serve
textual-dev==1.6.1 textual-dev==1.7.0
# via gp2040ce-binary-tools (pyproject.toml) # via gp2040ce-binary-tools (pyproject.toml)
textual-serve==1.1.1 textual-serve==1.1.1
# via textual-dev # via textual-dev
tomlkit==0.13.2 tomlkit==0.13.2
# via reuse # via reuse
tox==4.20.0 tox==4.23.2
# via gp2040ce-binary-tools (pyproject.toml) # via gp2040ce-binary-tools (pyproject.toml)
twine==5.1.1 twine==6.0.1
# via gp2040ce-binary-tools (pyproject.toml) # via gp2040ce-binary-tools (pyproject.toml)
typing-extensions==4.12.2 typing-extensions==4.12.2
# via # via
@ -266,14 +270,12 @@ urllib3==2.2.3
# via # via
# requests # requests
# twine # twine
virtualenv==20.26.6 virtualenv==20.28.0
# via tox # via tox
wheel==0.44.0 wheel==0.45.1
# via pip-tools # via pip-tools
yarl==1.13.1 yarl==1.18.3
# via aiohttp # via aiohttp
zipp==3.20.2
# via importlib-metadata
# The following packages are considered to be unsafe in a requirements file: # The following packages are considered to be unsafe in a requirements file:
# pip # pip

View File

@ -4,9 +4,9 @@
# #
# pip-compile --output-file=requirements/requirements.txt # pip-compile --output-file=requirements/requirements.txt
# #
grpcio==1.66.2 grpcio==1.68.1
# via grpcio-tools # via grpcio-tools
grpcio-tools==1.66.2 grpcio-tools==1.68.1
# via gp2040ce-binary-tools (pyproject.toml) # via gp2040ce-binary-tools (pyproject.toml)
linkify-it-py==2.0.3 linkify-it-py==2.0.3
# via markdown-it-py # via markdown-it-py
@ -21,15 +21,15 @@ mdurl==0.1.2
# via markdown-it-py # via markdown-it-py
platformdirs==4.3.6 platformdirs==4.3.6
# via textual # via textual
protobuf==5.28.2 protobuf==5.29.1
# via grpcio-tools # via grpcio-tools
pygments==2.18.0 pygments==2.18.0
# via rich # via rich
pyusb==1.2.1 pyusb==1.2.1
# via gp2040ce-binary-tools (pyproject.toml) # via gp2040ce-binary-tools (pyproject.toml)
rich==13.8.1 rich==13.9.4
# via textual # via textual
textual==0.81.0 textual==1.0.0
# via gp2040ce-binary-tools (pyproject.toml) # via gp2040ce-binary-tools (pyproject.toml)
typing-extensions==4.12.2 typing-extensions==4.12.2
# via textual # via textual

View File

@ -119,7 +119,7 @@ async def test_simple_edit_via_input_field():
await pilot.wait_for_scheduled_animations() await pilot.wait_for_scheduled_animations()
await pilot.click('Input#field-input') await pilot.click('Input#field-input')
await pilot.wait_for_scheduled_animations() await pilot.wait_for_scheduled_animations()
await pilot.press('backspace', 'backspace', 'backspace', 'backspace', 'backspace', 'backspace', '5') await pilot.press('end', 'backspace', 'backspace', 'backspace', 'backspace', 'backspace', 'backspace', '5')
await pilot.wait_for_scheduled_animations() await pilot.wait_for_scheduled_animations()
await pilot.click('Button#confirm-button') await pilot.click('Button#confirm-button')
assert pilot.app.config.displayOptions.deprecatedI2cSpeed == 5 assert pilot.app.config.displayOptions.deprecatedI2cSpeed == 5
@ -199,7 +199,7 @@ async def test_simple_edit_via_input_field_string():
await pilot.wait_for_scheduled_animations() await pilot.wait_for_scheduled_animations()
await pilot.click('Input#field-input') await pilot.click('Input#field-input')
await pilot.wait_for_scheduled_animations() await pilot.wait_for_scheduled_animations()
await pilot.press('backspace', '-', 'h', 'i') await pilot.press('end', 'backspace', '-', 'h', 'i')
await pilot.wait_for_scheduled_animations() await pilot.wait_for_scheduled_animations()
await pilot.click('Button#confirm-button') await pilot.click('Button#confirm-button')
assert pilot.app.config.boardVersion == 'v0.7.-hi' assert pilot.app.config.boardVersion == 'v0.7.-hi'
@ -229,7 +229,7 @@ async def test_add_node_to_repeated():
await pilot.wait_for_scheduled_animations() await pilot.wait_for_scheduled_animations()
await pilot.click('Input#field-input') await pilot.click('Input#field-input')
await pilot.wait_for_scheduled_animations() await pilot.wait_for_scheduled_animations()
await pilot.press('backspace', 'backspace', 'backspace', 'backspace', 'backspace', 'backspace', '5') await pilot.press('end', 'backspace', 'backspace', 'backspace', 'backspace', 'backspace', 'backspace', '5')
await pilot.wait_for_scheduled_animations() await pilot.wait_for_scheduled_animations()
await pilot.click('Button#confirm-button') await pilot.click('Button#confirm-button')