fix: add python-multipart dependency, fix launchd service name
python-multipart is required by FastAPI for form POST handling (login). Was missing from pyproject.toml — crash on macOS first run. launchd plist now uses the muxplex entry point script directly instead of python -m muxplex, so macOS shows 'muxplex' in Activity Monitor, launchctl list, and login items instead of 'python3'.
This commit is contained in:
+18
-5
@@ -217,6 +217,23 @@ def _check_dependencies() -> None:
|
|||||||
|
|
||||||
def _install_launchd(executable: str) -> None:
|
def _install_launchd(executable: str) -> None:
|
||||||
"""Install a macOS launchd agent plist to ~/Library/LaunchAgents/."""
|
"""Install a macOS launchd agent plist to ~/Library/LaunchAgents/."""
|
||||||
|
import shutil
|
||||||
|
|
||||||
|
# Prefer the entry point script ('muxplex') so macOS shows the correct
|
||||||
|
# process name in Activity Monitor, launchctl list, and login items.
|
||||||
|
# Fall back to 'python -m muxplex' if the entry point isn't on PATH.
|
||||||
|
muxplex_bin = shutil.which("muxplex")
|
||||||
|
if muxplex_bin:
|
||||||
|
program_args = f""" <array>
|
||||||
|
<string>{muxplex_bin}</string>
|
||||||
|
</array>"""
|
||||||
|
else:
|
||||||
|
program_args = f""" <array>
|
||||||
|
<string>{executable}</string>
|
||||||
|
<string>-m</string>
|
||||||
|
<string>muxplex</string>
|
||||||
|
</array>"""
|
||||||
|
|
||||||
label = "com.muxplex"
|
label = "com.muxplex"
|
||||||
plist = f"""<?xml version="1.0" encoding="UTF-8"?>
|
plist = f"""<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||||
@@ -225,11 +242,7 @@ def _install_launchd(executable: str) -> None:
|
|||||||
<key>Label</key>
|
<key>Label</key>
|
||||||
<string>{label}</string>
|
<string>{label}</string>
|
||||||
<key>ProgramArguments</key>
|
<key>ProgramArguments</key>
|
||||||
<array>
|
{program_args}
|
||||||
<string>{executable}</string>
|
|
||||||
<string>-m</string>
|
|
||||||
<string>muxplex</string>
|
|
||||||
</array>
|
|
||||||
<key>RunAtLoad</key>
|
<key>RunAtLoad</key>
|
||||||
<true/>
|
<true/>
|
||||||
<key>KeepAlive</key>
|
<key>KeepAlive</key>
|
||||||
|
|||||||
@@ -16,6 +16,7 @@ dependencies = [
|
|||||||
"websockets>=11.0",
|
"websockets>=11.0",
|
||||||
"python-pam>=1.8.4",
|
"python-pam>=1.8.4",
|
||||||
"itsdangerous>=2.1.0",
|
"itsdangerous>=2.1.0",
|
||||||
|
"python-multipart>=0.0.9",
|
||||||
]
|
]
|
||||||
|
|
||||||
[project.optional-dependencies]
|
[project.optional-dependencies]
|
||||||
|
|||||||
Reference in New Issue
Block a user