Skip to content

Commit c46439f

Browse files
Document installation of custom package.json file with mpremote and mip
1 parent 2915967 commit c46439f

2 files changed

Lines changed: 26 additions & 3 deletions

File tree

.snippets/36.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,19 @@ scope: all
55
affected: all
66
-->
77

8-
This change adds mpy cross compiled `*.mpy` files based on MicroPython 1.27.0 to the `be_upy_blink` directory. These files are listed in `package_mpy.json` and can be installed via
8+
This change adds mpy cross compiled `*.mpy` files based on MicroPython 1.27.0 to the `be_upy_blink` directory. These files are listed in `package_mpy.json` and can be installed via `mip` like
99

1010
```python
1111
import mip
1212
mip.install("github:brainelectronics/micropython-package-template/package_mpy.json")
1313
```
1414

15+
or from the command line
16+
17+
```bash
18+
mpremote mip install github:brainelectronics/micropython-package-template/package_mpy.json@feature/provide-mpy-cross-files
19+
```
20+
1521
The pre-commit hook `mpy-cross` is generating the latest `*.mpy` files of the `be_upy_blink` directory. If new `.mpy` files are created or change by this hook, the hook will raise an error.
1622
The pre-commit hook `upy-package-mpy` is added to verify the `package_mpy.json` file list is up to date.
1723

README.md

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,14 +125,19 @@ import mip
125125
mip.install("github:brainelectronics/micropython-package-template", version="feature/initial-implementation")
126126
# install a tag version
127127
mip.install("github:brainelectronics/micropython-package-template", version="0.6.0")
128+
129+
# install pre-compiled package
130+
mip.install("github:brainelectronics/micropython-package-template/package_mpy.json")
131+
mip.install("github:brainelectronics/micropython-package-template/package_mpy.json", version="feature/provide-mpy-cross-files")
132+
mip.install("github:brainelectronics/micropython-package-template/package_mpy.json", version="0.15.0")
128133
```
129134

130135
For MicroPython versions below `1.19.1` use the `upip` package instead of `mip`.
131-
With `upip` always the latest available version will be installed.
136+
⚠️ There are no pre-compiled `.mpy` packages available.
132137

133138
```python
134139
import upip
135-
upip.install('micropython-package-template')
140+
upip.install('micropython-package-template==0.12.0')
136141
```
137142

138143
#### Test version
@@ -145,10 +150,12 @@ will be used.
145150
```python
146151
import mip
147152
mip.install("github:brainelectronics/micropython-package-template", version="0.6.0-rc9.dev13")
153+
mip.install("github:brainelectronics/micropython-package-template/package_mpy.json", version="0.15.0-rc5.dev37")
148154
```
149155

150156
For MicroPython versions below `1.19.1` use the `upip` package instead of `mip`.
151157
If no specific version is set, `upip` will always install the latest available version.
158+
⚠️ There are no pre-compiled `.mpy` packages available.
152159

153160
```python
154161
import upip
@@ -183,6 +190,16 @@ mpremote fs cp -f examples/boot.py examples/main.py :
183190
mpremote fs ls :
184191
```
185192

193+
Or use the latest package files as defined in the `package.json` or `package_mpy.json` file from remote or as part of this repo
194+
195+
```bash
196+
# install files as defined in (default) package.json
197+
mpremote mip install package.json
198+
199+
# install *.mpy files as defined in "package_mpy.json" on tag "0.15.0-rc5.dev37"
200+
mpremote mip install github:brainelectronics/micropython-package-template/package_mpy.json@0.15.0-rc5.dev37
201+
```
202+
186203
##### rshell
187204

188205
Open the remote shell with the following command. Additionally use `-b 115200`

0 commit comments

Comments
 (0)