Request to officially relax an addons-source restriction

Submitting to the gramps-project/addons-source repo are (unofficially but effectively) prohibitted from using code in the regisration.

Usually, this code is to allow plug-ins that are cross-compatible with multiple versions of Gramps to be maintained more easily. And be submitted for distribution in a single step.

This makes updating Addons harder for developers… for no benefit.

Can we discuss how this requirement could be relaxed?

(There have been discussions about making the target-version into an array in a .gpr.json rather than a .gpr.py module. If there is a reason to do that for the future, should we not consider permitting a functional workaround for the present?)

We can do this without allowing arbitrary code to run, which makes managing the plugins harder. In fact, haven’t we already discussed this and decide that we were going to add versions ranges?

I believe so, but that is about the future direction, whereas this request is meant to address the immediate issue for users TODAY.

As an example, the PR for your Data Entry Gramplet is languishing in the queue, and the only roadblock is the if/then logic in the Gramps Plugin Registration. It is waiting on Nick’s direction on how to handle that.

My suggestion is that the update should simply be merged into the three supported version repos, with the .json catalogs listing the appropriate version. Ideally, only one .tgz and one source folder would be mirrored to minimize the synchronization work … though I have seen no indication that this is possible, nor that a .json file can point to a .tgz anywhere other than the standard relative path.

On the other hand, say you are required to hard-code the target version: you might decide that you only have time to spare for the current (or beta) version of Gramps — even though the module night be compatible with other Gramps versions, and some users are stuck on those versions due to circumstances beyond their control.

No it is not. That is a draft.

A draft where the only comment or objection in a month’s time is this item.

Ok, then I’ll update that. But don’t blame the process.

The process that has a barrier to me migrating addons from my experimental repo to the addons-source.

It is a barrier that inhibits contributions.

Languishing in the queue? This is a draft, and as long as it is a draft, it is not in the queue, from my perspective. About half of the open PRs are either Draft or WIP, and not ‘in the queue’ for merging.

I disagree. If you feel strongly that an addon should functionally be added, just put the hard-coded gramps version. Any PR that is on the gramps60 branch is cherry picked to gramps61 (until gramps61 is released). I modify the GPR version if I cherry pick a new addon.

I think you are mixing two alternatives -

  1. a range for the gramps version in the GPR;
  2. added code in the GPR to detect gramps version based on GRAMPSPATH version.

Cards on the table - I don’t like added code in the GPR.

I am not mixing them.

One is only possible in the future and should be a goal.

The other is a workaround that can be used until that goal is achieved, then be retired.


I accept that code in registration is not desireable but may be a necessary expedient.

There are other possibilities.

The make.py script could be made smarter to convert adaptive (or version array) registrations to hard-coded variants in the .tgz placed in the downloads and .json placed in the listing. That requires programmer and beta testing. Changing the policy requires less effort.

(Claude’s experimental Addon Pack and Ship utilities tool already checks for version compatibilty, generates .tgz and .json files leveraging the various make.py versions and pushes updates to a shared Github Desktop local repo. The update is committed by that tool.
The first workflows were awkward and error-prone. That’s better but still far from perfect. )

I agree. The gpr should not contain code. We may move to a json registration file in the future.

Yes. Version ranges would be an acceptable solution.


|
|

  • | - |

Submitting to the gramps-project/addons-source repo are (unofficially but effectively) prohibitted from using code in the regisration.

Usually, this code is to allow plug-ins that are cross-compatible with multiple versions of Gramps to be maintained more easily. And be submitted for distribution in a single step.

This makes updating Addons harder for developers… for no benefit.

Can we discuss how this requirement could be relaxed?

(There have been discussions about making the target-version into an array in a .gpr.json rather than a .gpr.py module. If there is a reason to do that for the future, should we not consider permitting a functional workaround for the present?)

I usually workaround it by using the following since gramps 5.[12] up to 6.1 beta2 :

from gramps.version import major_version
register(EXPORT,
gramps_target_version = major_version,
…

Does this work? Yes.

Do I (strongly) discourage this? Yes. The below is much simpler and avoids code in the GPR.

gramps_target_version = "6.0"

Quelqu’un a répondu à votre publication.


|

  • | - |

I usually workaround it by using the following since gramps 5.[12] up to 6.1 beta2 :

from gramps.version import major_version
register(EXPORT,
gramps_target_version = major_version,
…

Does this work? Yes.

Do I (strongly) discourage this? Yes. The below is much simpler and avoids code in the GPR.

gramps_target_version = "6.0"

That means updating the plugin for every new Gramps version, abandoning previous Gramps version.

That’s not usable for plugins having their own repos (such as GeneanetForGramps or GedcomforGeneanet).

That’s currently the right solution for any other addon NOT managed in addons-source repository.

It would require an additional level of folders (gramps61, gramps60, gramps52) in your repo. That is the current structure for the addons-source repo. You do not have to abandon previous gramps versions.

Quelqu’un a répondu à votre publication.


|
|

  • | - |

That means updating the plugin for every new Gramps version, abandoning previous Gramps version.

It would require an additional level of folders (gramps61, gramps60, gramps52) in your repo. That is the current structure for the addons-source repo. You do not have to abandon previous gramps versions.

That’s more work for third party addons whereas the above fixes it :slight_smile: