Two more PRs merged into devel

46 views
Skip to first unread message

Edward K. Ream

unread,
Apr 10, 2024, 2:01:25 AM4/10/24
to leo-editor

Both PRs strengthen Leo's mypy annotations.


- PR #3856 completes the annotations in leoApp.py.

- PR #3857 completes the annotations in leoGlobals.py


The second PR is the big one. Annotating the "g.app" ivar correctly in LeoApp.py unblocked mypy! Suddenly, mypy found complaints in dozens of other files! The diffs in all the other files arise from this one change.


Bug fixes


PR #3857 fixes several bugs in addition to adding annotations. See the PR for details. I have carefully tested these bug fixes.


A breaking change


PR #3857 also removes the evil "multiple" kwarg from the runOpenFileDialog method in qt_gui.py. This PR adds the runOpenFilesDialog (plural) method. Removing the kwarg is a minor breaking change. It was impossible to annotate the original method in any helpful way.


Summary


These two PRs are a milestone in Leo's history. Most of Leo's objects are now correctly annotated!!


I have carefully tested the bug fixes. Please do the same :-)


Removing the "multiple" kwarg is a minor breaking change. I'm not sure the change is significant enough to call the next release 6.8.0.


All your questions and comments are welcome.


Edward


P.S. In retrospect, perhaps it isn't so surprising that correctly annotating the "g.app" ivar unblocked mypy. The previous "Any" annotation for this crucial ivar likely inhibited mypy checks in myriad ways. Still, the enhanced checking was a great surprise.


EKR

Viktor Ransmayr

unread,
Apr 10, 2024, 4:04:58 AM4/10/24
to leo-editor
Hello Edward,

Edward K. Ream schrieb am Mittwoch, 10. April 2024 um 08:01:25 UTC+2:

Both PRs strengthen Leo's mypy annotations.


- PR #3856 completes the annotations in leoApp.py.

- PR #3857 completes the annotations in leoGlobals.py


The second PR is the big one. Annotating the "g.app" ivar correctly in LeoApp.py unblocked mypy! Suddenly, mypy found complaints in dozens of other files! The diffs in all the other files arise from this one change.


Bug fixes


PR #3857 fixes several bugs in addition to adding annotations. See the PR for details. I have carefully tested these bug fixes.


A breaking change


PR #3857 also removes the evil "multiple" kwarg from the runOpenFileDialog method in qt_gui.py. This PR adds the runOpenFilesDialog (plural) method. Removing the kwarg is a minor breaking change. It was impossible to annotate the original method in any helpful way.


Summary


These two PRs are a milestone in Leo's history. Most of Leo's objects are now correctly annotated!!


I have carefully tested the bug fixes. Please do the same :-)


I have tried to install latest version of "leo-editor/leo-editor:devel" into a dedicated PyVE inside of a Fedora 39 VM.

I'm able to install the dependencies from 'requirements.txt' - but - I'm running again into the issue that 'leo' is NOT found ...

