Addon Manager Developer Mode
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Be nice to others! Respect the FreeCAD code of conduct!
Addon Manager Developer Mode
I've just pushed a large changeset to the Addon Manager, adding a beta version of a new "Developer Mode", designed to help developers package up their addons for distribution. As a first task, it assists with creating a correct package.xml metadata file.
To activate the mode, check the box in Preferences: That will enable a new button in the Addon Manager: Which will activate a whole sequence of dialogs, centered around this one: This is still very much a work in progress, so I welcome your feedback, bug reports, and feature suggestions.
To activate the mode, check the box in Preferences: That will enable a new button in the Addon Manager: Which will activate a whole sequence of dialogs, centered around this one: This is still very much a work in progress, so I welcome your feedback, bug reports, and feature suggestions.
Re: Addon Manager Developer Mode
Amazing work @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
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
- HakanSeven12
- Veteran
- Posts: 1481
- Joined: Wed Feb 06, 2019 10:30 pm
Re: Addon Manager Developer Mode
Nice
Support me: Hakan Seven on Patreon
Modern UI: Modern UI on FreeCAD Forum
Trails Workbench: Trails Workbench on FreeCAD Forum
Modern UI: Modern UI on FreeCAD Forum
Trails Workbench: Trails Workbench on FreeCAD Forum
Re: Addon Manager Developer Mode
'Addon Manager Developer Mode' is now available in the latest Snap 'edge' for those wanting to test @chennes's feature.
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
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
Re: Addon Manager Developer Mode
This seems really good, well done chennes!
Re: Addon Manager Developer Mode
I should also note that I tweaked the actual metadata standard while I was working on this, most notably adding the "optional" and "type" attributes to dependencies. These changes are backwards-compatible (previous versions of FreeCAD will just ignore them) and they are of course optional.
I'm planning on making another change as part of my longer-term plan to ensure that users stuck on older versions of FreeCAD don't accidentally get updated to a version of an Addon that is no longer compatible with that version, but I'd like to get some feedback on what that looks like before I implement it. I am thinking of something along the lines of:
The syntax here is exactly the same as the dependency attributes, except that the "version" referred to uses FreeCAD's version, and the tag contents are a git reference of some kind (hash, tag, or branch). I don't really like the "release" nomenclature, but I haven't thought of anything better, so please feel free to make a suggestion.
I'm planning on making another change as part of my longer-term plan to ensure that users stuck on older versions of FreeCAD don't accidentally get updated to a version of an Addon that is no longer compatible with that version, but I'd like to get some feedback on what that looks like before I implement it. I am thinking of something along the lines of:
Code: Select all
<release version_lt="0.20">abcd1234</freecad> <!-- Older versions of FC always get this specific hash, no updates -->
<release version_eq="0.20">FC0_19_Branch</freecad> <!-- v0.20 has its own maintenance branch -->
<release version_gt="0.20">main</freecad> <!-- Anything after 0.20 should use the branch called "main" -->
Re: Addon Manager Developer Mode
Now with:
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:
* Curves.backup1662281788.2751102 0.4.1
* fcgear.backup1662281841.5151978 1.0.0
* Assembly4.backup1663652740.0704694
* test_wb
* fcgear 1.0.0
* Assembly4 0.12.4
* Curves 0.5.8
* Help.backup1662281850.737508 1.0.3
* Help 1.0.3
but I've noted that the format is "not compliant" with the examples:
Code: Select all
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<package format="1">
<name>OpenSCAD alternate importer</name>
<description>An alternate OpenSCAD importer - with some experimental features</description>
<version>1.0.0</version>
<maintainer email="keith@sloan-home.co.uk">Keith Sloan</maintainer>
<license file="LICENSE">GPL-2</license>
<url branch="master" type="repository">https://github.com/KeithSloan/OpenSCAD_Alt_Import</url>
<url type="readme">https://github.com/KeithSloan/OpenSCAD_Alt_Import/blob/master/README.md</url>
<url type="documentation">https://github.com/KeithSloan/OpenSCAD_Alt_Import/wiki</url>
<icon>freecad/OpenSCAD_Alt_Import/Resources/icons/OpenSCAD_Alternate.png</icon>
<date>2022-08-18</date>
<content>
<workbench>
<freecadmin>0.20.0</freecadmin>
<tag>openscad</tag>
<tag>scripting</tag>
<tag>programming</tag>
<icon>freecad/OpenSCAD_Alt_Import/Resources/icons/OpenSCAD_Alternate.png</icon>
<classname>OpenSCAD_Alt_Import</classname>
<subdirectory>./</subdirectory>
</workbench>
</content>
</package>
Code: Select all
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<package format="1" xmlns="https://wiki.freecad.org/Package_Metadata">
<name>Legacy Workbench</name> <!-- What the Addon Manager displays to users -->
<description>Text that the Addon Manager shows for the Addon. Any length, but remember that Addon Manager's compact view only shows the first sentence or so.</description>
<version>1.0.1</version> <!-- Semantic versioning (1.2.3-beta) or CalVer-based, (2022.01.07), don't omit or non-git installations won't see your updates -->
<date>2022-01-07</date> <!-- Date of the last update to the version number -->
<maintainer email="your_address@null.com">Your Name</maintainer>
<license file="LICENSE">LGPL-2.1</license> <!-- Make sure you actually have this file in your Addon repo if the license requires it -->
<url type="repository" branch="main">https://github.com/chennes/FreeCAD-Package</url> <!-- Don't forget to update the branch name here -->
<url type="readme">https://github.com/chennes/FreeCAD-Package/blob/main/README.md</url> <!-- Link to the HTML-rendered README page -->
<icon>Resources/icons/PackageIcon.svg</icon> <!-- If you include your icon here, you don't have to submit it to the main FreeCAD repo -->
<content>
<workbench>
<classname>MyLegacyWorkbench</classname> <!-- Must match class name in InitGui.py -->
<subdirectory>./</subdirectory>
</workbench>
</content>
</package>
notably the
Code: Select all
<package format="1">
I have uploaded the "processed package.xml" to the site, to see if it is working correctly.
It seems that however the <name> used is taken from .gitmodules and not from the package.xml as it shown the "Alternate OpenSCAD...." instead of "OpenSCAD alternate importer" present in the package.xml.
EDIT:
As a side note I have this warning:
Code: Select all
Worker process check_for_python_package_updates_worker is taking a long time to stop...
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 Developer Mode
A few points:
- The order of the elements does not matter, and the XML writer is allowed to write them however it wants. So the formatting and order is basically out of my control, and doesn't affect anything.
- The XML is missing the required namespace element, so I do have to address that.
- The displayed name sounds like it's wrong, so I'll look into that.
Re: Addon Manager Developer Mode
Thanks for your work, and for you patience.
XML order is more a cosmetic thing, as usual a little note in the documentation will be useful IMHO, as probably other user will complain of "changed order".
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/