BIM Addon version number?

A forum dedicated to the Draft, Arch and BIM workbenches development.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Post Reply
User avatar
Roy_043
Veteran
Posts: 8580
Joined: Thu Dec 27, 2018 12:28 pm

BIM Addon version number?

Post by Roy_043 »

Since the BIM Addon can be updated independently, does it have its own version number?
Last edited by Kunda1 on Fri Aug 16, 2019 1:01 am, edited 1 time in total.
Reason: changed title for more clarity: s/nr/number/
User avatar
Kunda1
Veteran
Posts: 13434
Joined: Thu Jan 05, 2017 9:03 pm

Re: BIM Addon version nr?

Post by Kunda1 »

@Yorik hasn't given it an version yet, AFAIK
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
vocx
Veteran
Posts: 5197
Joined: Thu Oct 18, 2018 9:18 pm

Re: BIM Addon version nr?

Post by vocx »

Roy_043 wrote: Tue Aug 06, 2019 12:13 pm Since the BIM Addon can be updated independently, does it have its own version number?
I guess the version number is just the commit hash taken from the addon's own repository.

All addons are hosted in a separate repository FreeCAD-addons, which just pulls one commit (the latest?) from the individual repositories, in this case yorikvanhavre/BIM_Workbench. Since Yorik only has a single master, and no releases or tags, I guess it could be thought of as a rolling release.
Always add the important information to your posts if you need help. Also see Tutorials and Video tutorials.
To support the documentation effort, and code development, your donation is appreciated: liberapay.com/FreeCAD.
User avatar
Roy_043
Veteran
Posts: 8580
Joined: Thu Dec 27, 2018 12:28 pm

Re: BIM Addon version nr?

Post by Roy_043 »

Thanks for your answers.
I can find the latest commit hash for the version on GitHub, but how would you find this for the version you have installed?
vocx
Veteran
Posts: 5197
Joined: Thu Oct 18, 2018 9:18 pm

Re: BIM Addon version nr?

Post by vocx »

Roy_043 wrote: Wed Aug 07, 2019 7:05 am Thanks for your answers.
I can find the latest commit hash for the version on GitHub, but how would you find this for the version you have installed?
https://github.com/FreeCAD/FreeCAD/blob ... rs.py#L527

Code: Select all

            if os.path.exists(clonedir):
                self.info_label.emit("Updating module...")
                if git:
                    if not os.path.exists(clonedir + os.sep + '.git'):
                        # Repair addon installed with raw download
                        bare_repo = git.Repo.clone_from(self.repos[idx][1], clonedir + os.sep + '.git', bare=True)
                        try:
                            with bare_repo.config_writer() as cw:
                                cw.set('core', 'bare', False)
...
                        repo = git.Repo(clonedir)
                        repo.head.reset('--hard')
It seems that the Addon Manager uses Git (GitPython) to download the code from the repository. So, maybe the installed directories have some git information in them. I'm not sure if it's possible to query this.
Always add the important information to your posts if you need help. Also see Tutorials and Video tutorials.
To support the documentation effort, and code development, your donation is appreciated: liberapay.com/FreeCAD.
User avatar
Roy_043
Veteran
Posts: 8580
Joined: Thu Dec 27, 2018 12:28 pm

Re: BIM Addon version nr?

Post by Roy_043 »

@vocx:
That may be too hard for an average user like myself.
User avatar
Kunda1
Veteran
Posts: 13434
Joined: Thu Jan 05, 2017 9:03 pm

Re: BIM Addon version nr?

Post by Kunda1 »

It's a fair request.. I made a rudimentary PR to the BIM WB for this but @yorik thinks it should be implemented in a way that is gives the enduser more options (which makes more sense). See https://github.com/yorikvanhavre/BIM_Workbench/pull/30 basically lifted from the A2+ WB which shows the version number in the WB dropdown menu.

But @vocx makes a better point that we could use git to actually tell us the commit hash we have installed which could also be useful.
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
vocx
Veteran
Posts: 5197
Joined: Thu Oct 18, 2018 9:18 pm

Re: BIM Addon version nr?

Post by vocx »

Roy_043 wrote: Thu Aug 08, 2019 8:55 am @vocx:
That may be too hard for an average user like myself.
See this thread check workbench update with AddonManager

It seems at the moment each addon developer could implement a function to check the version of their own addon. But if the proper functions are moved to the Addon Manager, then this could work for all addons. It's probably only a matter of time until it's implemented. Just remind Yorik about it.
Always add the important information to your posts if you need help. Also see Tutorials and Video tutorials.
To support the documentation effort, and code development, your donation is appreciated: liberapay.com/FreeCAD.
Post Reply