Add ons manager - development and bugs topic

Here's the place for discussion related to coding in FreeCAD, C++ or Python. Design, interfaces and structures.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Syres
Veteran
Posts: 2902
Joined: Thu Aug 09, 2018 11:14 am

Re: [regression] Re: Add ons manager - development and bugs topic

Post by Syres »

uwestoehr wrote: Mon May 04, 2020 1:51 pm Since this I cannot use the AddonManager anymore. When starting it, I get now this error:

Code: Select all

Traceback (most recent call last):
  File "D:\FreeCAD-build\Mod\AddonManager\addonmanager_workers.py", line 159, in run
    git_version = StrictVersion(result.group(1))
AttributeError: 'NoneType' object has no attribute 'group'
Sorry, I've tested this with three different builds with three different Git binaries and never got this error. Before I back it all out could you please change in src\Mod\AddonManager\addonmanager_workers.py line 154 from:

Code: Select all

        from distutils.version import StrictVersion
        if 'out' in locals():
            out_string = out.read()
            out.close()
            result = re.search('(\d+\.\d+\.\d+)',out_string)
            git_version = StrictVersion(result.group(1))
            if platform.system() == 'Windows':
                FreeCAD.Console.PrintLog(translate("AddonsInstaller","Found Git executable version ")+str(git_version)+"\n")
            else:
                FreeCAD.Console.PrintLog(translate("AddonsInstaller","Found Git binary version ")+str(git_version)+"\n")
        else:
            git_version = StrictVersion("0.0.0")
        self.progressbar_show.emit(False)
        self.done.emit()
        self.stop = True

to:

Code: Select all

        from distutils.version import StrictVersion
        if 'out' in locals():
            out_string = out.read()
            out.close()
            print(out_string)
            result = re.search('(\d+\.\d+\.\d+)',out_string)
            # git_version = StrictVersion(result.group(1))
            git_version = StrictVersion("2.15.0")
            if platform.system() == 'Windows':
                FreeCAD.Console.PrintLog(translate("AddonsInstaller","Found Git executable version ")+str(git_version)+"\n")
            else:
                FreeCAD.Console.PrintLog(translate("AddonsInstaller","Found Git binary version ")+str(git_version)+"\n")
        else:
            git_version = StrictVersion("0.0.0")
        self.progressbar_show.emit(False)
        self.done.emit()
        self.stop = True
That should get AddonManger dialog to load (I know the actual installing/updating will still fail for you) but if you could please reply with the print output in the Report View which should have something to do with Git version just above the 'Found Git binary version 2.15', I can then use that to determine if I can reliably get it to work.

Thanks in advance.
Syres
Veteran
Posts: 2902
Joined: Thu Aug 09, 2018 11:14 am

Re: Add ons manager - development and bugs topic

Post by Syres »

Backout patch is prepared if needs to be PR'd https://github.com/Syres916/FreeCAD/tree/patch-23
User avatar
uwestoehr
Veteran
Posts: 4961
Joined: Sun Jan 27, 2019 3:21 am
Location: Germany
Contact:

Re: [regression] Re: Add ons manager - development and bugs topic

Post by uwestoehr »

Syres wrote: Mon May 04, 2020 2:39 pm if you could please reply with the print output in the Report View
I did so but now I don't get any output in the Report View dialog.
But when I want to update an installed WB I get the same issue again:

Code: Select all

Traceback (most recent call last):
  File "D:\FreeCAD-build\Mod\AddonManager\addonmanager_workers.py", line 678, in run
    git_version = StrictVersion(result.group(1))
AttributeError: 'NoneType' object has no attribute 'group'
I have Git installed separately from FC because I need it for software development. Here the info from its GUI:
GIT version info
GIT version info
wish_y6uWv8ue1e.png (27.14 KiB) Viewed 1185 times
User avatar
uwestoehr
Veteran
Posts: 4961
Joined: Sun Jan 27, 2019 3:21 am
Location: Germany
Contact:

