Newbie questions about publishing new gramplet

Okay, so I’ve written a new gramplet, and I’m working through the instructions on Addons development - Gramps.

First, I’d like some confirmation to know if what I’ve done so far is okay. I’ve managed to upload my new Cosanguinuity gramplet to GitHub - gramps-project/addons-source at gramps51. So far so good?

Second, I think I might be missing something in the section “List your addon in the Gramps Plugin Manager”. Do I need to do a “git push”? What do I need to do to move forward?

I am an experienced programmer, but have zero experience with Git, and I’m still a newbie on the Gramps development process.

Cheers! Hane

To list your addon in the Plugin Manager you have to update the listings and the files in gramps/addons. See steps about usage in the README file of gramps/addons-source.

For addon development a pull request to addon-source is usually all you have to do, since the other steps are also maintained by experienced developers like @prculley.

1 Like

I should have replied sooner. I see you got addon-source rights from Nick. And so you have uploaded your code there. I would have said that the more normal approach to doing a new addon was to do a PR from your own Github account to the addon-source. We (developers) can then test your addon or change, provide comments against the PR, and accept when it seems ready. Part of the accept process would be for one of us to use the build scripts to create the listings and release gzip files. And then we would push the resulting items to the addons repo.
Normally most new contributors don’t get rights to the addons repo.
When I get a chance I will try to see if your work looks ok and build/release for you. It would be best if in the future if you use the PR process.

If you want some of our more advanced users to test your addon, you might advertise it here on Discourse, along with where to download the files. Several of our users have learned how to manually install addons this way and are likely to make comments.

Thanks for your advice, Paul!