###

    ...
    Installing collected packages: tk, snowballstemmer, PyQt6-WebEngine-Qt6, PyQt6-Qt6, pscript, meta, dialite, webruntime, urllib3, typing_extensions, types-six, types-PyYAML, types-Markdown, types-docutils, tornado, sphinxcontrib-serializinghtml, sphinxcontrib-qthelp, sphinxcontrib-jsmath, sphinxcontrib-htmlhelp, sphinxcontrib-devhelp, sphinxcontrib-applehelp, soupsieve, six, ruff, PyQt6-sip, Pygments, pyflakes, pyenchant, pycparser, pluggy, platformdirs, pathspec, packaging, mypy-extensions, MarkupSafe, iniconfig, imagesize, idna, docutils, coverage, click, charset-normalizer, certifi, babel, alabaster, types-requests, requests, pytest, PyQt6, mypy, Jinja2, flexx, cffi, black, beautifulsoup4, asttokens, sphinx, pytest-cov, PyQt6-WebEngine, PyQt6-QScintilla, cryptography, types-paramiko
    Successfully installed Jinja2-3.1.3 MarkupSafe-2.1.5 PyQt6-6.6.1 PyQt6-QScintilla-2.14.1 PyQt6-Qt6-6.6.3 PyQt6-WebEngine-6.6.0 PyQt6-WebEngine-Qt6-6.6.3 PyQt6-sip-13.6.0 Pygments-2.17.2 alabaster-0.7.16 asttokens-2.4.1 babel-2.14.0 beautifulsoup4-4.12.3 black-24.3.0 certifi-2024.2.2 cffi-1.16.0 charset-normalizer-3.3.2 click-8.1.7 coverage-7.4.4 cryptography-42.0.5 dialite-0.5.3 docutils-0.20.1 flexx-0.8.4 idna-3.6 imagesize-1.4.1 iniconfig-2.0.0 meta-1.0.2 mypy-1.9.0 mypy-extensions-1.0.0 packaging-24.0 pathspec-0.12.1 platformdirs-4.2.0 pluggy-1.4.0 pscript-0.7.7 pycparser-2.22 pyenchant-3.2.2 pyflakes-3.2.0 pytest-8.1.1 pytest-cov-5.0.0 requests-2.31.0 ruff-0.3.5 six-1.16.0 snowballstemmer-2.2.0 soupsieve-2.5 sphinx-7.2.6 sphinxcontrib-applehelp-1.0.8 sphinxcontrib-devhelp-1.0.6 sphinxcontrib-htmlhelp-2.0.5 sphinxcontrib-jsmath-1.0.1 sphinxcontrib-qthelp-1.0.7 sphinxcontrib-serializinghtml-1.1.10 tk-0.1.0 tornado-6.4 types-Markdown-3.6.0.20240316 types-PyYAML-6.0.12.20240311 types-docutils-0.20.0.20240406 types-paramiko-3.4.0.20240311 types-requests-2.31.0.20240406 types-six-1.16.21.20240311 typing_extensions-4.11.0 urllib3-2.2.1 webruntime-0.5.8
    (Leo) [user@fedora-leo-study-vm leo-editor]$
    (Leo) [user@fedora-leo-study-vm leo-editor]$ leo --version
    bash: leo: command not found
    (Leo) [user@fedora-leo-study-vm leo-editor]$

###

I've also checked the last two commit messages for 'pyroject.toml' ...

... but could not find / see any obvious explanation.

With kind regards,

Viktor

Viktor Ransmayr

unread,
Apr 10, 2024, 5:33:59 AM4/10/24
to leo-editor
Hello Edward,

Viktor Ransmayr schrieb am Mittwoch, 10. April 2024 um 10:04:58 UTC+2:
Hello Edward,

Edward K. Ream schrieb am Mittwoch, 10. April 2024 um 08:01:25 UTC+2:
...


Summary


These two PRs are a milestone in Leo's history. Most of Leo's objects are now correctly annotated!!


I have carefully tested the bug fixes. Please do the same :-)

I have tried to install latest version of "leo-editor/leo-editor:devel" into a dedicated PyVE inside of a Fedora 39 VM.

I'm able to install the dependencies from 'requirements.txt' - but - I'm running again into the issue that 'leo' is NOT found ...

###

    ...
    Installing collected packages: tk, snowballstemmer, PyQt6-WebEngine-Qt6, PyQt6-Qt6, pscript, meta, dialite, webruntime, urllib3, typing_extensions, types-six, types-PyYAML, types-Markdown, types-docutils, tornado, sphinxcontrib-serializinghtml, sphinxcontrib-qthelp, sphinxcontrib-jsmath, sphinxcontrib-htmlhelp, sphinxcontrib-devhelp, sphinxcontrib-applehelp, soupsieve, six, ruff, PyQt6-sip, Pygments, pyflakes, pyenchant, pycparser, pluggy, platformdirs, pathspec, packaging, mypy-extensions, MarkupSafe, iniconfig, imagesize, idna, docutils, coverage, click, charset-normalizer, certifi, babel, alabaster, types-requests, requests, pytest, PyQt6, mypy, Jinja2, flexx, cffi, black, beautifulsoup4, asttokens, sphinx, pytest-cov, PyQt6-WebEngine, PyQt6-QScintilla, cryptography, types-paramiko
    Successfully installed Jinja2-3.1.3 MarkupSafe-2.1.5 PyQt6-6.6.1 PyQt6-QScintilla-2.14.1 PyQt6-Qt6-6.6.3 PyQt6-WebEngine-6.6.0 PyQt6-WebEngine-Qt6-6.6.3 PyQt6-sip-13.6.0 Pygments-2.17.2 alabaster-0.7.16 asttokens-2.4.1 babel-2.14.0 beautifulsoup4-4.12.3 black-24.3.0 certifi-2024.2.2 cffi-1.16.0 charset-normalizer-3.3.2 click-8.1.7 coverage-7.4.4 cryptography-42.0.5 dialite-0.5.3 docutils-0.20.1 flexx-0.8.4 idna-3.6 imagesize-1.4.1 iniconfig-2.0.0 meta-1.0.2 mypy-1.9.0 mypy-extensions-1.0.0 packaging-24.0 pathspec-0.12.1 platformdirs-4.2.0 pluggy-1.4.0 pscript-0.7.7 pycparser-2.22 pyenchant-3.2.2 pyflakes-3.2.0 pytest-8.1.1 pytest-cov-5.0.0 requests-2.31.0 ruff-0.3.5 six-1.16.0 snowballstemmer-2.2.0 soupsieve-2.5 sphinx-7.2.6 sphinxcontrib-applehelp-1.0.8 sphinxcontrib-devhelp-1.0.6 sphinxcontrib-htmlhelp-2.0.5 sphinxcontrib-jsmath-1.0.1 sphinxcontrib-qthelp-1.0.7 sphinxcontrib-serializinghtml-1.1.10 tk-0.1.0 tornado-6.4 types-Markdown-3.6.0.20240316 types-PyYAML-6.0.12.20240311 types-docutils-0.20.0.20240406 types-paramiko-3.4.0.20240311 types-requests-2.31.0.20240406 types-six-1.16.21.20240311 typing_extensions-4.11.0 urllib3-2.2.1 webruntime-0.5.8
    (Leo) [user@fedora-leo-study-vm leo-editor]$
    (Leo) [user@fedora-leo-study-vm leo-editor]$ leo --version
    bash: leo: command not found
    (Leo) [user@fedora-leo-study-vm leo-editor]$

###

I've also checked the last two commit messages for 'pyroject.toml' ...

... but could not find / see any obvious explanation.

For completeness I also verified that this problem does exist outside of a PyVE as well. - It does:

###

    ...
    Installing collected packages: tk, snowballstemmer, PyQt6-WebEngine-Qt6, PyQt6-Qt6, pscript, meta, dialite, webruntime, urllib3, typing_extensions, types-six, types-PyYAML, types-Markdown, types-docutils, sphinxcontrib-serializinghtml, sphinxcontrib-qthelp, sphinxcontrib-jsmath, sphinxcontrib-htmlhelp, sphinxcontrib-devhelp, sphinxcontrib-applehelp, soupsieve, ruff, PyQt6-sip, Pygments, pyflakes, pyenchant, pluggy, platformdirs, pathspec, mypy-extensions, iniconfig, imagesize, coverage, click, certifi, babel, asttokens, alabaster, types-requests, requests, pytest, PyQt6, mypy, flexx, black, beautifulsoup4, sphinx, pytest-cov, PyQt6-WebEngine, PyQt6-QScintilla, cryptography, types-paramiko
    Successfully installed PyQt6-6.6.1 PyQt6-QScintilla-2.14.1 PyQt6-Qt6-6.6.3 PyQt6-WebEngine-6.6.0 PyQt6-WebEngine-Qt6-6.6.3 PyQt6-sip-13.6.0 Pygments-2.17.2 alabaster-0.7.16 asttokens-2.4.1 babel-2.14.0 beautifulsoup4-4.12.3 black-24.3.0 certifi-2024.2.2 click-8.1.7 coverage-7.4.4 cryptography-42.0.5 dialite-0.5.3 flexx-0.8.4 imagesize-1.4.1 iniconfig-2.0.0 meta-1.0.2 mypy-1.9.0 mypy-extensions-1.0.0 pathspec-0.12.1 platformdirs-4.2.0 pluggy-1.4.0 pscript-0.7.7 pyenchant-3.2.2 pyflakes-3.2.0 pytest-8.1.1 pytest-cov-5.0.0 requests-2.31.0 ruff-0.3.5 snowballstemmer-2.2.0 soupsieve-2.5 sphinx-7.2.6 sphinxcontrib-applehelp-1.0.8 sphinxcontrib-devhelp-1.0.6 sphinxcontrib-htmlhelp-2.0.5 sphinxcontrib-jsmath-1.0.1 sphinxcontrib-qthelp-1.0.7 sphinxcontrib-serializinghtml-1.1.10 tk-0.1.0 types-Markdown-3.6.0.20240316 types-PyYAML-6.0.12.20240311 types-docutils-0.20.0.20240406 types-paramiko-3.4.0.20240311 types-requests-2.31.0.20240406 types-six-1.16.21.20240311 typing_extensions-4.11.0 urllib3-2.2.1 webruntime-0.5.8
    [user@fedora-leo-study-vm leo-editor]$
    [user@fedora-leo-study-vm leo-editor]$ pwd
    /home/user/Project/GitHub/leo-editor
    [user@fedora-leo-study-vm leo-editor]$
    [user@fedora-leo-study-vm leo-editor]$ cd ~
    [user@fedora-leo-study-vm ~]$
    [user@fedora-leo-study-vm ~]$ leo &
    [1] 3785

    bash: leo: command not found
    [1]+  Exit 127                leo
    [user@fedora-leo-study-vm ~]$
    [user@fedora-leo-study-vm ~]$ which leo
    /usr/bin/which: no leo in (/home/user/.local/bin:/home/user/bin:/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin)
    [user@fedora-leo-study-vm ~]$

###

With kind regards,

Viktor

Viktor Ransmayr

unread,
Apr 11, 2024, 11:49:12 AM4/11/24
to leo-e...@googlegroups.com
Hello Edward,

On Wed, 10 Apr 2024, 11:34 Viktor Ransmayr, <viktor....@gmail.com> wrote:
...
Viktor Ransmayr schrieb am Mittwoch, 10. April 2024 um 10:04:58 UTC+2:
...
Edward K. Ream schrieb am Mittwoch, 10. April 2024 um 08:01:25 UTC+2:
...


Summary


These two PRs are a milestone in Leo's history. Most of Leo's objects are now correctly annotated!!


I have carefully tested the bug fixes. Please do the same :-)


I have tried to install latest version of "leo-editor/leo-editor:devel" into a dedicated PyVE inside of a Fedora 39 VM.

I'm able to install the dependencies from 'requirements.txt' - but - I'm running again into the issue that 'leo' is NOT found ...

###

...

###

I've also checked the last two commit messages for 'pyroject.toml' ...

... but could not find / see any obvious explanation.

For completeness I also verified that this problem does exist outside of a PyVE as well. - It does:

###

...

###

Shall I create a GitHub issue for this issue ?

With kind regards 

Viktor

Reply all
Reply to author
Forward
0 new messages