Repository navigation
Add ndi.update: check for and install a newer NDI-python (mirrors NDI-matlab#1038) - #337
Merged
Merged
Conversation
Mirrors VH-Lab/NDI-matlab#1038 (branch claude/amazing-clarke-a34o5c). ndi.update.check compares this copy with the latest commit on main: - git clones: git fetch origin main, commits behind/ahead, the ~/.ndi/tools clones ndi_install.py makes, and the user's own changed files, new files and local commits (Modifications); - installer installs: the commit in ~/.ndi/install.json against main via GitHub's compare API, or the commits since the install time; - pip installs: reported as unknown. ndi.update.install refuses a clone not on main, lists the user's changes and asks (default No; with Confirm=False it errors unless AllowModified), then pulls --ff-only with changed files stashed and restored and runs ndi_install.py --update, or re-runs the NDI installer (on Windows in its own window, after this process exits). Caches are cleared afterwards. Also modificationSummary, installType and checkOnStartup. - install-ndi.sh / .ps1 install the exact commit main is at and record it, with the install time, in ~/.ndi/install.json (removed by uninstall); NDI-matlab's ndi.update.checkPython reads the same file. The installer workflow checks the receipt. - `ndi update` and `ndi update --check [--json]`. - An Update button in the navigator's NDI pane; the dialog decisions are in a pure update_dialog() so they are tested without Qt. - The navigator runs the once-a-day check on a thread when it opens. - Preferences Update.CheckOnStartup and Update.CheckIntervalDays (shared with NDI-matlab) and Update.Python.LastCheckTime (NDI-matlab keeps Update.MATLAB.LastCheckTime). - ndi.version() reports the receipt's commit for an installer install. - Bridge: new src/ndi/update bridge (matlab_branch markers until the MATLAB branch merges); ndiPane, preferences and version re-synced. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017Ni686VRCwcmMfvCVcLypp
…file The preferences read-artifacts test requires every key NDI-python registers to be in the other language's NDI_Preferences.json. Update.Python.LastCheckTime is deliberately per-language (NDI-matlab keeps Update.MATLAB.LastCheckTime), so MATLAB never writes it. Keys in a "Python" subcategory are no longer expected in matlabArtifacts; the pythonArtifacts check still requires every key. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017Ni686VRCwcmMfvCVcLypp
…2f532167 NDI-matlab's runGit now gives git an empty stdin and disables credential prompts, the pager and the editor. run_git does the same, and the bridge entry records the new commit. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017Ni686VRCwcmMfvCVcLypp
…erged VH-Lab/NDI-matlab#1038 merged with a merge commit, so +ndi/+update is on NDI-matlab main and every recorded sync hash (f9ced4bcd, e2a3d8e57, 42f532167) is in main's history. The eleven matlab_branch markers come off, as section 8 of the bridge spec requires, and src/ndi/update joins the completeness guard's PACKAGES. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017Ni686VRCwcmMfvCVcLypp
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
Adds the NDI-python half of VH-Lab/NDI-matlab#1038 (merged): checking for and installing a newer NDI-python. NDI-python has no releases, so every kind of install is compared with the latest commit on
main.ndi.update(new package, MATLAB names):check():git fetch origin main, then the commits behind and ahead. It also checks the clonesndi_install.pymakes in~/.ndi/tools, and records the user's own changed files, new files and local commits (Modifications).~/.ndi/install.jsonwith main through GitHub's compare API. If the receipt has no commit, it counts the commits made since the install time.install():main.Confirm=Falseit raisesUpdateErrorunlessAllowModified=True.git pull --ff-only(changed files are stashed and restored), thenndi_install.py --update.ndi.execan't be replaced.modificationSummary,installTypeandcheckOnStartup.Installer (
install-ndi.sh/install-ndi.ps1):mainis at, installs exactly that commit's archive, and records it with the install time in~/.ndi/install.json.mainas before and records"commit": null.--uninstallremoves the receipt.ndi.update.checkPythonreads the same file.installer.ymlgains a step checking thatndi.updatereads the receipt from a real install.Elsewhere:
ndi updateandndi update --check [--json].update_dialog(), so they're tested without Qt.ndinever touches the network.Update.CheckOnStartupandUpdate.CheckIntervalDaysuse the same keys as NDI-matlab, so one setting covers both.Update.Python.LastCheckTimeis separate from MATLAB'sUpdate.MATLAB.LastCheckTime, so a check in one language doesn't postpone the other's.Pythonsubcategory to appear in MATLAB's file. They're Python's own by design. Every other key is still checked, and Python's own file must still have all of its keys.ndi.version()reports the receipt's commit for an installer install.Bridge contract (please review):
src/ndi/update/ndi_matlab_python_bridge.yaml:check,install,installType,modificationSummaryandcheckOnStartupare ported.checkPython,runGitandgithubApiareported_differently.compareVersions,latestReleaseandtoolboxIdentifierarematlab_only; they concern releases and the toolbox, which NDI-python doesn't have.src/ndi/updateis added to the completeness guard'sPACKAGESlist.main:ndiPane,preferencesandversion:f9ced4bcdcheckPython:e2a3d8e57runGit:42f532167Merge order
VH-Lab/NDI-matlab#1038 has merged, with a merge commit, so every recorded sync hash is in NDI-matlab
main's history. The temporarymatlab_branchmarkers have been removed. This PR now checks against NDI-matlabmainlike any other.Testing
black --checkandruff checkare clean.pytest tests/ --ignore=tests/symmetry: 6092 passed, 609 skipped, run with NDI-matlab at the matching branch. This includes the bridge checks run in strict mode.main, including the new+ndi/+updatecompleteness check: 210 passed.tests/test_update_check_git.py(13): builds local bare repos and clones. It covers behind and ahead, dependencies, modifications, the guards, a pull plusndi_install.py --update, and an edited file surviving the update.tests/test_update_installer.py(10): uses a fake~/.ndiand a fake GitHub API.tests/test_update_misc.py(18): the summary text, the startup check, preferences, the command line, and the dialog decisions.test_gui_nav_pane.pyfor the wider pane (MATLAB's 156 pixels).Not run locally:
sh -npasses;installer.ymlexercises them in CI.🤖 Generated with Claude Code
https://claude.ai/code/session_017Ni686VRCwcmMfvCVcLypp