First, to be clear, what do you mean my a “PR”? ("I’m a total newbie regarding git.) If I understand correctly, you’re suggesting I first push to my own GitHub account and point potential reviewers to that first, then push to the addon-source repo, right?

Second, a few people have tried out my gramplet, and provided useful suggestions. I even have someone lined up to do the French translation. I just figured it was time to push through the process documented at Addons development - Gramps. However, from that page, it seems like the process after the section “List your addon in the Gramps Plugin Manager” was not at all clear.

Anyways, as my understanding of the process improves, I now see why I don’t have rights to the addons repo.

I would certainly appreciate more eyes looking at my code, as well as advice on next steps. This is my first gramplet, and I don’t want it to be my last. I’m already planning out my next gramplet.

Cheers! Hans

I understand your frustration on our process. Many of the instruction wiki pages were written more as a reminder to developers or contributors in the past before the PR process was our preferred way of doing things. And we don’t always have the incentive to update the wiki pages well enough.

Look at Brief introduction to Git - Gramps

The specific subsection describes making a PR (Pull Request). The wiki page as a whole can be useful in helping to understand git etc. But it was written primarily for people making submissions to Gramps core code. So you have to make a few modifications to the commands for addons. Instead of targeting the https://github.com/gramps-project/gramps.git in the stage where you get and clone the repo, you would use https://github.com/gramps-project/addon-source.git.

And later on where it talks about ‘master’ branch you should use ‘maintenance/gramps51’ as that is the current branch for active addons.

If you need more help, continue to post here. And if you figure it out but think the instructions need more work (they probably do) then take a few notes along the way. With this help, perhaps we can improve (or give you rights to do so yourself) the wiki.

Okay, I think I’m starting to get it.

So far, I’ve added Cosanguinuity to the gramps51 branch. So moving forward, it looks like I need to do the following:

First, I’ll add the code to my own hgboldt repository, and put out one more call for reviewers. (I think I’m satisfied with the code, at least for now. But I want to make sure I get this process right.)

Then, once everything is good, I’ll add Cosanguinuity to the maintenance/gramps51 branch, and then call on you to create the listings and gz file.

Does that sound like a plan?

Cheers! Hans

I copied the files and added the app to my addons.

I am not sure of my need to use the app but I will tell you that I have a large and interconnected family. Your app sorted out the relations between my maternal grandmother and maternal grandfather’s trees very fast and created the displays equally as fast.

:+1: :smile: :+1: :smile::+1: :smile::+1:

2 Likes

So I looked at and downloaded your code for a quick test. I note that you uploaded to the addon-source repo at the ‘gramps51’ branch. This is different than the ‘maintenance/gramps51’ branch which is what gets released to users. Which allows us to continue making a PR using that branch if you prefer rather than uploading to your own Github account and creating the PR.

I suggest that you go to Github, addons-source repo web page.
Select the ‘gramps51’ branch in the branch selection box near the top on the left.
Select the ‘Contribute’ button on the next bar down and open a Pull Request.
On the PR page, change the ‘base’ to ‘maintanence/gramps51’.
The red "Cannot automatically merge’ should change to ‘Able to merge’ and the sections below should show your code commits and files.
If you are satisfied with what you see, hit the green ‘Create Pull Request’ button.

At that point developers like me can review your PR and make comments against it which will appear in your email; assuming you have given Github your correct email address. And new commits pushed to the branch will automatically appear on the PR page for further review.

That said, I got a few warnings when I tried out your code:

C:\Users\prc\AppData\Roaming\gramps\gramps51\plugins\Cosanguinuity\cosanguinuity.py:337: PyGTKDeprecationWarning: Using positional arguments with the GObject constructor has been deprecated. Please specify keyword(s) for "label" or use a class specific constructor. See: https://wiki.gnome.org/PyGObject/InitializerDeprecations
  copy_button = Gtk.Button(MSG_COPY_TO_CLIPBOARD)
C:\Users\prc\AppData\Roaming\gramps\gramps51\plugins\Cosanguinuity\cosanguinuity.py:341: PyGTKDeprecationWarning: Using positional arguments with the GObject constructor has been deprecated. Please specify keyword(s) for "label" or use a class specific constructor. See: https://wiki.gnome.org/PyGObject/InitializerDeprecations
  pedigree_button = Gtk.Button(MSG_SHOW_PEDIGREES)
C:\Users\prc\AppData\Roaming\gramps\gramps51\plugins\Cosanguinuity\cosanguinuity.py:337: PyGTKDeprecationWarning: Using positional arguments with the GObject constructor has been deprecated. Please specify keyword(s) for "label" or use a class specific constructor. See: https://wiki.gnome.org/PyGObject/InitializerDeprecations
  copy_button = Gtk.Button(MSG_COPY_TO_CLIPBOARD)
C:\Users\prc\AppData\Roaming\gramps\gramps51\plugins\Cosanguinuity\cosanguinuity.py:1247: PyGTKDeprecationWarning: Using positional arguments with the GObject constructor has been deprecated. Please specify keyword(s) for "label" or use a class specific constructor. See: https://wiki.gnome.org/PyGObject/InitializerDeprecations
  copy_button = Gtk.Button(MSG_COPY_TO_CLIPBOARD)
C:\Users\prc\AppData\Roaming\gramps\gramps51\plugins\Cosanguinuity\cosanguinuity.py:1251: PyGTKDeprecationWarning: Using positional arguments with the GObject constructor has been deprecated. Please specify keyword(s) for "label" or use a class specific constructor. See: https://wiki.gnome.org/PyGObject/InitializerDeprecations
  close_button = Gtk.Button(MSG_CLOSE)

I also got an error when I tried to click on a highlighted person. In example.gramps tree, I0044 person active, single pane mode, I clicked on Martell, Luella…

(python3.exe:11308): Gtk-WARNING **: Unable to show 'P FOUJQC7PMC15VC4P0I': Error when getting information for file �C:\Users\prc\workspace\GrampsM\main\P FOUJQC7PMC15VC4P0I�: No such file or directory

I did not try to debug this.

Do you know if there is a place in the example.gramps tree that can showcase your Gramplet? My own tree doesn’t have any obvious situations to examine.

That said, I did not spot any obvious other quick error situations; so good work!

In my IDE (Eclipse/Pydev) there is an automatic PEP8/Pylint function when you look at the code. Your code has a large number of whitespace errors and some line length errors. It would be a good idea if at some point you would clean these up. We try to maintain a Pylint score of 90% or better for new code submissions to Gramps core, and while addons are not so restrictive, it is good to try for that score there as well.

Enough for now…

I have not found a good demonstration of multiple pedigree collapse in the example.gramps file.

However, the Royal92.ged (a PAF2.2 generated GEDCOM published in 1992 by Denis Robert Reid {1937-1998} documenting a European Royal family) is a classic example. I will continue to look around for a well vetted archive that would link nicely in the documentation. But here is a copy available through GitHub:

https://github.com/arbre-app/public-gedcoms/blob/master/files/royal92.ged

-Brian

Thanks for the comments, Paul!

  1. I followed your instructions for git. So far so good.

  2. The deprecation warnings for Gtk.Button is a simple change to the code.

  3. Regarding “Gtk-WARNING **: Unable to show ‘P FOUJQC7PMC15VC4P0I’:”, I think I know what I did wrong. For some reason, though, I’m not seeing that warning on my computer.

    Are you getting the expected action when clicking on the link? That is, when you click on a name, is that person becoming the active person? And when you click on a relationship, are you opening up a new window?

  4. Regarding pylint, I’m currently seeing scores of 9.71 and 9.77 on my code. I’m not seeing any whitespace warnings. What’s the gramps coding standard for line length?

Anyways, there was another issue on my todo list, so it may take a few days before I upload my next revision.

Cheers! Hans

I’m starting to get the hang of git, and I’ve now created a couple of repositories on my own github account, including my cosanguinuity gramplet at GitHub - hgboldt/cosanguinuity: Gramplet to show pedigree collapse and spousal cosanguinuity for active person.. (The last version control system I used was subversion, and I never really properly understood it.)

Going forward, I’d like to understand the process of moving my code from my github account to the addons-source. I’m reading through Brief introduction to Git - Gramps, but I still find that document confusing.

Cheers! Hans