Addon Manager Developer Mode

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!
User avatar
Kunda1
Veteran
Posts: 13434
Joined: Thu Jan 05, 2017 9:03 pm

Re: Addon Manager Developer Mode

Post by Kunda1 »

Thx chennes!
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
onekk
Veteran
Posts: 6149
Joined: Sat Jan 17, 2015 7:48 am
Contact:

Re: Addon Manager Developer Mode

Post by onekk »

As a side note I have this warning:
Worker process check_for_python_package_updates_worker is taking a long time to stop...
And it blocks the exit from the session, that I start from a terminal using a script, forcing me to close the "terminal window" but FreeCAD window is closing correctly. If you need further infos feel free to ask.

It work correctly in:

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.8

But the error is present in:

Code: Select all

OS: Artix Linux (openbox)
Word size of FreeCAD: 64-bit
Version: 0.21.30398 (Git)
Build type: Release
Branch: master
Hash: b3dfdc568a92810449bf47bc73b6784d65dfa206
Python 3.10.6, Qt 5.15.4, Coin 4.0.0, Vtk 9.1.0, OCC 7.6.3
Locale: Italian/Italy (it_IT)
Installed mods: 
  * test_wb
  * fcgear 1.0.0
  * Assembly4 0.12.4
  * toSketch 1.0.1
  * Curves 0.5.8
   * Help 1.0.3
I think that the culprit could be these multiple invocation of QtWebEngineProcess, taken from a:

Code: Select all

ps ax
when FC "terminal window" is not closing, I invoke FC using a script that issue the 6875 command to launch my "conda-install" version.

Code: Select all

 6875 ?        S      0:00 urxvt -T FreeCAD-launcher -e freecad
 6876 pts/3    Ssl+   1:34 freecad
 6893 pts/3    S+     0:00 /home/carlo-arch/miniconda3/envs/fcenv-dev/libexec/QtWebEngineProces
 6894 pts/3    S+     0:00 /home/carlo-arch/miniconda3/envs/fcenv-dev/libexec/QtWebEngineProces
 6909 pts/3    Sl+    0:00 /home/carlo-arch/miniconda3/envs/fcenv-dev/libexec/QtWebEngineProces
 6946 pts/3    Sl+    0:00 /home/carlo-arch/miniconda3/envs/fcenv-dev/libexec/QtWebEngineProces
 7065 pts/3    S+     0:00 /home/carlo-arch/miniconda3/envs/fcenv-dev/bin/python3
 7165 pts/3    Sl+    0:00 /home/carlo-arch/miniconda3/envs/fcenv-dev/libexec/QtWebEngineProces
 7350 pts/3    Sl+    0:02 /home/carlo-arch/miniconda3/envs/fcenv-dev/libexec/QtWebEngineProces
EDIT:

This the output of the same command after starting FC without trying to use the AddOn Manager.

Code: Select all

8370 ?        S      0:00 urxvt -T FreeCAD-launcher -e freecad
 8371 pts/3    Ssl+   0:02 freecad
 8388 pts/3    S+     0:00 /home/carlo-arch/miniconda3/envs/fcenv-dev/libexec/QtWebEngineProces
 8389 pts/3    S+     0:00 /home/carlo-arch/miniconda3/envs/fcenv-dev/libexec/QtWebEngineProces
 8404 pts/3    Sl+    0:00 /home/carlo-arch/miniconda3/envs/fcenv-dev/libexec/QtWebEngineProces
 8406 pts/3    Sl+    0:00 /home/carlo-arch/miniconda3/envs/fcenv-dev/libexec/QtWebEngineProces
 8455 pts/1    R+     0:00 ps ax

But it close correctly the "terminal windows" if I exit from FC

As a side note FC 0.20.1 is an AppImage.

Hope it help.

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

Re: Addon Manager Developer Mode

Post by chennes »

Thanks, I have some time now I'll see if I can poke at that check_for_python_package_updates_worker problem now.
Chris Hennes
Pioneer Library System
GitHub profile, LinkedIn profile, chrishennes.com
User avatar
chennes
Veteran
Posts: 3884
Joined: Fri Dec 23, 2016 3:38 pm
Location: Norman, OK, USA
Contact:

Re: Addon Manager Developer Mode

Post by chennes »

I added a timeout to the pip process, can you let me know if this has an affect on your bug?
git commit 9e1ed4a68
Chris Hennes
Pioneer Library System
GitHub profile, LinkedIn profile, chrishennes.com
User avatar
onekk
Veteran
Posts: 6149
Joined: Sat Jan 17, 2015 7:48 am
Contact:

