33 Commits

Author SHA1 Message Date
Eric Callahan
db64bc02c8 pip_utils: upgrade existing packages during installation
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2025-01-24 05:22:46 -05:00
Eric Callahan
60c2bef474 async_serial: support for asyncio serial devices
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2025-01-13 11:13:41 -05:00
Eric Callahan
8debbf8ba4
source_info: resolve importlib_metadata compatibility issues
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2024-07-25 14:16:42 -04:00
Eric Callahan
17dc05c9b7 versions: expand support for Python Package Versions
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2024-07-24 07:37:08 -04:00
Eric Callahan
11d15f96d1 pip_utils: add async method to invoke pip directly
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2024-07-24 07:37:08 -04:00
Eric Callahan
ecb6ebcc18 pip_utils: bump pip version to 24.0.0
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2024-07-24 07:37:01 -04:00
Eric Callahan
a101815a47 utils: add support for extracting project dist info
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2024-07-24 06:29:59 -04:00
Eric Callahan
bc34ebdff9 filelock: fix lockfile cleanup
Python 3.7 does not support the "missing_ok" argument
in pathlib.unlink().

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2024-05-21 06:18:46 -04:00
Eric Callahan
546a17f5d3
filelock: add missing newline
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2024-04-27 11:10:24 -04:00
Eric Callahan
7394a22c2d
filelock: fix type annotation
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2024-04-27 11:08:18 -04:00
Eric Callahan
683d93a894
utils: add file lock utility
Uses linux flock to create lock files that can be used
to protect access across multiple processes.

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2024-04-27 10:24:44 -04:00
Eric Callahan
98bb40bd80
utils: add kernel version
Move the kernel version tuple calculation out of gpio.py into
the utils package so its available for any module that requires
it.  In addition, report the kernel version string with the distribution
info and log the platform in the rollover header.

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2024-03-11 06:26:18 -04:00
Eric Callahan
f946e6a28d
sysfs_devs: implement mode query
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2024-02-03 11:47:23 -05:00
Eric Callahan
145968af0f
sysdevs: report paths for all devices
While a hardware UART generally won't have symlinks in the "by-path"
and "by-id" folders, it is possible to configure udev to add them.
In addition, adding these fields makes the schema consistent.

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2024-02-01 10:27:22 -05:00
Eric Callahan
6f4a0480f3
machine: add video peripheral API request
Signed-off-by: Eric Callahan <arksine.code@gmail.com>
2024-02-01 10:27:22 -05:00
Eric Callahan
522b4df989
sysfs_devs: add v4l2 video campture device detection
Signed-off-by:  Eric Callahan  <arksine.code@gmail.com>
2024-02-01 10:27:21 -05:00
Eric Callahan
0fb997285b
sysfs_devs: hardware discovery utils using sysfs
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2024-02-01 10:27:21 -05:00
Eric Callahan
2cebf5cc03
cansocket: utility for querying klipper can nodes
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2024-02-01 10:27:19 -05:00
Eric Callahan
20871e2171
pip_utils: utilities for managing python packages via pip
This module implements both syncronous and async calls
to pip, separating it from the rest of the application.  The
syncronous implementation has no dependencies on Moonraker.

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2024-01-13 15:15:12 -05:00
Eric Callahan
aa16dd671b
app: add jsonrpc HTTP endpoint
Add a POST /server/jsonrpc endpoint that processes jsonrpc
requests from the body.  This allows developers familiar with
the JSON-RPC API to use it in places where a websocket is not
desiriable.

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2023-12-16 16:21:24 -05:00
Eric Callahan
4fe99e6ebb
json_wrapper: fix linter errors
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2023-10-07 10:37:42 -04:00
Eric Callahan
65644bab8b
utils: add ioctl_macros module
Signed-off-by: Eric Callahan <arksine.code@gmail.com>
2023-10-07 07:40:41 -04:00
Eric Callahan
f99e5b0bea
utils: add support for msgspec with stdlib json fallback
Signed-off-by: Eric Callahan <arksine.code@gmail.com>
2023-10-06 18:20:28 -04:00
Eric Callahan
4f785cfca0
update_manager: clarify web client git warning
When the parent folder of a web client is a git repo note the specific
directory that contians a .git subdirectory.

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2023-07-14 12:40:17 -04:00
Eric Callahan
3f1e9e397e
update_manger: log remaining refresh time on init
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2023-07-12 13:57:27 -04:00
Eric Callahan
bdd1d93708
versions: software version parsing utility
The versions module contains classes that can parse
Python and Git versions, providing methods to access
the version details.

Signed-off-by: Eric Callahan <arksine.code@gmail.com>
2023-07-12 13:57:25 -04:00
Eric Callahan
35396a5b2a
source_info: add within_git_repo method
Check for git files and folders, including those of parents.

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2023-06-20 11:59:40 -04:00
Eric Callahan
1a5cf56532
utils: add direct fallback to load_system_module
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2023-06-07 19:45:39 -04:00
Eric Callahan
cd4fdfb7b6
utils: report additional git repo data
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2023-05-26 10:49:58 -04:00
Eric Callahan
80920dd872
utils: fix dist package check
Older versions of virtualenv include their own "site" module
that does not have the "getsitepackages" method.  Add
a check to verify its presence  before calling it.

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2023-03-05 16:41:21 -05:00
Eric Callahan
2cda75ff2c
utils: simplify sentinel object
Use an enum to represent the sentinel rather than a singleton object.

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2023-02-22 18:08:50 -05:00
Eric Callahan
79467e6484
utils: add source_info utility module
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2023-02-22 18:08:48 -05:00
Eric Callahan
277aecd305
moonraker: convert utils.py to a package
Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
2023-02-22 18:08:47 -05:00