Addon Manager Redesign 2021

Info about new community or project announcements, implemented features, classes, modules or APIs. Might get technical!
PLEASE DO NOT POST HELP REQUESTS OR OTHER DISCUSSIONS HERE!
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
User avatar
chennes
Veteran
Posts: 3911
Joined: Fri Dec 23, 2016 3:38 pm
Location: Norman, OK, USA
Contact:

Re: Addon Manager Redesign 2021

Post by chennes »

I think the issue will probably be resolved by git commit 46b70c73fe -- if you are able to check that, please report back.
Chris Hennes
Pioneer Library System
GitHub profile, LinkedIn profile, chrishennes.com
User avatar
onekk
Veteran
Posts: 6209
Joined: Sat Jan 17, 2015 7:48 am
Contact:

Re: Addon Manager Redesign 2021

Post by onekk »

What is the correct way of refreshing Addon Manager cache (on Linux)

As example, I'm trying to iinstall toSketch WB.

In image1 you will see the starting situation, no toSketch on the list

Image1
addon1.png
addon1.png (109.24 KiB) Viewed 1251 times
in IMage2 you will see the situation after having pressed the "refresh local cache" button.

toSketch is existing but not informations nor icon is shown.


Image2
addon2.png
addon2.png (105.44 KiB) Viewed 1251 times

in image3 the situation after having installed the WB but prior to restart FC.

Image3
addon3.png
addon3.png (111.17 KiB) Viewed 1251 times
After having restarted FC sadly it return to image1, and even in the "installed package" toSketch is not shown if I don't "refresh local cache"

So it seems that local cache is not cached at all? or maybe it is using some hardcoded path other than deriving from user_dir that I have as "per session" issuing:

Code: Select all

export FREECAD_USER_HOME="/home/common/FreeCAD/config-020-eng"
prior to start FC Appimage, tested and screenshot from:

Code: Select all

OS: Artix Linux (openbox)
Word size of FreeCAD: 64-bit
Version: 0.20.1.29410 (Git) AppImage
Build type: Release
Branch: (HEAD detached at 0.20.1)
Hash: f5d13554ecc7a456fb6e970568ae5c74ba727563
Python 3.10.5, Qt 5.15.4, Coin 4.0.0, Vtk 9.1.0, OCC 7.6.2
Locale: Italian/Italy (it_IT)
Installed mods: 
  * Curves 0.5.7

But even for 0.21 with conda-install is the same.

It seems that cache is not modified by AddonManager or I have to set something in Preferences?

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/
User avatar
adrianinsaval
Veteran
Posts: 5551
Joined: Thu Apr 05, 2018 5:15 pm

Re: Addon Manager Redesign 2021

Post by adrianinsaval »

something weird going on with that addon, it doesn't show in the webpage of the addons repo: https://github.com/FreeCAD/FreeCAD-addons but it is listed in .gitmodules files
User avatar
onekk
Veteran
Posts: 6209
Joined: Sat Jan 17, 2015 7:48 am
Contact:

Re: Addon Manager Redesign 2021

Post by onekk »

adrianinsaval wrote: Tue Sep 06, 2022 1:26 pm something weird going on with that addon, it doesn't show in the webpage of the addons repo: https://github.com/FreeCAD/FreeCAD-addons but it is listed in .gitmodules files
It seems that the page you linked is not up to date, as it is very old as example if you see Curves Wb it is left at 0.4.2 version (now it is at 0.5.7, or at least this is the version I have).
The link on this github page point at:

https://github.com/tomate44/CurvesWB/bl ... ackage.xml

But this is the actual version of Curves WB.

https://github.com/tomate44/CurvesWB


So probably another question is what is the correct way to add an "Add-On" as example a WB to the AddOnManager?

Other than complying with this passage:
Submit a Pull Request to this repository adding your Addon to the .gitmodules file. Supported git hosts are GitHub, Gitlab, Framagit. ...

The strange behaviour is present even in 0.21.30xxx now I've not fired up FC but it is a week old "conda install".


Any hint?

Regards

Carlo D.

PS: Amended post to delete some not relevant images.
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/
User avatar
adrianinsaval
Veteran
Posts: 5551
Joined: Thu Apr 05, 2018 5:15 pm

Re: Addon Manager Redesign 2021

Post by adrianinsaval »

onekk wrote: Tue Sep 06, 2022 2:03 pm It seems that the page you linked is not up to date, as it is very old as example if you see Curves Wb it is left at 0.4.2 version (now it is at 0.5.7, or at least this is the version I have).
That's normal, the submodules are used just to give the addon manager a link to the repo, in normal git usage these are supposed to point to a specific commit and that's why when you follow the link it shows an old version (this is the version when the submodule was added). The addon manager of course knows better and checks out the latest available.
But the case with toSketch is weird because it's not even shown, perhaps the module was not initialized? I'm not sure what is needed to get it displayed. I would guess the addon manager should still function though.
onekk wrote: Tue Sep 06, 2022 2:03 pm As you could see there is way far less items than in the page:
my guess is that not all addons in the repo have a package.xml file and only those who have them would be in that directory, this is just a guess so I might be completely wrong.
User avatar
onekk
Veteran
Posts: 6209
Joined: Sat Jan 17, 2015 7:48 am
Contact:

Re: Addon Manager Redesign 2021

Post by onekk »

adrianinsaval wrote: Tue Sep 06, 2022 2:22 pm
onekk wrote: Tue Sep 06, 2022 2:03 pm As you could see there is way far less items than in the page:
my guess is that not all addons in the repo have a package.xml file and only those who have them would be in that directory, this is just a guess so I might be completely wrong.
I amended the page, as at a second check probably the content is split from WB and Macros.

From what I could guess from the page the only requirements a part from those in the wiki are to add the module to the .gitmodules file.

And I suspect that is linked to the way AddOnManager manage the cache, as I've seen that after a FC restart even installed modules are not shown until I do a "refresh local cache"
  • something is happening to the cache, or it is not loaded from "the right place", as I'm assigning a different "user directory" for FC for every version I've installed as told above in an another post.
  • or there cache is not overwritten after installing a wb, so it is not found. (but FC is knowing that is installed as it is "regularly" put in the Mod dir)
Let's see if @chennes will have some hints.

Thanks again.

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/
User avatar
chennes
Veteran
Posts: 3911
Joined: Fri Dec 23, 2016 3:38 pm
Location: Norman, OK, USA
Contact:

Re: Addon Manager Redesign 2021

Post by chennes »

The branch name is wrong in the package.xml file -- it lists "master", but the actual branch is "main". This causes all sorts of havoc in the AM, which is at first able to fetch a package.xml file, but cannot then use the information in it.
Chris Hennes
Pioneer Library System
GitHub profile, LinkedIn profile, chrishennes.com
User avatar
onekk
Veteran
Posts: 6209
Joined: Sat Jan 17, 2015 7:48 am
Contact:

Re: Addon Manager Redesign 2021

Post by onekk »

chennes wrote: Tue Sep 06, 2022 2:56 pm The branch name is wrong in the package.xml file -- it lists "master", but the actual branch is "main". This causes all sorts of havoc in the AM, which is at first able to fetch a package.xml file, but cannot then use the information in it.
Thanks I will amend the information.

EDIT2: erratic behaviour, now it is not working anymore, I can install the addon, and I've amended the package.xml as follow:

Code: Select all

<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<package format="1" xmlns="https://wiki.freecad.org/Package_Metadata">
  <name>toSketch</name>
  <description>Add toSketch facility for FreeCAD. This WB help with remodelling of existing models.</description>
  <version>1.0.0</version>
  <maintainer email="keith@sloan-home.co.uk">Keith Sloan</maintainer>
  <license file="LICENSE">GPL-2.0</license>
  <url type="repository" branch="main">https://github.com/KeithSloan/toSketch</url>
  <url type="readme">https://github.com/KeithSloan/toSketch/README.md</url>

  <content>
    <workbench>
      <classname>toSketch_Workbench</classname>
      <description>Add toSketch facility for FreeCAD. This WB help with remodelling of existing models.</description>
      <version>1.0.0</version>
      <subdirectory>./</subdirectory>
      <icon>freecad/toSketch/Resources/icons/toSketch.svg</icon>
      <freecadmin>0.19.0</freecadmin>
      <tag>sketcher</tag>
    </workbench>
  </content>

</package>
@chennes What I'm doing wrong?

I've noted that it will insist to point me when i select toSketch and press the mouse to the README.md with the following url:

https://github.com/KeithSloan/toSketch ... README.md

despite changes in the above file

I have deleted the /home/common/FreeCAD/config-020-eng/temp/AddonManager/r directory but nothing has changed.

These informations are stored elsewere?

After having deleted the cahe directory I have this file /home/common/FreeCAD/config-020-eng/temp/AddonManager/package_cache.json that contain this "stanza" where the branch is "master".

Code: Select all

  "toSketch": {
    "name": "toSketch",
    "display_name": "toSketch",
    "url": "https://github.com/KeithSloan/toSketch",
    "branch": "master",
    "repo_type": 1,
    "description": null,
    "cached_icon_filename": "",
    "python2": false,
    "obsolete": false,
    "rejected": false,
    "requires": [],
    "blocks": [],
    "python_requires": [],
    "python_optional": []
  },
This file is recreated by the AddOn Manager when I close addonmanager so it is clearly fetching information from some wrong sources.

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/
User avatar
adrianinsaval
Veteran
Posts: 5551
Joined: Thu Apr 05, 2018 5:15 pm

Re: Addon Manager Redesign 2021

Post by adrianinsaval »

The package.xml must be fixed in the add-on repo I believe
I think @keithsloan52 is the author? If there's no response please open an issue or make a PR to the add-on repo
User avatar
onekk
Veteran
Posts: 6209
Joined: Sat Jan 17, 2015 7:48 am
Contact:

Re: Addon Manager Redesign 2021

Post by onekk »

adrianinsaval wrote: Tue Sep 06, 2022 3:57 pm ...
I'm "working" for keithsloan to fix up his repositories :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/
Post Reply