JetBrains / intellij-micropython

Plugin for MicroPython devices in PyCharm and IntelliJ
https://plugins.jetbrains.com/plugin/9777-micropython
Apache License 2.0
513 stars 106 forks source link

New project upload algorithm #338

Open elmot opened 4 days ago

elmot commented 4 days ago

When the run configuration has an empty source path, the whole project is going to be uploaded to the target device.

If a folder is marked as Source, and it's name is NOT started with dot, its content uploaded to the root of the device. be MicroPython or a library(ies) stub folder and is NOT uploaded

Folders marked as Excluded or Namespace package are NOT uploaded to the device.

Folders and files, named with leading dot are NOT uploaded in any case. Python virtual environment folders are NOT uploaded to the device.

If there is no source folders without leading dots in the project, then the project root goes to the device excluding leading-dot files

elmot commented 2 days ago

Problems found:

  1. The new upload systems works in a way, where if I select the project folder itself for flashing/uploading, the source folders contained in it get uploaded to the device with the root folder. Additionally, the source folders themselves aren't ignored either. Meaning that all the functionality regarding source folders that worked before is now broken. Meaning the resulting file structure on the device looks something like ProjectName -> SrcFolder1, SrcFolder2.
  2. Selecting Run Flash "FolderName" on a folder marked as source folder will cause it to get uploaded in a path with the project name. So on the device it looks like ProjectName -> SrcFolder -> Its content
  3. The flash options seem to be mixed up now. I have a project which contains two source folders, clicking run Flash "FolderName" on either of them seems to always trigger the run Flash "ProjectName" configuration instead.
  4. If I manually select multiple files (such as .py or .old files) and right click them to select upload files to MP device then only the file I selected first gets uploaded, others won't get uploaded.
  5. After uploading a subfolder from my source folders to test things I have randomly received the following error. I don't know if any specific file does it, haven't been able to pin point it to any. It only seems to happen with the folder. Possibly it might happen after uploading many files in a row.