Replies: 10 comments 8 replies
-
First mistake : I was marking directories as "Sources root" and not "Micropython sources root" :-) But even correcting that, I still did not find a suitable configuration for what I want to do.. |
Beta Was this translation helpful? Give feedback.
-
Hello, The upload run configurations are lacking documentation - I plan to fix that in the upcoming 0.5.4 release. The issue with custom path seems like a bug. If you select a file it's meant to take the target path, append the filename to it and upload it to the device to that target path. When you select a folder, it's meant to take the target path and upload the folder's contents there. Thanks for reporting that! For your use case the project configuration should work best. What you need is to right click the folder which contains your code, go to "mark folder as" and select MicroPython Sources Root. The project configuration uploads what's in the root of the project. However, as soon at least one MicroPython Sources Root is selected it only uploads the contents of top most MicroPython sources roots. The target paths are built relative to them so:
Will upload as:
Basically when you mark a folder as MicroPython Sources Root you can treat it as the "/" root of the device. It seems to me that you should mark the Selected is works similar to the project run configuration - but it requires at least one MicroPython Sources Root and allows you to choose which sources roots get selected. For example you might have one root with You can also right click the item you want to upload or drag and drop it to the file system tab - this is more useful for small one off changes, but it's worth being aware of. I admit that the upload algorithm is difficult to figure out when you're new to using the plugin. I intend on writing documentation for the uploads here on GitHub and then embedding links in the plugin to direct you there. However, if you have any more questions ask away. I'm open to suggestions as well. |
Beta Was this translation helpful? Give feedback.
-
Thank you for your answer. 1/ When using right click to "Upload file", then "Upload relative to Micropython sources root", it works as expected. Anyway, this is not very practical when working on several files at the same time (additional comment : I didn't manage to add the two "upload file" commands as icons in the toolbar) 2/ When using "Run configurations", in "Project" or "Path" mode, and setting If I compare with right click / upload behavior, I would say the Run Configuration misses a "Relative" option. |
Beta Was this translation helpful? Give feedback.
-
Sorry, no luck ! I have exactly the same thing on my screenshots (under Windows, not Mac). I'll try on another project right now... |
Beta Was this translation helpful? Give feedback.
-
Tried on another project : it works as expected ! It seems my previous attempts in "path" mode broke something, and some wrong metadata remains somewhere. Any idea ??? |
Beta Was this translation helpful? Give feedback.
-
In "Run configuration", tried to activate "Store as project file" (to see what it would put there), but that does not seem to work : it noes not create the expected file... |
Beta Was this translation helpful? Give feedback.
-
Here are the two files, in the hope you can see what was wrong : New (working) project.iml :
Old (buggy) project.iml :
|
Beta Was this translation helpful? Give feedback.
-
All works as expected now. It upload all files that have been modified. That's just magic ! Congratulations again for your great job, and thank you for your fast answers here. |
Beta Was this translation helpful? Give feedback.
-
Addendum : |
Beta Was this translation helpful? Give feedback.
-
The custom path run configurations should work now #33. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
I'm trying to configure a "Run configuration", or more precisely, an "Upload configuration". I didn't manage to match local and target path as I would like to.
My local tree (PyCharm project) typically looks like that :
target
is the root of what needs to be uploaded to the target.tools
anddoc
are folders for local scripts or documentation, which will go to the Git server, but not to the target.On the target, the expected tree is :
log
is a folder that remains on the target, and that does not need to be synced back to the PC.Then, I would like to match my local
/project/target
to/
on the target. I didn't manage to do that.When using an upload configuration of type "path" :
project/target
is marked as "source root"I can set source path as
C:\Data\PyCharm\project\target
But when I try to put
/
in target path, it adds/target
at the end.Then, it tries to sync
/project/target
(local) to/target
and not to/
When using upload configuration of type "Selected" :
The "available sources" box is empty.
I also tried not to use
/project/target
subfolder locally, and put/src,
,/lib
andboot.py
in the root directory of the PyCharm project. Doing so, I need to put local exclusions on/doc
,/tools
,README.md
, because those files must not be transfered to the target. I find how to declare target exclusions (for/log
) but I didn't find how to declare local exclusions.I think I missed something, but I don't know what :-)
Thank you in advance.
Beta Was this translation helpful? Give feedback.
All reactions