LeoInteg using Leo's Null GUI ?

98 views
Skip to first unread message

Viktor Ransmayr

unread,
Jan 22, 2024, 1:37:02 PM1/22/24
to leo-editor
Hello Edward, hello Felix,

Currently whenever I'd like to install LeoInteg on any non-Windows host I have to install Leo with PyQt. - This is sometimes quite difficult / tricky ...

AFAIK LeoInteg  is relying solely on the GUI provided through VS Code.

What effort would it be to package a version of Leo providing ~everything~ but the GUI ?

With kind regards,

Viktor

Edward K. Ream

unread,
Jan 22, 2024, 3:49:42 PM1/22/24
to leo-e...@googlegroups.com
> What effort would it be to package a version of Leo providing ~everything~ but the GUI?


Thanks for this timely question.


tl;dr: Making things work as I am guessing you would like should be straightforward.


Background


leoserver.py creates the link between LeoInteg and Leo using Leo's bridge in leoBridge.leo.


The bridge uses a null gui, so LeoInteg should "just work" without Qt.


However, running leo --gui=null crashes. The details probably do not affect the answer to your question.


Thinking out loud


Félix, please correct me if I am wrong with the following guesses:


LeoInteg almost certainly starts Leo's server with a null gui.


If I understand your question, the problem is simply installing Leo without Qt.


My guess is LeoInteg should work if you install Leo using Git.

However, pip install requirements.txt may fail if Qt is not available.


setup.py specifies requirements in the section called << define install_requires >>.

This section lists the following dependencies:


install_requires = [

  'PyQt5 >= 5.15',

  'PyQtWebEngine',

  'build >= 0.6.0', # simple PEP 517 package builder

  'docutils', # used by Sphinx, rST plugin

  'flexx', # for LeoWapp browser gui

  'meta', # for livecode.py plugin, enabled by default

  'nbformat', # for Jupyter notebook integration

  'pylint', 'pyflakes',

  'pyenchant', # The spell tab.

  'pyshortcuts >= 1.7', # desktop integration (#1243)

  'sphinx', # rST plugin

  'tk', # tkinter.


  # For leoAst.py and leoTokens.py.

  'asttokens', # abstract syntax tree text parsing

  'black', # coding syntax standards


  'windows-curses; platform_system=="Windows"', # for console mode on Windows

]


Viktor, as an experiment, you could try the following:


- git clone leo, that is: git clone https://github.com/leo-editor/leo-editor.git

- Create your own version of requirements.txt that omits anything related to guis.

- Install the dependencies: pip install -r requirements.txt.


Summary


Leo issue #3767 suggests using only requirements.txt.


requirements.txt should distinguish required from optional dependencies in requirements.txt.


A timely question indeed.


Edward

Thomas Passin

unread,
Jan 22, 2024, 4:10:54 PM1/22/24
to leo-editor
On Monday, January 22, 2024 at 3:49:42 PM UTC-5 Edward K. Ream wrote:

setup.py specifies requirements in the section called << define install_requires >>.

This section lists the following dependencies:


install_requires = [

         # Other entries omitted 

  'nbformat', # for Jupyter notebook integration

]

 
Didn't we decide not to support Jupyter notebooks any more? If so, nbformat can probably be omitted in the future.

Edward K. Ream

unread,
Jan 22, 2024, 5:09:27 PM1/22/24
to leo-e...@googlegroups.com
On Mon, Jan 22, 2024 at 3:10 PM Thomas Passin <tbp1...@gmail.com> wrote:
 
Didn't we decide not to support Jupyter notebooks any more? If so, nbformat can probably be omitted in the future.

Good catch. Hehe, VR3 still has some references to nbformat!

Edward

Thomas Passin

unread,
Jan 22, 2024, 5:22:53 PM1/22/24
to leo-editor
I've realized that for some time and I didn't want to put such a minor PR in while all those heavy-duty ones were in the mix.   After my current ones get merged, I'll fix up the nbformat import for VR3.

Robert-Felix

unread,
Jan 23, 2024, 11:36:03 PM1/23/24
to leo-e...@googlegroups.com
Hi Viktor, thanks for bringing this up! I've thought about this in the past and completely forgot about it!! 

I would also like very much users to be able to just need the leo sources, without installing any qt libs nor any other UI/graphical libs, to be able to run leoInteg or use the bridge / server in general for any other uses, if possible.

