-
-
Notifications
You must be signed in to change notification settings - Fork 8.2k
tools/mpremote: Add manifest function. #8231
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
6835ef4
to
4099608
Compare
Codecov Report
@@ Coverage Diff @@
## master #8231 +/- ##
=======================================
Coverage 98.39% 98.40%
=======================================
Files 153 153
Lines 20187 20188 +1
=======================================
+ Hits 19864 19865 +1
Misses 323 323
Continue to review full report at Codecov.
|
4099608
to
b4be691
Compare
mpremote is also being packaged to wheel in github-actions in this PR, can be tested with Go to actions page for the task, download artifact link at bottom: https://github.com/micropython/micropython/actions/runs/1775611454 https://github.com/micropython/micropython/suites/5129239273/artifacts/154344973
|
1a740b6
to
e700ee8
Compare
e700ee8
to
f30c5a1
Compare
I still want to do some more work here to speed up the sync process, make it as efficient as I can. With a remote littlefs partition on esp32 even just doing recursive file listing can be painfully slow ( ~ 12 seconds for 128 files across 28 folders ), not sure how much could be done to improve this. One of the main things I'd like to fix is more related to |
I want to look into general file transfer speed using
+1 |
I haven't looked at the actual file transfer speed over the serial port, however I've got re-copying folders working much faster with either a sha or (size + mtime) check on remote vs local filesystems. The best speed so far is by scanning the remote folder tree into a dict and passing that back to mpremote to check against local folder; this can be used to delete extra remote files and not transfer ones that aren't needed. Most of the time for this operation on a mostly unchanged folder is just in a recursive walk in micropython, even with just one os.stat per file it can be quite slow. Might not be able to do much about that though, no way to know if there are extra files to delete without doing a os.listdir and then os.stat on each one to know if it's a dir or a file... |
try |
Yes of course, I did forget about the difference between the two. I'll try that later and see how much improvement it makes |
Is there any progress on #7731? |
I haven't run into this issue myself so hadn't seen that ticket. At least it looks reasonably easy to reproduce, though there could be a few issues in that mix too |
10f2db7
to
4ff9a53
Compare
4ff9a53
to
2c912f5
Compare
For now I've trimmed this PR back down to just the manifest command, no sync. This command combined with mount is enough on many devices (ones with native usb at least) to allow fast development of projects which use a manifest file to organise the files / libraries. I'll continue to work on |
@@ -1,6 +1,7 @@ | |||
[build-system] | |||
requires = [ | |||
"setuptools>=42", | |||
"wheel" | |||
"wheel", | |||
"mpy-cross", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should 'mpy-cross' be pinned to a specific version, or is it intentionally un-versioned ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My intention at the time was to be un-pinned, to always use latest (because I generally always use latest micropython).
However now, there's efforts under way to have the mpy-cross package built / managed as part of this repo and integrate it into mpremote in a cleaner and more compatible way.
Add manifest command to mpremote which will compile a manifest.py from the specified folder, eg:
$ MPY_DIR=../../micropython $ PORT_DIR=../../micropython/ports/esp32 $ mpremote manifest .
This will assemble / mpy-cross everything specified in the manifest.py into the folder
_manifest
.If the current folder is also mounted, this folder will automatically be added to the path, eg:
Alternatively, the built folder can by copied / synched to the device, in which case
the copied folder will be added to the path:
$ mpremote manifest -s .
A soft-reset will re-process the manifest file to include any local updates allowing fast development of local files in a larger project without needing to copy / import-over-mount all files every reset.
Ideally, if the
mpy_cross
python package is installed from pypi, the localMPY_DIR=../../micropython
variables will not need to be specified (unless your local manifest uses them directly`