Re: Addon Manager Developer Mode

Post by onekk »

chennes wrote: Wed Sep 21, 2022 7:54 pm ...
As soon conda-install is updated I will surely let you know.

If AddonManager could be made an AddOn itself or cloned in the user Mod dir, it will be more easy.

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

Re: Addon Manager Developer Mode

Post by chennes »

I've added a new metadata tag, <pythonmin>, that allows Addon developers to specify a minimum required version of Python. I've also added a scanning feature to the Addon Manager Developer Mode that uses the Vermin package to scan your addon and determine what it things is your required minimum version of Python based on the features you use. This tag will be ignored by older versions of FreeCAD, so it is safe to include in your package.xml metadata file.
Chris Hennes
Pioneer Library System
GitHub profile, LinkedIn profile, chrishennes.com
User avatar
mfraz74
Posts: 158
Joined: Mon Apr 05, 2021 9:19 am
Contact:

Re: Addon Manager Developer Mode

Post by mfraz74 »

onekk wrote: Wed Sep 21, 2022 3:23 pm As a side note I have this warning:
Worker process check_for_python_package_updates_worker is taking a long time to stop...
And it blocks the exit from the session, that I start from a terminal using a script, forcing me to close the "terminal window" but FreeCAD window is closing correctly. If you need further infos feel free to ask.

It work correctly in:

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.8

But the error is present in:

Code: Select all

OS: Artix Linux (openbox)
Word size of FreeCAD: 64-bit
Version: 0.21.30398 (Git)
Build type: Release
Branch: master
Hash: b3dfdc568a92810449bf47bc73b6784d65dfa206
Python 3.10.6, Qt 5.15.4, Coin 4.0.0, Vtk 9.1.0, OCC 7.6.3
Locale: Italian/Italy (it_IT)
Installed mods: 
  * test_wb
  * fcgear 1.0.0
  * Assembly4 0.12.4
  * toSketch 1.0.1
  * Curves 0.5.8
   * Help 1.0.3
I think that the culprit could be these multiple invocation of QtWebEngineProcess, taken from a:

Code: Select all

ps ax
when FC "terminal window" is not closing, I invoke FC using a script that issue the 6875 command to launch my "conda-install" version.

Code: Select all

 6875 ?        S      0:00 urxvt -T FreeCAD-launcher -e freecad
 6876 pts/3    Ssl+   1:34 freecad
 6893 pts/3    S+     0:00 /home/carlo-arch/miniconda3/envs/fcenv-dev/libexec/QtWebEngineProces
 6894 pts/3    S+     0:00 /home/carlo-arch/miniconda3/envs/fcenv-dev/libexec/QtWebEngineProces
 6909 pts/3    Sl+    0:00 /home/carlo-arch/miniconda3/envs/fcenv-dev/libexec/QtWebEngineProces
 6946 pts/3    Sl+    0:00 /home/carlo-arch/miniconda3/envs/fcenv-dev/libexec/QtWebEngineProces
 7065 pts/3    S+     0:00 /home/carlo-arch/miniconda3/envs/fcenv-dev/bin/python3
 7165 pts/3    Sl+    0:00 /home/carlo-arch/miniconda3/envs/fcenv-dev/libexec/QtWebEngineProces
 7350 pts/3    Sl+    0:02 /home/carlo-arch/miniconda3/envs/fcenv-dev/libexec/QtWebEngineProces
EDIT:

This the output of the same command after starting FC without trying to use the AddOn Manager.

Code: Select all

8370 ?        S      0:00 urxvt -T FreeCAD-launcher -e freecad
 8371 pts/3    Ssl+   0:02 freecad
 8388 pts/3    S+     0:00 /home/carlo-arch/miniconda3/envs/fcenv-dev/libexec/QtWebEngineProces
 8389 pts/3    S+     0:00 /home/carlo-arch/miniconda3/envs/fcenv-dev/libexec/QtWebEngineProces
 8404 pts/3    Sl+    0:00 /home/carlo-arch/miniconda3/envs/fcenv-dev/libexec/QtWebEngineProces
 8406 pts/3    Sl+    0:00 /home/carlo-arch/miniconda3/envs/fcenv-dev/libexec/QtWebEngineProces
 8455 pts/1    R+     0:00 ps ax

But it close correctly the "terminal windows" if I exit from FC

As a side note FC 0.20.1 is an AppImage.

Hope it help.

Regards

Carlo D.
Also seeing this with

Code: Select all

OS: Ubuntu 22.04.1 LTS (KDE/plasma)
Word size of FreeCAD: 64-bit
Version: 0.21.30492 (Git) AppImage
Build type: Release
Branch: master
Hash: b4578fb3eae842eb510a1bc055d07d369a67ce94
Python 3.10.6, Qt 5.15.4, Coin 4.0.0, Vtk 9.1.0, OCC 7.6.3
Locale: English/United Kingdom (en_GB)
Installed mods: 
  * sheetmetal 0.2.57
  * Manipulator 1.4.9
  * lattice2 1.0.0
  * fcgear 1.0.0
  * Curves 0.5.8
  * Assembly4 0.11.8
  * fasteners
  * A2plus 0.4.59d
  * ThreadProfile 1.84.0
  * Assembly3 0.11.3
  * VendorParts
If I click on the "Python dependencies.." button, FreeCAD will freeze and clicking close brings up the Application "freecad" is not responding.

Running from CLI:

Code: Select all

1.12302 <asm3.main> init_gui.py(14): no solver backend found
Worker process check_for_python_package_updates_worker is taking a long time to stop...
pip took longer than 30 seconds to return results, giving up on itTraceback (most recent call last):
  File "/tmp/.mount_FreeCAPVl7Ys/usr/Mod/AddonManager/manage_python_dependencies.py", line 54, in run
    if check_for_python_package_updates():
  File "/tmp/.mount_FreeCAPVl7Ys/usr/Mod/AddonManager/manage_python_dependencies.py", line 64, in check_for_python_package_updates
    outdated_packages_stdout = call_pip(["list", "-o", "--path", vendor_path])
  File "/tmp/.mount_FreeCAPVl7Ys/usr/Mod/AddonManager/manage_python_dependencies.py", line 112, in call_pip
    raise Exception(proc.stderr.decode())
UnboundLocalError: local variable 'proc' referenced before assignment
User avatar
chennes
Veteran
Posts: 3884
Joined: Fri Dec 23, 2016 3:38 pm
Location: Norman, OK, USA
Contact:

Re: Addon Manager Developer Mode

Post by chennes »

Can you let me know if git commit 9b4183581 resolves the issue for you?
Chris Hennes
Pioneer Library System
GitHub profile, LinkedIn profile, chrishennes.com
User avatar
mfraz74
Posts: 158
Joined: Mon Apr 05, 2021 9:19 am
Contact:

Re: Addon Manager Developer Mode

Post by mfraz74 »

chennes wrote: Mon Oct 03, 2022 9:31 pm Can you let me know if git commit 9b4183581 resolves the issue for you?

Code: Select all

OS: Ubuntu 22.04.1 LTS (KDE/plasma)
Word size of FreeCAD: 64-bit
Version: 0.21.30492 (Git) AppImage
Build type: Release
Branch: master
Hash: b4578fb3eae842eb510a1bc055d07d369a67ce94
Python 3.10.6, Qt 5.15.4, Coin 4.0.0, Vtk 9.1.0, OCC 7.6.3
Locale: English/United Kingdom (en_GB)
Installed mods: 
  * sheetmetal 0.2.58
  * Manipulator 1.4.9
  * lattice2 1.0.0
  * fcgear 1.0.0
  * Curves 0.5.10
  * Assembly4 0.11.8
  * fasteners
  * A2plus 0.4.59d
  * ThreadProfile 1.84.0
  * Assembly3 0.11.3
  * VendorParts
Still not working, in the Addon Manager the last text it shows at the bottom is "Download icon for frame"

Code: Select all

pip took longer than 30 seconds to return results, giving up on itTraceback (most recent call last):
  File "/tmp/.mount_FreeCA508knG/usr/Mod/AddonManager/manage_python_dependencies.py", line 54, in run
    if check_for_python_package_updates():
  File "/tmp/.mount_FreeCA508knG/usr/Mod/AddonManager/manage_python_dependencies.py", line 64, in check_for_python_package_updates
    outdated_packages_stdout = call_pip(["list", "-o", "--path", vendor_path])
  File "/tmp/.mount_FreeCA508knG/usr/Mod/AddonManager/manage_python_dependencies.py", line 112, in call_pip
    raise Exception(proc.stderr.decode())
UnboundLocalError: local variable 'proc' referenced before assignment
User avatar
chennes
Veteran
Posts: 3884
Joined: Fri Dec 23, 2016 3:38 pm
Location: Norman, OK, USA
Contact:

Re: Addon Manager Developer Mode

Post by chennes »

That’s the same version, you will need to update before it works. At the very least the line number of the error will change.
Chris Hennes
Pioneer Library System
GitHub profile, LinkedIn profile, chrishennes.com
Post Reply