Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Plugins not working with an up-to-date development build? #181

Open
stephen-lockett opened this issue Feb 13, 2025 · 14 comments
Open

Plugins not working with an up-to-date development build? #181

stephen-lockett opened this issue Feb 13, 2025 · 14 comments
Labels
question Further information is requested

Comments

@stephen-lockett
Copy link

stephen-lockett commented Feb 13, 2025

First off, thank you to the new maintainer for stepping up and continuing the development of Gourmand!
I understand that there are many issues to address, but I wanted to open this issue to make sure it doesn't get lost.

Currently, when building Gourmand from source, plugins are not being recognized.

Steps to reproduce:

  1. Build Gourmand from source:
    python setup.py bdist_wheel
    pip install "gourmand-1.0.0-py3-none-any.whl[epub-export,pdf-export,spellcheck]" "setuptools" ... (other dependencies from installation guide)
  2. Run Gourmand.

Expected behavior:

Plugins should be available and functional.

I also think it would make sense to list all the necessary dependencies in setup.py so that they are automatically installed when the Gourmand wheel is installed, although some of the dependencies listed in the installation guide are already automatically installed, while others do not seem to be necessary anymore.

Actual behavior:

Executing Gourmand does not show any plugins. Logs indicate missing plugins:

Plugin  spellcheck not found  
Plugin  gxml_plugin not found  
Plugin  html_plugin not found  
Plugin  mastercook_import_plugin not found  
Plugin  mealmaster_plugin not found  
Plugin  archive_plugin not found  
Plugin  pdf_plugin not found  
Plugin  plaintext_plugin not found  
Plugin  web_import_plugin not found  
Plugin  website_import_plugins not found  
Plugin  krecipe_plugin not found  
Plugin  mycookbook_plugin not found  
Plugin  epub_plugin not found  

Am I missing something in my setup, or are the plugins currently broken?

Since there's ongoing work on fixing build issues and merging relevant PRs, I wanted to highlight this in case it's part of the changes being addressed. Thanks again for taking over maintenance!

@FriedrichFroebel
Copy link
Contributor

What does python setup.py build_i18n yield for you? In theory, this should run when building the wheel - at least it does when running python -m build . as far as I can see.

I also think it would make sense to list all the necessary dependencies in setup.py so that they are automatically installed when the Gourmand wheel is installed, although some of the dependencies listed in the installation guide are already automatically installed, while others do not seem to be necessary anymore.

Could you please elaborate. extras are intended for extra functionality, thus the current approach should match Python packaging guidelines. Or am I missing something?

@stephen-lockett
Copy link
Author

i18n

The mentioned command python setup.py bdist_wheel does indeed execute build_i18n, since this is logged in the command output. The interesting thing is that running python setup.py build_i18n directly fails in my case:

running build_i18n
sh: line 1: intltool-merge: command not found
... (repeats several times)
sh: line 1: intltool-merge: command not found

extras

I think there is a misunderstanding here. Using extras_require is fine, of course. I meant the other required dependencies according to the installation guide:

Image

@FriedrichFroebel
Copy link
Contributor

If intltool-merge is missing, you apparently need to install the corresponding OS package.

To be honest, I never read the installation guide and have not been aware of it. Feel free to send a PR to update the relevant sections.

@stephen-lockett
Copy link
Author

stephen-lockett commented Feb 13, 2025

Awesome, most of the plugins work now! Thank you very much. So it was obviously a mistake on my side.
I did not have the idea to test what happens when just running python setup.py build_i18n.

Unfortunately, some plugins are still not found and some errors are shown:

(gourmand:3221058): libenchant-WARNING **: 17:30:02.939: broker.vala:159: Error loading plugin: libvoikko.so.1: cannot open shared objectfile: No such file or directory

(gourmand:3221058): libenchant-WARNING **: 17:30:02.939: broker.vala:159: Error loading plugin: libhspell.so.0: cannot open shared objectfile: No such file or directory

(gourmand:3221058): libenchant-WARNING **: 17:30:02.939: broker.vala:159: Error loading plugin: libaspell.so.15: cannot open shared object file: No such file or directory

(gourmand:3221058): libenchant-WARNING **: 17:30:02.939: broker.vala:159: Error loading plugin: libnuspell.so.5: cannot open shared object file: No such file or directory
Plugin  html_plugin not found
Plugin  archive_plugin not found
Plugin  web_import_plugin not found
Plugin  website_import_plugins not found

Maybe those plugins have already been removed from the Gourmand sources, since even the AppImage build shows these plugins as missing?

I think the packages pyvoikko, hunspell, pyspelling and pynuspell are a perfect example of what should be added to extras_require in setup.py.
But even after installing the first three, the errors remain the same, maybe because I cannot install pynuspell.
The pynuspell package seems to be deprecated and only works up to Python 3.9.
It is not possible to install it on a system with a current Python version (3.13.1 on my system):

ERROR: Could not find a version that satisfies the requirement pynuspell (from versions: none)

@FriedrichFroebel
Copy link
Contributor

These warnings are coming from libenchant, thus it rather sounds like you should install the corresponding OS packages as well to eliminate them AFAIK.

If I remember correctly, I only had two plugins being reported as missing, but they might indeed have been disabled etc. in the meantime and just do not work with the current version of Gourmand.

@stephen-lockett
Copy link
Author

stephen-lockett commented Feb 13, 2025

I already have enchant installed on my system.
I am currently using the latest AppImage (1.1.0rc2) on my system.
The development build is for the corresponding AUR package gourmand-git for which I am the maintainer.

@FriedrichFroebel
Copy link
Contributor

Enchant is just a wrapper for the actual spell checking libraries. It needs something like hunspell or aspell (and the desired dictionaries for them) for actually being able to work correctly.

@stephen-lockett
Copy link
Author

stephen-lockett commented Feb 13, 2025

Ah okay, thank you!

@FriedrichFroebel FriedrichFroebel added the question Further information is requested label Feb 13, 2025
@stephen-lockett
Copy link
Author

Based on the discussion, I see a few action points that need to be addressed:

  1. Update the installation guide to include missing system dependencies (both required and optional). Currently, some dependencies like intltool are not mentioned at all. Also, no additional Python packages should need to be installed manually.
  2. Add a section on setting up a development build in the installation guide.
  3. Update install_requires and extras_require in setup.py to include missing Python dependencies, so that no manual installation is required. These fields exist for exactly this purpose, and the current manual installation process is proving too error-prone.
  4. Review warnings about missing plugins: Check if any warnings are still relevant and remove them if the corresponding plugins no longer exist.

I do not feel confident updating the installation guide myself, as I am not sure I have a complete understanding of all dependencies - there might be more missing.

Would it make sense to create separate issues for each of these points and close this one? (I can do this.) Or should we keep this issue open for now, since all the todos are already listed here?

@stephen-lockett stephen-lockett changed the title Plugins not working with an up-to-date development build Plugins not working with an up-to-date development build? Feb 14, 2025
@FriedrichFroebel
Copy link
Contributor

Sorry, but I still have issue to understand what you are referring to:

  1. intltool is only required for source-based installations, but not for already built wheels, thus this would have to be part of the development guide. We should still differentiate between required and optional dependencies and not request the user to just install everything.
  2. What exactly do you expect from a development installation guide?
  3. Most of the dependencies should already be declared correctly and it might just be a matter of updating the docs. Which Python dependencies are you missing in the package manifest?
  4. If I remember correctly, this would raise for existing users as well if this has been part of an old configuration file. You are of course invited to review this and open a corresponding PR to fix these aspects.

In general, installation is rather tricky and - even for Ubuntu - has been proven to be a matter of taste and how much work to put into it. Some of the entries in the package list should be obsolete or installing them like this will not work at all anyway due to enforcing virtual environments (at least since Ubuntu 24.04). Even here, there are multiple options, which depends on the user - I am currently using a virtual environment with system-site packages enabled, others might decide to do differently.

@stephen-lockett
Copy link
Author

No problem 😃

  1. You are right, the example (intltool) should be part of the yet to-be-defined development installation guide.
  2. It makes it easier to participate in the development (e.g. via pull requests) without having to spend hours figuring things out and losing the desire to participate because of poor or missing documentation.
  3. I think the packages pyvoikko, hunspell, pyspelling and pynuspell are a perfect example of what should be added to extras_require in setup.py.

  4. It does. For example, some plugins are not even found when starting Gourmand from the AppImage release.
  5. Installation shouldn't be difficult. IMHO it is a documentation issue. But okay.

Anyway, thanks for the discussion. 👍🏻

@FriedrichFroebel
Copy link
Contributor

pyvoikko, hunspell, pyspelling and pynuspell

AFAIK these warnings are not about missing Python dependencies, as mentioned before. The correct way to get libvoikko, libhspell, libaspell or libnuspell is through the OS package manager (including the corresponding dictionaries), as this are the different backends available to (py)enchant. Their Python bindings are an alternative to pyenchant, but AFAIK not supported by Gourmand.

@stephen-lockett
Copy link
Author

But I guess I also need the corresponding Python packages to "speak" to those system packages?

@FriedrichFroebel
Copy link
Contributor

No, enchant (which pyenchant is the wrapper for) automatically attempts to load the shared objects available on the system them as long as it is built with the corresponding backend enabled.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants