Beginner-friendly post-install guide: detect & install platform deps automatically#485
Open
GGzili wants to merge 3 commits into
Open
Beginner-friendly post-install guide: detect & install platform deps automatically#485GGzili wants to merge 3 commits into
GGzili wants to merge 3 commits into
Conversation
Detects which IM platforms the user enabled in mykey.py, checks whether the corresponding Python packages are importable, and offers to install the missing ones (using `uv pip` when available, falling back to `python -m pip`). For platforms that need interactive QR login (e.g. WeChat iLink), offers to re-run the configure wizard so the user can scan the QR right away. If no platform is enabled yet, offers to (re-)launch the configure wizard. Stdlib-only, so it runs against the uv-managed Python the installer ships.
After mykey.py is written, call scripts/post_install.py so users do not have to copy-paste `pip install ...` themselves. The wizard still prints the dep list as a fallback when stdin is non-interactive or post_install is unavailable, so existing flows remain compatible.
- lint-python: compileall on scripts/ and assets/, plus ruff (warn-only). - lint-shell: shellcheck any scripts/*.sh shipped in the repo. - test-post-install: matrix run on Ubuntu/macOS/Windows × Python 3.11/3.12 to make sure post_install.py degrades gracefully in non-interactive contexts (no mykey.py, partial mykey.py with missing dep, etc.). - smoke-developer-install: `uv pip install -e .` + `import agent_loop` to catch packaging regressions in pyproject.toml.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
When a first-time user runs the official one-line installer and walks
through
assets/configure_mykey.py, the wizard currently prints a hintlike:
…but the user still has to copy/paste it, find the right shell, and
re-run the wizard if the platform needs an interactive QR login (e.g.
WeChat iLink). New users repeatedly hit:
This PR closes that gap.
What changes
scripts/post_install.py(new, stdlib-only)mykey.py.QQ / Feishu / WeCom / DingTalk).
importable.
uv pip(preferred) orpython -m pip.deps, offers to re-launch
configure_mykey.pyso the user canscan the QR right away.
want to enable one and re-launches the wizard.
missing deps and exits 0. Never breaks the installer.
assets/configure_mykey.py(small change)scripts/post_install.pyif it exists and stdin is interactive..github/workflows/ci.yml(new)lint-python:compileallonscripts/andassets/, plusruff (warn-only).
lint-shell:shellcheckanyscripts/*.shshipped in therepo.
test-post-install: matrix on Ubuntu/macOS/Windows × Python3.11/3.12. Runs
post_install.pyagainst (a) emptymykey.py,(b) a mock Telegram config without the
telegrampackageinstalled, asserting the script exits 0 and is non-interactive
friendly.
smoke-developer-install:uv pip install -e .andimport agent_loopto catch packaging regressions.Why a separate Python script (and not just shell-side logic)?
PowerShell variant, both hosted on a VPS. Putting the logic in a
stdlib-only Python script keeps it cross-platform, in-repo, and
reviewable.
python scripts/post_install.py— see the companion issue I'llfile for the VPS-side change.
Out of scope (intentionally)
configure_mykey.py; we read the same identifiers it writes.which are the noisy ones for new users).
Test notes
prompt; with WeChat iLink enabled → got missing-dep prompt, then
QR-rerun prompt.