The improved restart-leo command

32 views
Skip to first unread message

Edward K. Ream

unread,
May 21, 2024, 8:07:12 AMMay 21
to leo-editor

PR #3922 significantly improves Leo's restart-leo command. The command now uses the command-line arguments in effect when Leo started.

These changes are an earthquake in my workflow. Rather than closing and reopening my test file, I just use the restart-leo command. This change saves so much time! How did I ever live without it?

Issue #3925 suggests eliminating reload-settings and reload-stylesheets commands. The improved restart-leo command makes them unnecessary. In essence, the reload commands are hacks. Imo, the reload commands should be aliases for restart-leo.

What do you think?

Edward

Viktor Ransmayr

unread,
May 22, 2024, 7:04:04 AMMay 22
to leo-editor
Hello Edward,

Edward K. Ream schrieb am Dienstag, 21. Mai 2024 um 14:07:12 UTC+2:

PR #3922 significantly improves Leo's restart-leo command. The command now uses the command-line arguments in effect when Leo started.

I have tested the latest version of Leo's devel branch in a dedicated Debian & Fedora VM.

The command is working fine in both !

However & FYI: When I run Leo's unit tests in both VMs I receive 43 identical / similar errors:

  • See "Log-001" for UT @ Debian & "Log-002" for UT @ Fedora

With kind regards,

Viktor

### Log-001

    (Leo) user@debian-leo-study-vm:~/PyVE/GitHub/Leo/leo-editor$
    (Leo) user@debian-leo-study-vm:~/PyVE/GitHub/Leo/leo-editor$ cd leo
    (Leo) user@debian-leo-study-vm:~/PyVE/GitHub/Leo/leo-editor/leo$
    (Leo) user@debian-leo-study-vm:~/PyVE/GitHub/Leo/leo-editor/leo$ python3 -m unittest
    EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE
    ======================================================================
    ERROR: external.npyscreen (unittest.loader._FailedTest.external.npyscreen)
    ----------------------------------------------------------------------
    ImportError: Failed to import test module: external.npyscreen
    Traceback (most recent call last):
      File "/usr/lib/python3.11/unittest/loader.py", line 440, in _find_test_path
        package = self._get_module_from_name(name)
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/usr/lib/python3.11/unittest/loader.py", line 350, in _get_module_from_name
        __import__(name)
      File "/home/user/PyVE/GitHub/Leo/leo-editor/leo/external/npyscreen/__init__.py", line 8, in <module>
        from .wgwidget                  import TEST_SETTINGS, ExhaustedTestInput, add_test_input_from_iterable, add_test_input_ch
      File "/home/user/PyVE/GitHub/Leo/leo-editor/leo/external/npyscreen/wgwidget.py", line 21, in <module>
        from leo.core import leoGlobals as g
    ModuleNotFoundError: No module named 'leo'

    < content deleted >

    ----------------------------------------------------------------------
    Ran 43 tests in 0.003s

    FAILED (errors=43)
    (Leo) user@debian-leo-study-vm:~/PyVE/GitHub/Leo/leo-editor/leo$

### Log-002

    (Leo) [user@fedora-leo-study-vm leo-editor]$
    (Leo) [user@fedora-leo-study-vm leo-editor]$ cd leo
    (Leo) [user@fedora-leo-study-vm leo]$
    (Leo) [user@fedora-leo-study-vm leo]$ python -m unittest
    EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE
    ======================================================================
    ERROR: external.npyscreen (unittest.loader._FailedTest.external.npyscreen)
    ----------------------------------------------------------------------
    ImportError: Failed to import test module: external.npyscreen
    Traceback (most recent call last):
      File "/usr/lib64/python3.12/unittest/loader.py", line 427, in _find_test_path
        package = self._get_module_from_name(name)
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/usr/lib64/python3.12/unittest/loader.py", line 337, in _get_module_from_name
        __import__(name)
      File "/home/user/PyVE/GitHub/Leo/leo-editor/leo/external/npyscreen/__init__.py", line 8, in <module>
        from .wgwidget                  import TEST_SETTINGS, ExhaustedTestInput, add_test_input_from_iterable, add_test_input_ch
      File "/home/user/PyVE/GitHub/Leo/leo-editor/leo/external/npyscreen/wgwidget.py", line 21, in <module>
        from leo.core import leoGlobals as g
    ModuleNotFoundError: No module named 'leo'

    < content deleted >

    ----------------------------------------------------------------------
    Ran 43 tests in 0.002s

    FAILED (errors=43)
    (Leo) [user@fedora-leo-study-vm leo]$

 

Edward K. Ream

unread,
May 22, 2024, 1:52:35 PMMay 22
to leo-e...@googlegroups.com

PR #3922 significantly improves Leo's restart-leo command. The command now uses the command-line arguments in effect when Leo started.

I have tested the latest version of Leo's devel branch in a dedicated Debian & Fedora VM.

The command is working fine in both !

Thanks for your testing.

However & FYI: When I run Leo's unit tests in both VMs I receive 43 identical / similar errors:
[snip]
      File "/home/user/PyVE/GitHub/Leo/leo-editor/leo/external/npyscreen/wgwidget.py", line 21, in <module>
        from leo.core import leoGlobals as g
    ModuleNotFoundError: No module named 'leo'

This looks like an installation problem.

Edward

Thomas Passin

unread,
May 22, 2024, 2:01:59 PMMay 22
to leo-editor
What directory are you running the tests from? Unless you set the right one using PYTHONPATH, you have to be in the leo-editor   directory to be able to find leo.core.xxx, etc.

Viktor Ransmayr

unread,
May 23, 2024, 4:20:25 AMMay 23
to leo-e...@googlegroups.com
Hello Thomas,

Thanks a lot for your response.

Am Mi., 22. Mai 2024 um 20:02 Uhr schrieb Thomas Passin <tbp1...@gmail.com>:
What directory are you running the tests from?

As documented in the logs I'm running the tests in both PyVEs out of  "~/PyVE/GitHub/Leo/leo-editor/leo/"
Unless you set the right one using PYTHONPATH, you have to be in the leo-editor   directory to be able to find leo.core.xxx, etc.
 
I was not aware, that I have to start the unittests from the top-level directory & not from within  ...

I did re-run the unittests from "~/PyVE/GitHub/Leo/leo-editor/" - and - everything's working fine.

Sorry for the noise !

With kind regards,

Viktor

Edward K. Ream

unread,
May 23, 2024, 5:04:11 AMMay 23
to leo-e...@googlegroups.com
On Thu, May 23, 2024 at 3:20 AM Viktor Ransmayr <viktor....@gmail.com> wrote:
Hello Thomas,

Thanks a lot for your response.

And thanks, Thomas, for all your work supporting Leo.

...you have to be in the leo-editor   directory to be able to find leo.core.xxx, etc.
 
I was not aware, that I have to start the unittests from the top-level directory & not from within  ...

I did re-run the unittests from "~/PyVE/GitHub/Leo/leo-editor/" - and - everything's working fine.

Sorry for the noise !

Please don't apologize! Your questions and testing are valuable. It's all good.

Edward
Reply all
Reply to author
Forward
0 new messages