Skip to content
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

Make pyocd-pemicro an optional dependency #1319

Closed
dvzrv opened this issue Jan 22, 2022 · 7 comments
Closed

Make pyocd-pemicro an optional dependency #1319

dvzrv opened this issue Jan 22, 2022 · 7 comments

Comments

@dvzrv
Copy link
Contributor

dvzrv commented Jan 22, 2022

Hi! As I'm currently looking into packaging pyocd for Arch Linux, I'm evaluating the project's dependencies.
I noticed that pypemicro is a dependency via pyocd-pemicro. Unfortunately there are a few open questions around the use of pypemicro in a packaging context (see nxp-mcuxpresso/pypemicro#10 and nxp-mcuxpresso/pypemicro#11) and pyocd-pemicro (see pyocd/pyocd-pemicro#7).

Would it be possible to make pyocd-pemicro an optional dependency? It appears to only be required for very specific hardware (I can't find any direct mentions in the source code otherwise):

`pemicro` | [PE Micro](https://pemicro.com/) Cyclone and Multilink

It would help in getting pyocd packaged sooner while the above issues are being settled and it would additionally allow for users not to install dependencies they do not need.

@dvzrv
Copy link
Contributor Author

dvzrv commented Jan 22, 2022

Somewhat related: #1158 and #1160

@flit
Copy link
Member

flit commented Jan 22, 2022

cc @Gargy007

Ok, I'll need to review the referenced issues.

You won't find any mentions in the source since pyocd-pemicro is a plugin. And yes, it's only required for specific hardware, the PEMicro debug probes. That's true for all the built-in probe plugins, too, though.

Very unfortunately, there is no way to declare an optional dependency for Python packages which gets installed by default.

One option would be to move pyocd-pemicro to an "extras" dependency, so pyocd would be installed like pip install pyocd[pemicro] if you wanted the plugin.

@dvzrv
Copy link
Contributor Author

dvzrv commented Feb 11, 2022

One option would be to move pyocd-pemicro to an "extras" dependency, so pyocd would be installed like pip install pyocd[pemicro] if you wanted the plugin.

Given the unclear licensing and source code around those upstream shared libraries (which could contain backdoored code and therefore can not be trusted) that would be a good approach I believe.

@Gargy007
Copy link
Contributor

Gargy007 commented Feb 11, 2022 via email

@dvzrv
Copy link
Contributor Author

dvzrv commented Feb 11, 2022

Hello, next release of pypemicro, makes the license for binaries much more clear. There is no reason makes changes in SPSDK.

@Gargy007 Thanks for the update on the licensing question.
Please note that even if the license question is settled, some distributions will not consider packaging pypemicro based on the fact that it ships with precompiled shared libraries that are of unknown origin. Personally I also do not feel like this would be a good idea and will abstain from packaging it unless there is access to the sources (in which case this should even be split out to a different project/package as a shared library may be used by other applications as well). Users may still install the package using pip in their user's context though, if they choose so.

archlinux-github pushed a commit to archlinux/svntogit-community that referenced this issue Feb 13, 2022
Remove version pinning: nxp-mcuxpresso/spsdk#35
Remove use of pypemicro:
nxp-mcuxpresso/pypemicro#10
nxp-mcuxpresso/spsdk#30
Remove use of pyocd-pemicro:
pyocd/pyOCD#1319
Remove use of libusbsio: nxp-mcuxpresso/spsdk#36

git-svn-id: file:///srv/repos/svn-community/svn@1133098 9fca08f4-af9d-4005-b8df-a31f2cc04f65
archlinux-github pushed a commit to archlinux/svntogit-community that referenced this issue Feb 13, 2022
Remove version pinning: nxp-mcuxpresso/spsdk#35
Remove use of pypemicro:
nxp-mcuxpresso/pypemicro#10
nxp-mcuxpresso/spsdk#30
Remove use of pyocd-pemicro:
pyocd/pyOCD#1319
Remove use of libusbsio: nxp-mcuxpresso/spsdk#36

git-svn-id: file:///srv/repos/svn-community/svn@1133098 9fca08f4-af9d-4005-b8df-a31f2cc04f65
@flit
Copy link
Member

flit commented Feb 19, 2022

@Gargy007 I'm leaning strongly towards making pyocd-pemicro optional, and will probably make the change for the next release (v0.34 since it's more than a simple bug fix). You'd still be able to install at the same time as pyocd with pip install pyocd[pemicro].

Aside from the license/binaries concern, there is #1129. If pyocd-pemicro is installed, running pyocd in PowerShell causes the shell to crash when pyocd exits.

Btw, one way to work around the binaries concern is to remove the binary libs from pypemicro and require the user to install the PEMicro drivers themselves. This is the approach taken for J-Link. While it's an extra step, it's probably (?) reasonable to assume the user will want to install the PEMicro tools anyway. Or you could separate out the libs into yet another package (e.g. pypemicro-libraries), and potentially use an optional install to get them (e.g., pip install pypemicro[libs]).

@flit
Copy link
Member

flit commented May 7, 2022

Update: The change to make pyocd-pemicro optional has been merged in #1359. It's available in the pemicro install extra, so it's just a small change to install simultaneously with pyocd. The docs have been updated to inform users about this if they need PEMicro probe support.

Closing this issue now that the change has been implemented.

@flit flit closed this as completed May 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants