BradenM / micropy-cli

Micropython Project Management Tool with VSCode support, Linting, Intellisense, Dependency Management, and more!
https://micropy-cli.readthedocs.io
MIT License
317 stars 25 forks source link

pymakr config setup depricated #312

Open justus-saul opened 2 years ago

justus-saul commented 2 years ago

Hi, I just setup my first project with the help of Micropy Cli on VSCode. It seems the config Micropy is creating for pymakr in its currently available version from the extensions is deprecated. Of all options set by Micropy only safe_boot_on_upload and py_ignore are still valid.

The proposed workflow sadly isn't working anymore and you currently have to upload each file manually. I now downgraded pymakr to the last 1.x version. I guess either there needs to be an alternative flow to be implemented or this required version should be mentioned.

[{
    "resource": "/home/XXX/projekte/micropython/water/pymakr.conf",
    "owner": "_generated_diagnostic_collection_name_#3",
    "code": "2",
    "severity": 4,
    "message": "Deprecated. Board address is stored in a persistent VSCode session.",
    "startLineNumber": 2,
    "startColumn": 5,
    "endLineNumber": 2,
    "endColumn": 30
},{
    "resource": "/home/XXX/projekte/micropython/water/pymakr.conf",
    "owner": "_generated_diagnostic_collection_name_#3",
    "code": "2",
    "severity": 4,
    "message": "Deprecated. Board credentials are stored in a persistent VSCode session.",
    "startLineNumber": 3,
    "startColumn": 5,
    "endLineNumber": 3,
    "endColumn": 24
},{
    "resource": "/home/XXX/projekte/micropython/water/pymakr.conf",
    "owner": "_generated_diagnostic_collection_name_#3",
    "code": "2",
    "severity": 4,
    "message": "Deprecated. Board credentials are stored in a persistent VSCode session.",
    "startLineNumber": 4,
    "startColumn": 5,
    "endLineNumber": 4,
    "endColumn": 25
},{
    "resource": "/home/XXX/projekte/micropython/water/pymakr.conf",
    "owner": "_generated_diagnostic_collection_name_#3",
    "code": "2",
    "severity": 4,
    "message": "Deprecated. Please use the explorer context menu for upload/download of specific folders and files.",
    "startLineNumber": 5,
    "startColumn": 5,
    "endLineNumber": 5,
    "endColumn": 25
},{
    "resource": "/home/XXX/projekte/micropython/water/pymakr.conf",
    "owner": "_generated_diagnostic_collection_name_#3",
    "code": "2",
    "severity": 4,
    "message": "Deprecated. This may or may not be reimplemented.",
    "startLineNumber": 21,
    "startColumn": 5,
    "endLineNumber": 21,
    "endColumn": 24
}]
BradenM commented 2 years ago

Thanks for bringing this to my attention.

I will look into adding support for pymakr v2 config over this weekend, hopefully. :+1:

jshamg commented 1 year ago

Thanks for bringing this to my attention.

I will look into adding support for pymakr v2 config over this weekend, hopefully. 👍

Any news on this? :)

BradenM commented 1 year ago

@justus-saul @jshamg

Have not quite gotten around to it, sorry.

I have not used pymakr in quite a while, would either of you be willing to share an example of what you'd be looking for in a pymakr v2 template? Would be helpful to point me in the correct direction.

Thanks.

jshamg commented 1 year ago

Hi @BradenM , no worries, thanks for the reply! :) So my biggest Problem is, that pymakr apparently doesn't support the sync of a single folder anymore. I don't think they really meant to do that but there is just no setting for it anymore. there is another option apart from sync_folder called dist_dir but if i set it I get the warning "Property dist_dir is not allowed."... Apart from that this is a complete config I would be looking for :

{
  "name": "SomeProjectName",
  "dist_dir": "src",
  "ctrl_c_on_connect": false,
  "safe_boot_on_upload": false,
  "reboot_after_upload": true,
  "py_ignore": [
    "pymakr.conf",
    ".vscode",
    ".gitignore",
    ".git",
    "project.pymakr",
    "env",
    "venv",
    ".python-version",
    ".micropy/",
    "micropy.json"
  ],
  "dev": {
    "simulateDeepSleep": false,
    "uploadOnDevStart": "outOfSync",
    "onUpdate": "restartScript"
  }
}

I've also made a feature request at the pymakr-vsc repo for the folder sync problem. So maybe waiting for that would be smart :)

Thanks!

Josverl commented 1 year ago

Pymakr was under development by pycom, which went article 11 (bankrupt)

Still use the preview version, as I've found nothing better for vscode on windows,..

justus-saul commented 1 year ago

Sorry, for the late response. For me there is no incentive to upgrade pymakr to v2. I just need an easy way for uploading the project to the device. Downgrading it to v1 was fine for me, so just reflecting that in the docs would be fine, but in the long run it isn't that nice to depend on something that is not getting support anymore.

BradenM commented 1 year ago

Seems it would be best to simply offer both PyMakr v1 and v2 template options as an immediate solution.

However, based on the @Josverl and @justus-saul insights along with the lackluster sync support pointed out by @jshamg in pymakr v2, it seems the need for something like #228 has just grown and should be prioritized.

I have already laid the foundation for a built-in library sync / code sync with the PyDevice abstractions introduced in #294 and (with some needed improvements to micropys configuration) aim to make this a reality in the near future.

Please let me know if any of you guys agree with this sentiment -- and if so perhaps we should open a discussion to fully layout what an ideal implementation would look like in micropy / the scope of features wanted.

jshamg commented 1 year ago

Yes and no. On the one hand I would say It could potially be a nice enhancement to have micropy-cli deploy to devices in general. The ability to sync it with the right configuration directly to the device is really nice. On the other hand i'd like to have a integration in vs-code and pymakr v2 is doing it pretty well with organising py-boards, naming them and syncing them. For me personally i rather do it through vs-code than via terminal, but I'm not limited to pymakr if there are any other solutions...

justus-saul commented 1 year ago

I first need to be honest in the regard that my micro python project is currently on my pile of shame since the start of 2023, so everything is kind of based on older memory, but I guess we can also speak about more general concepts here.

I would say consistency would be the key for me and that would be having everything I need within micropy-cli. Being dependent on a plugin/tool is okay as long it you don't have an additional workflow for it. As with pymakr this is currently not the case as we use its interface, config, etc.. I am all in for an integrated solution. This step would also make micropy-cli less reliant on VCS for an important part of the workflow of a project.

guineau commented 1 year ago

Since pymakr is now orphaned do we have access to the sources for it? If so I would like help to improve its stability.  It drives me crazy trying to get it to connect and sync.  Failing that is there an alternative macOS or Linux VCS extension that actually works? I’ve been trying to get RT-Thread to work but I can’t even find the “connect” button!Sent from my iPhoneOn Mar 7, 2023, at 8:53 AM, Justus Saul @.***> wrote: I first need to be honest in the regard that my micro python project is currently on my pile of shame since the start of 2023, so everything is kind of based on older memory, but I guess we can also speak about more general concepts here. I would say consistency would be the key for me and that would be having everything I need within micropy-cli. Being dependent on a plugin/tool is okay as long it you don't have an additional workflow for it. As with pymakr this is currently not the case as we use its interface, config, etc.. I am all in for an integrated solution. This step would also make micropy-cli less reliant on VCS for an important part of the workflow of a project.

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you are subscribed to this thread.Message ID: @.***>

Josverl commented 1 year ago

Pymakr 2 code is available from github, and several forks also exist.

Most connection issues I see are down to multiple instances of vscode all trying to grab the same devices. Tweaking the auto connect settings solve that.

With mpremote and mip there are quite a few ways to deploy packages, although requirements / pyproject.toml files are still not working for micropython...