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

Please document how to install this using pip and run without installation #140

Open
probonopd opened this issue Aug 13, 2024 · 2 comments

Comments

@probonopd
Copy link

probonopd commented Aug 13, 2024

Please document how to install this using pip and run without Flatpak, without Gnome Builder, and without installation. Something along those lines:

sudo apt-get -y install libdbus-1-dev # Why is this even needed
sudo apt-get -y install gettext

sudo python3 -m venv venv
. ./venv/bin/activate
pip3 install -r requirements.txt
pip3 install meson ninja # Why are these even needed for a Python application
pip3 install pygobject # This was forgotten in requirements.txt
meson build

./build/src/gearlever

python3 src/main.py
Traceback (most recent call last):
  File "/tmp/gearlever/src/main.py", line 23, in <module>
    from .lib.utils import get_gsettings, make_option
ImportError: attempted relative import with no known parent package

# Apparently one needs to remove all the "." in "from .something import".

# But then we get 

$ python3 src/main.py
Traceback (most recent call last):
  File "/tmp/gearlever/src/main.py", line 23, in <module>
    from lib.utils import get_gsettings, make_option
  File "/tmp/gearlever/src/lib/utils.py", line 11, in <module>
    from .costants import APP_ID
  File "/tmp/gearlever/src/lib/costants.py", line 8, in <module>
    ONE_UPDATE_AVAILABLE_LABEL = _('1 update available')
                                 ^
NameError: name '_' is not defined
@probonopd
Copy link
Author

Need to add

from gettext import gettext as _

at the top of src/lib/costants.py.

After removing lots of . and .. from the import statements, getting

$ python3 src/main.py
Traceback (most recent call last):
  File "/tmp/gearlever/src/main.py", line 26, in <module>
    from GearleverWindow import GearleverWindow
  File "/tmp/gearlever/src/GearleverWindow.py", line 21, in <module>
    from InstalledAppsList import InstalledAppsList
  File "/tmp/gearlever/src/InstalledAppsList.py", line 16, in <module>
    from preferences import Preferences
  File "/tmp/gearlever/src/preferences.py", line 17, in <module>
    class Preferences(Adw.PreferencesWindow):
  File "/tmp/gearlever/src/preferences.py", line 147, in Preferences
    def create_boolean_settings_entry(self, label: str, key: str, subtitle: str = None) -> Adw.SwitchRow:
                                                                                           ^^^^^^^^^^^^^
  File "/tmp/gearlever/venv/lib/python3.11/site-packages/gi/module.py", line 130, in __getattr__
    raise AttributeError("%r object has no attribute %r" % (
AttributeError: 'gi.repository.Adw' object has no attribute 'SwitchRow'

@probonopd
Copy link
Author

probonopd commented Aug 13, 2024

Probably this is assuming a newer version of libadwaita to be on the system than what is actually present on Debian GNU/Linux 12 (bookworm).

This project seems to use almost every technology and practice I'd recommend against using. Especially libadwaita, a library that ensures that applications won't work properly anywhere but in Gnome.

It would probably best be rewritten in PyQt in no time.

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

No branches or pull requests

1 participant