Skip to content

feat: set Readme and PackageName from MLToolboxInfo.json on R2026b - #81

Open
ehennestad wants to merge 3 commits into
mainfrom
add-readme-and-package-name-options
Open

ehennestad wants to merge 3 commits into
mainfrom
add-readme-and-package-name-options

Conversation

@ehennestad

Copy link
Copy Markdown
Owner

From R2026b, matlab.addons.toolbox.ToolboxOptions has Readme and PackageName properties. Readme names the file that becomes the package readme. PackageName is the name in mpackage.json; it names the installation folder (<Add-Ons folder>/<PackageName>@<version>) and identifies the package in mpmlist and to packages that depend on it. Releases before R2026b reject both as unknown name-value arguments (MATLAB:InputParser:UnmatchedParameter on R2024b), so MLToolboxInfo.json could not set them.

Changes

  • createToolboxOptions takes Readme and PackageName out of the ToolboxOptions of MLToolboxInfo.json before the constructor, and sets them afterwards where isprop finds the property.
  • Readme is a path relative to the source folder, because the package holds only the files below it. Listing README.md in RootFilesToPackage stages the project README there. A Readme that is not in the source folder, or whose path contains .., raises MatBox:Package:ReadmeNotFound.
  • A PackageName that is not a valid MATLAB identifier (isvarname) raises MatBox:Package:InvalidPackageName.
  • Both checks run on every release, before anything is packaged. A non-scalar value of either field raises MatBox:Package:InvalidToolboxInfoField.
  • The README, docs/ci.md and the help text of packageToolbox describe both fields.
  • TasksTest gains four tests: packaging with both fields, the readme and name of mpackage.json on R2026b (skipped on earlier releases), and the two errors.
  • A separate refactor commit replaces the help text of createToolboxOptions, which named openMINDS_MATLAB and gave a getToolboxOptions example.

Context

Without Readme, R2026b uses a README.md at the root of the source folder, or else writes Description to one. File Exchange refused an R2026b package that had neither (ehennestad/EBRAINS-MATLAB#100). Without PackageName, R2026b derives the name from ToolboxName: "NANSEN Two-Photon Module" becomes NANSENTwo0x2DPhotonModule.

Removing badge lines and making relative links absolute in the staged README is a separate change.

🤖 Generated with Claude Code

ehennestad and others added 2 commits November 4, 2026 11:01
From R2026b, ToolboxOptions has Readme and PackageName properties.
Earlier releases reject them as unknown name-value arguments, so
createToolboxOptions takes both fields out of the ToolboxOptions of
MLToolboxInfo.json before the constructor and sets them afterwards on
releases that have the properties.

Readme is a path relative to the source folder. Listing README.md in
RootFilesToPackage copies the project README there. A Readme that is
not in the source folder raises MatBox:Package:ReadmeNotFound, and a
PackageName that is not a valid MATLAB identifier raises
MatBox:Package:InvalidPackageName, on every release.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The help text named openMINDS_MATLAB and gave an example that calls
getToolboxOptions.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Nov 4, 2026

Copy link
Copy Markdown
Contributor

Test Results

115 tests   114 ✅  32s ⏱️
  7 suites    1 💤
  1 files      0 ❌

Results for commit ca208e5.

@ehennestad
ehennestad added this pull request to stack #83 November 4, 2026 10:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant