Hi,
I've noticed (after messing with the cadquery addon) that there's actually a new style of addon
which uses pip to install the addon instead of copying / pasting into a Mod directory
https://forum.freecadweb.org/viewtopic.php?t=36051
https://github.com/FreeCAD/freecad.workbench_starterkit
I was wondering if installing this type of addon was something that had been considered for the next 1.0 release?
I think it might have some advantages, one of which might be the use of pip's extra-index-url to search for freecad specific packages
(similar to https://github.com/FreeCAD/FreeCAD-addons but using pips inbuilt indexing)
although there may be some questions such as when uninstalling if to also uninstall any auto installed depends etc
For the metadata / manifest it may be an idea to borrow some ideas from the visual studio code one
that seems to have the best extension manager I've seen so far (although it's written in a different language)
https://code.visualstudio.com/api/refer ... n-manifest
One option might be to pick up metadata from the new pyproject.toml which I think replaces setup.py
I've been considering trying to write my own implementation of an extension manager possibly using rust
which I think would work but may have issues with Qt bindings which don't seem to have gotten a lot of attention from the rust side of things
Addon Manager and pip based Addons for 1.0?
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Be nice to others! Respect the FreeCAD code of conduct!
-
- Posts: 14
- Joined: Sun Mar 17, 2019 3:55 am
Re: Addon Manager and pip based Addons for 1.0?
That type of addon should already work fine: you can use pip to install that type of workbench in the current version of FreeCAD (it should work with everything 0.19 and later).
-
- Posts: 14
- Joined: Sun Mar 17, 2019 3:55 am
Re: Addon Manager and pip based Addons for 1.0?
It does install / work via pip
but the question is, is it compatible with the existing Addon Manager?
Ideally you want everything available listed in the Addon Manager.
but the question is, is it compatible with the existing Addon Manager?
Ideally you want everything available listed in the Addon Manager.
Re: Addon Manager and pip based Addons for 1.0?
The Addon Manager shows the packages available in the FreeCAD-Addons GitHub repository. If a pip-installable package is listed in that location it will show in the Addon Manager, but the AM does not use pip to install those packages. The pip installation process was designed to be an additional way to install packages, outside the Addon Manager.
-
- Posts: 14
- Joined: Sun Mar 17, 2019 3:55 am
Re: Addon Manager and pip based Addons for 1.0?
When I read the description here - https://github.com/FreeCAD/freecad.workbench_starterkit
It mentions
(perhaps it shouldn't be describing the old method as legacy)
I might see if I can write my own addon manager as a proof of concept in python to cover pip installs
It mentions
This sort of suggests that the pip method is the newer preferred method rather than just an alternative.Note: There are currently two FreeCAD workbench styles.
The origin workbench type is called "legacy-workbench".
In addition the "namespace-workbench" is now an optional (and preffered) way to extend the FreeCAD.
(See Glossary terms used in this discussion). For more discussion about the motivation behind the "namespace-workbench" see Motivation for namespace-workbenches.
(perhaps it shouldn't be describing the old method as legacy)
I might see if I can write my own addon manager as a proof of concept in python to cover pip installs
Re: Addon Manager and pip based Addons for 1.0?
I thunk that pip is not very usable if you have an AppInage or a Snap similar "compressed container", orvthere us a way to adree things using some external directory that will contain "added packages" and that us readed automagically when the Appimage (Snap or wathever else) is started?
Regards
Carlo D.
Regards
Carlo D.
GitHub page: https://github.com/onekk/freecad-doc.
- In deep articles on FreeCAD.
- Learning how to model with scripting.
- Various other stuffs.
Blog: https://okkmkblog.wordpress.com/
- In deep articles on FreeCAD.
- Learning how to model with scripting.
- Various other stuffs.
Blog: https://okkmkblog.wordpress.com/
Re: Addon Manager and pip based Addons for 1.0?
You can tell pip to install in a specific directory: the Addon Manager already does this for dependencies. The real problem with pip is that it doesn't have a public API, so you are stuck with text processing to handle its output. The AM does this (and there is more coming as I add the ability to update those dependencies), but it's ugly.
Re: Addon Manager and pip based Addons for 1.0?
From a quick reading, and being on mobile for some days, it seems that distlib could have some API tominteract with PyPi that from what I know is the "repository" were pip packages are placed.
It is cited in the linked doc you have posted.
Probably you have seen this, but just in case...
Regards
Carlo D.
It is cited in the linked doc you have posted.
Probably you have seen this, but just in case...
Regards
Carlo D.
GitHub page: https://github.com/onekk/freecad-doc.
- In deep articles on FreeCAD.
- Learning how to model with scripting.
- Various other stuffs.
Blog: https://okkmkblog.wordpress.com/
- In deep articles on FreeCAD.
- Learning how to model with scripting.
- Various other stuffs.
Blog: https://okkmkblog.wordpress.com/
- adrianinsaval
- Veteran
- Posts: 5552
- Joined: Thu Apr 05, 2018 5:15 pm
Re: Addon Manager and pip based Addons for 1.0?
Kinda off topic but I have a question, @chennes does any of the currently whitelisted pip packages require compilation?