About leoserver.py: If I remember correctly, the server should not require the ui libraries. but merely use them optionally if available if the user tries to exit with dirty documents. (the ui pops up a window to ask for save/exit) This should silently fail if no ui library is available and not give any errors nor hard requirement. 

(Credits to Edward for thinking about and coding that popup dialog of this into the server back in 2020) 

Might be worth taking a look at it

Félix



--
You received this message because you are subscribed to the Google Groups "leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email to leo-editor+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/leo-editor/c200ee02-b307-47e4-90af-5ac7137f2afdn%40googlegroups.com.

Viktor Ransmayr

unread,
Jan 24, 2024, 1:06:22 AM1/24/24
to leo-e...@googlegroups.com
Hello Edward,

Am Mo., 22. Jan. 2024 um 21:49 Uhr schrieb Edward K. Ream <edre...@gmail.com>:
> What effort would it be to package a version of Leo providing ~everything~ but the GUI?


Thanks for this timely question.


tl;dr: Making things work as I am guessing you would like should be straightforward.


...

Viktor, as an experiment, you could try the following:


- git clone leo, that is: git clone https://github.com/leo-editor/leo-editor.git

- Create your own version of requirements.txt that omits anything related to guis.

- Install the dependencies: pip install -r requirements.txt.


I'll spend some time on the weekend & will report back my results.

Thanks a lot for your detailled feedback !

With kind regards,

Viktor

Edward K. Ream

unread,
Jan 24, 2024, 2:24:07 AM1/24/24
to leo-e...@googlegroups.com
On Tue, Jan 23, 2024 at 10:36 PM Robert-Felix wrote:

Hi Viktor, thanks for bringing this up! I've thought about this in the past and completely forgot about it!!

I would also like very much users to be able to just need the leo sources, without installing any qt libs nor any other UI/graphical libs, to be able to run leoInteg or use the bridge / server in general for any other uses, if possible.
...
Might be worth taking a look at it.

#3767 now suggests making installing Qt optional. I'll get to this issue in a few days.

Edward

Edward K. Ream

unread,
Jan 24, 2024, 2:26:44 AM1/24/24
to leo-e...@googlegroups.com
On Wed, Jan 24, 2024 at 12:06 AM Viktor Ransmayr wrote:


Viktor, as an experiment, you could try the following:


- git clone leo, that is: git clone https://github.com/leo-editor/leo-editor.git

- Create your own version of requirements.txt that omits anything related to guis.

- Install the dependencies: pip install -r requirements.txt.


I'll spend some time on the weekend & will report back my results.

Excellent.

Thanks a lot for your detailed feedback !

You're welcome. Thanks again for your timely question.

Edward
Message has been deleted

Viktor Ransmayr

unread,
Jan 28, 2024, 12:05:47 PM1/28/24
to leo-editor
Hello Edward,

Edward K. Ream schrieb am Mittwoch, 24. Januar 2024 um 08:26:44 UTC+1:
On Wed, Jan 24, 2024 at 12:06 AM Viktor Ransmayr wrote:

Viktor, as an experiment, you could try the following:


- git clone leo, that is: git clone https://github.com/leo-editor/leo-editor.git

- Create your own version of requirements.txt that omits anything related to guis.

- Install the dependencies: pip install -r requirements.txt.


I'll spend some time on the weekend & will report back my results.

 So far I tried out several variations of your proposal - but - did not have any success:

* Variation #1: use requirements.txt w/o an '--editable .' entry
* Variation #2: use requirements.txt with '--editable .' as last entry
* Variation #3: use requirements.txt with 'leo == 6.7.7' as last entry

Either the 'leo' package was not included in the install at all - or - the 'leo' package was added with its 'PyQt' dependencies ...

It is time for me to start reading the 'pip' documentation in detail !

With kind regards,

Viktor

Edward K. Ream

unread,
Jan 28, 2024, 12:43:20 PM1/28/24
to leo-e...@googlegroups.com
On Sun, Jan 28, 2024 at 11:05 AM Viktor Ransmayr <viktor....@gmail.com> wrote:

> It is time for me to start reading the 'pip' documentation in detail !

Thanks for your efforts!  #3767 has some links you might find interesting.

Edward
Reply all
Reply to author
Forward
0 new messages