mip: github branch is incorrectly used for secondary github: sources in package.json
mip version 0.2.0
When you specify a version to mip.install() to reference a particular GitHub branch, this branch is used for every github: source in the package.json, even those coming from a different repository.
The best solution to this is probably:
- provide a way (perhaps an optional third field) for a URL to specify a different branch
- default the branch to HEAD for secondary
github:urls if they don't provide an explicit branch
In my PR #676 I have done the second part of this (default to HEAD) but not the first part yet.
mpremote/mip: Allow version override in package.
Adds the capability for a mip package.json to include urls to github hosted files that are versioned
This change allows explicit versions/branches to be specified at the url level.
This allows a package to combine files from different branches, in the same repo, and across different repo's as well.
The default behavior's remains to 'inherit' an explicit version specified at the package level using the @branch-or-tag notation,
Example package:
{
"urls": [
[ "foo.py", "github:my/repo/folder/foo.py@foo-beta"],
[ "bar.py", "github:my/repo/folder/bar.py" ]
],
"deps": [],
"version": "1.2.3"
}
allows mip to install the packages files from two different branches
-
mpremote mip install github:my/repofoo.pyfrom branchfoo-betabar.pyfrom branchmaster
-
mpremote mip install github:my/repo@foo-betafoo.pyfrom branchfoo-betabar.pyfrom branchfoo-beta
-
mpremote mip install github:my/repo@bar-alfafoo.pyfrom branchfoo-betabar.pyfrom branchbar-alfa
also see: Discord: https://discord.com/channels/574275045187125269/1024252597839859734/1078727025596059698