Re: [regression] Re: Add ons manager - development and bugs topic

Post by uwestoehr »

uwestoehr wrote: Mon May 04, 2020 3:08 pm I have Git installed separately from FC ...
Now I upgraded to Git 2.26.2 but the problem persists.
Syres
Veteran
Posts: 2902
Joined: Thu Aug 09, 2018 11:14 am

Re: [regression] Re: Add ons manager - development and bugs topic

Post by Syres »

uwestoehr wrote: Mon May 04, 2020 3:08 pm I did so but now I don't get any output in the Report View dialog.
Ok, thanks, I'm going to PR the backout patch, I also installed exactly the same version this morning and my main surprise was the amount of questions during the install and the number of variables.

This is what has come home to roost (we must not have used the same settings) because I can pick up the version number from the command line easy but it sounds as though during the installation I got my path updated in the correct place.
Syres
Veteran
Posts: 2902
Joined: Thu Aug 09, 2018 11:14 am

Re: Add ons manager - development and bugs topic

Post by Syres »

Backout PR: https://github.com/FreeCAD/FreeCAD/pull/3432
yorik wrote: Sorry for causing you unnecessary hassle
User avatar
uwestoehr
Veteran
Posts: 4961
Joined: Sun Jan 27, 2019 3:21 am
Location: Germany
Contact:

Re: Add ons manager - development and bugs topic

Post by uwestoehr »

Syres wrote: Mon May 04, 2020 3:23 pm Backout PR: https://github.com/FreeCAD/FreeCAD/pull/3432
many thanks. I can confirm that this fixes the problem.
User avatar
mnesarco
Posts: 475
Joined: Thu Mar 26, 2020 8:52 pm

Re: Add ons manager - development and bugs topic

Post by mnesarco »

Hi Friends,

I want to propose some changes to the Addon Manager, I am working on a PR but i want to have your feedback before going to far.

Currently the AddonManager requires that all external workbenches send the icon to the main FreeCAD repo and they are compiled into the FreeCAD distribution. This is a bit rigid and hard to maintain. I propose to put a small file in the root of each External workbench repo with basic metadata. so the addon manager can download icons and other metadata without the need to parse the github's html or things like that because that is very fragile and not portable.

I propose a file called addon.json with the following structure:

Example:

Code: Select all

{
    "title": "MyWorkbench",
    "icon_path": "Resources/icons/workbench.svg",
    "authors": ["Frank D. Martinez M."],
    "license": "GPLv3",
    "license_path": "LICENSE",
    "homepage": "http://marzguitars.com",
    "categories": ["Instruments", "Parts"]
}
If the file is detected in the repo, metadata is obtained from it, if not found, fallback to the current impl and it is transparent for the user.

README should be obtained as it is right now because it is downloaded in rendered HTML to be ready to display. I know there is a problem with other sites different from github because rendering is done by javascript, but i don't have ideas for that yet.

I am working on the metadata change as a proposal. I have advanced deeply but i wonder if you have valid objections to this approach, so any feedback now will be very valuable :D
User avatar
Kunda1
Veteran
Posts: 13434
Joined: Thu Jan 05, 2017 9:03 pm

Re: Add ons manager - development and bugs topic

Post by Kunda1 »

Alone you go faster. Together we go farther
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
'good first issues' | Open TODOs and FIXMEs | How to Help FreeCAD | How to report Bugs
User avatar
mnesarco
Posts: 475
Joined: Thu Mar 26, 2020 8:52 pm

Re: Add ons manager - development and bugs topic

Post by mnesarco »

Kunda1 wrote: Fri May 08, 2020 2:02 am Please see https://github.com/FreeCAD/FreeCAD-addons/issues/29
Ok I have read the thread, same idea but:

1. Is there any current implementation of the mentioned ideas?
2. Which format was finally selected? INI?
3. Is someone actually working on that?
Post Reply