Re: Different results of 'test-all' cmd

2022-05-23 Thread Edward K. Ream
On Sun, May 22, 2022 at 9:44 AM tbp1...@gmail.com 
wrote:

>
> IMO, the most reliable way to locate the Leo directory is this (run on
> Linux Mint):
>
> >>> import os.path, leo
> >>> print(os.path.dirname(leo.__file__))
> /home/tom/git/leo-editor/leo
>

A great suggestion.  I use a variant of this technique in g.run_unit_tests.

Edward

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/leo-editor/CAMF8tS0gmy3vX4b1QKaFgvEj_z1-bseBSpYqDjA%3DixDcxkxTKg%40mail.gmail.com.


Re: Different results of 'test-all' cmd

2022-05-22 Thread Edward K. Ream
On Sun, May 22, 2022 at 9:44 AM tbp1...@gmail.com 
wrote:

> I have noticed that there have been a number of expressions used to try to
> find Leo's directory, to try to handle or work around problems like this.
> Some of them involve finding the sitepackages directory.  I want to point
> out that most of these efforts make assumptions that are incorrect for many
> linux installations or when a PYTHONPATH is in effect.
>
> IMO, the most reliable way to locate the Leo directory is this (run on
> Linux Mint):
>
> >>> import os.path, leo
> >>> print(os.path.dirname(leo.__file__))
> /home/tom/git/leo-editor/leo
>
> If I do not set PYTHONPATH to my git clone, the PyPi-installed Leo on the
> same Linux VM is at
>
> /home/tom/.local/lib/python3.6/site-packages/leo
>

Thanks for these remarks. I'm still working on this problem.  See #2668.


Edward

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/leo-editor/CAMF8tS1FyYKqTtu-%3D%3DPw6zB%2BU1pqdBcUdzsbDGEmkzuvtG6npg%40mail.gmail.com.


Re: Different results of 'test-all' cmd

2022-05-22 Thread tbp1...@gmail.com
I have noticed that there have been a number of expressions used to try to 
find Leo's directory, to try to handle or work around problems like this.  
Some of them involve finding the sitepackages directory.  I want to point 
out that most of these efforts make assumptions that are incorrect for many 
linux installations or when a PYTHONPATH is in effect.

IMO, the most reliable way to locate the Leo directory is this (run on 
Linux Mint):

>>> import os.path, leo
>>> print(os.path.dirname(leo.__file__))
/home/tom/git/leo-editor/leo

If I do not set PYTHONPATH to my git clone, the PyPi-installed Leo on the 
same Linux VM is at

/home/tom/.local/lib/python3.6/site-packages/leo

On Sunday, May 22, 2022 at 2:54:36 AM UTC-4 Edward K. Ream wrote:

> On Sun, May 22, 2022 at 1:50 AM Edward K. Ream  wrote:
>
>> On Sun, May 22, 2022 at 1:30 AM Viktor Ransmayr  
>> wrote:
>>
>> >> In short, there is no feasible way to run Leo's test and cover 
>> commands after `pip install leo`.
>>
>>>
>>> I believe, that this difference b/w **Leo-Editor** from GitHub - and - 
>>> **Leo** from PyPI should be documented.
>>>
>>
>> I agree. The place to do so is in the documentation for the test and 
>> cover commands in the Commands Reference.
>>
>
> See #2667. 
>
> Edward
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/leo-editor/2032-503e-4ead-b877-bd116f4802f7n%40googlegroups.com.


Re: Different results of 'test-all' cmd

2022-05-22 Thread Edward K. Ream
On Sun, May 22, 2022 at 1:50 AM Edward K. Ream  wrote:

> On Sun, May 22, 2022 at 1:30 AM Viktor Ransmayr 
> wrote:
>
> >> In short, there is no feasible way to run Leo's test and cover
> commands after `pip install leo`.
>
>>
>> I believe, that this difference b/w **Leo-Editor** from GitHub - and -
>> **Leo** from PyPI should be documented.
>>
>
> I agree. The place to do so is in the documentation for the test and cover
> commands in the Commands Reference.
>

See #2667. 

Edward

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/leo-editor/CAMF8tS2ZfycK30Fxhb5wtkqb9jD-7VQZkkr7BJqMG-fo9xJT0A%40mail.gmail.com.


Re: Different results of 'test-all' cmd

2022-05-22 Thread Edward K. Ream
On Sun, May 22, 2022 at 1:30 AM Viktor Ransmayr 
wrote:

>> In short, there is no feasible way to run Leo's test and cover commands
after `pip install leo`.

>
> I believe, that this difference b/w **Leo-Editor** from GitHub - and -
> **Leo** from PyPI should be documented.
>

I agree. The place to do so is in the documentation for the test and cover
commands in the Commands Reference.

Edward

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/leo-editor/CAMF8tS1uz%2BGj1SW9rWX4rgkU58dzR3c-9fitbJv_Y2zJ-nR9iQ%40mail.gmail.com.


Re: Different results of 'test-all' cmd

2022-05-22 Thread Viktor Ransmayr
Hello Edward,

Am Sa., 21. Mai 2022 um 13:24 Uhr schrieb Edward K. Ream <
edream...@gmail.com>:

> On Fri, May 20, 2022 at 3:32 PM Edward K. Ream 
> wrote:
>
>>
>> 1. I am not going to change Leo's test-all command so that it works in
>> python/site-packages/leo. The workaround is easy: run `python -m unittest`
>> from python/site-packages/leo.
>>
>
> The workaround won't work :-) Indeed, many unit tests contain the line:
>
> import leo.core.leoGlobals as g
>
> Alas, this import assumes that the cwd is the parent directory of the leo
> directory. After `pip install leo`, the parent directory is
> python/Lib/sitecustomize, and we definitely should not (can not) run
> `python -m unittest` from there!
>
> In short, none of Leo's test (or cover) commands will work when using `pip
> install leo`.
>
> Altering sys.path before running each test would pollute *every* test
> file, including leoTest2.py. I'm not going to do it.
>
> *Summary*
>
> setup.py installs leo, not leo-editor. We can't run unit tests from the
> site-packages folder!
>
> Installing leo-editor instead of leo would be a major change to Leo's pypi
> distribution. I'm not going to even consider such a change.
>
> In short, there is no feasible way to run Leo's test and cover commands
> after `pip install leo`.
>

I believe, that this difference b/w **Leo-Editor** from GitHub - and -
**Leo** from PyPI should be documented.

I'm not sure, if "Downloading, Installing & Running Leo" [1] is the right
place, but IMO it would be a pitty if this info would be 'buried' only here
...

With kind regards,

Viktor

---

 [1] https://leoeditor.com/getting-started.html

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/leo-editor/CAAeSrGJFuaFZ_UcssbPXavsEQ%3DUHA5L9R3_%3DS_X19%3DWF7poq-g%40mail.gmail.com.


Re: Different results of 'test-all' cmd

2022-05-21 Thread Edward K. Ream
On Fri, May 20, 2022 at 3:32 PM Edward K. Ream  wrote:

On Sunday, May 1, 2022 at 3:54:07 AM UTC-5 viktor@gmail.com wrote:
>
> 1. I am not going to change Leo's test-all command so that it works in
> python/site-packages/leo. The workaround is easy: run `python -m unittest`
> from python/site-packages/leo.
>

The workaround won't work :-) Indeed, many unit tests contain the line:

import leo.core.leoGlobals as g

Alas, this import assumes that the cwd is the parent directory of the leo
directory. After `pip install leo`, the parent directory is
python/Lib/sitecustomize, and we definitely should not (can not) run
`python -m unittest` from there!

In short, none of Leo's test (or cover) commands will work when using `pip
install leo`.

Altering sys.path before running each test would pollute *every* test file,
including leoTest2.py. I'm not going to do it.

*Summary*

setup.py installs leo, not leo-editor. We can't run unit tests from the
site-packages folder!

Installing leo-editor instead of leo would be a major change to Leo's pypi
distribution. I'm not going to even consider such a change.

In short, there is no feasible way to run Leo's test and cover commands
after `pip install leo`.

Edward

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/leo-editor/CAMF8tS0VuHeE_eU35kWgmeb81j%2B9XmiYkhb9_oVXHZicG1L%2B9A%40mail.gmail.com.


Re: Different results of 'test-all' cmd

2022-05-20 Thread Edward K. Ream
On Sunday, May 1, 2022 at 3:54:07 AM UTC-5 viktor@gmail.com wrote:

Lately I have adapted my defaults a bit - and - execute 'test-all' cmd 
> whenever I modify / upgrade any Leo instance.
>
> Doing this now also with versions I downloaded directly from PyPI I 
> noticed that 'test-all' cmd returns failures & errors.
>

 Many thanks for your testing. It revealed a *serious* bug, as explained in 
#2633 . Summary:

1. I am not going to change Leo's test-all command so that it works in 
python/site-packages/leo. The workaround is easy: run `python -m unittest` 
from python/site-packages/leo.

2. setup.py did not install the leo/test directory. This was a serious 
error that impacted Leo's execute-script command as well as unit tests.

Please test Leo again after Leo 6.6.2 is released. Thanks again!

Edward

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/leo-editor/4706840c-876e-4b95-a526-54632902ac6bn%40googlegroups.com.


Re: Different results of 'test-all' cmd

2022-05-01 Thread Edward K. Ream
On Sun, May 1, 2022 at 9:54 AM Viktor Ransmayr 
wrote:

I guess my intro was to short - and/or - completely missing ;-)
>
> What I noticed is that the two **major** variants of how (many! /most?)
> people install Leo nowadays behave differently:
>
> * Running 'test-all' cmd on a Leo version 6.6* installed from GitHub
> returns **without** any failures & errors
> * Running 'test-all' cmd on a Leo version 6.6* installed from PyPI returns
> **with** failures & errors
>

Thanks for the clarification. I'll look into this further.

As you probably know, recent changes in the 6.6.2 codebase change the
command that g.run_unit_tests uses. Previously, the command string was:

python -m unittest

Now the command string is:

python3 -m unittest

I'm not sure whether this might make a difference.  To repeat, I'll look
into this issue.

Edward

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/leo-editor/CAMF8tS3sJ%3DG4VqHv6a1_rwQLwarFbfdu5_68VEMRxsCc25q%3DnQ%40mail.gmail.com.


Re: Different results of 'test-all' cmd

2022-05-01 Thread Viktor Ransmayr
Hello Edward,

Edward K. Ream schrieb am Sonntag, 1. Mai 2022 um 15:04:14 UTC+2:

> On Sun, May 1, 2022 at 3:54 AM Viktor Ransmayr wrote:
>
> Lately I have adapted my defaults a bit - and - execute 'test-all' cmd 
>> whenever I modify / upgrade any Leo instance.
>>
>
> Thanks for your continued testing, which is one of the most important 
> tasks in maintenance mode.
>

I'm happy, that I can give back at least a little bit this way.
 

> Doing this now also with versions I downloaded directly from PyPI I 
>> noticed that 'test-all' cmd returns failures & errors.
>>
>> * See "Log-001" for the results of the 'test-all' cmd ...
>>
>
> The log probably reveals two issues:
>
> 1. Make sure you `pip install pytest` before running unit tests. I'm not 
> sure exactly how this dependency has crept in.
>

 I guess my intro was to short - and/or - completely missing ;-)

What I noticed is that the two **major** variants of how (many! /most?) 
people install Leo nowadays behave differently:

* Running 'test-all' cmd on a Leo version 6.6* installed from GitHub 
returns **without** any failures & errors 
* Running 'test-all' cmd on a Leo version 6.6* installed from PyPI returns 
**with** failures & errors

Based on your feedback I assume that for a given **released** version of 
Leo, it's variants **should** behave identical.

That is, no matter whether I install it from GitHub or from PyPI **all** 
cmds (applicable for a given OS) should work without the user having to 
install any additional packages.

Is my assumption correct?

If yes, than the answer to the question in my initial mail is: It can be 
considered a bug. - Right?

With kind regards,

Viktor

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/leo-editor/eee0d1a2-2c9d-441b-bb99-ded7b219cc21n%40googlegroups.com.


Re: Different results of 'test-all' cmd

2022-05-01 Thread Edward K. Ream
On Sun, May 1, 2022 at 8:47 AM tbp1...@gmail.com 
wrote:

> And on my system, pylint still can check freewin without crashing:


This might be related to another pylint issue I reported, #6476
. After reporting this bug I
realized that there is a simple workaround: put local python installations
in, say, c:\Apps\Python, rather than c:\Users\Edward Ream\Python.

However, my focus now is on running pylint's *own* unit tests (as part of a
new project), so I'll be working on #6476
 next. The fix is probably one
or two lines of code but I have considerable studying to do first.

Edward

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/leo-editor/CAMF8tS2KZC6AQsgOqFk3R1KFy8AbbfhzLYFNcTLy4xWkakWnLQ%40mail.gmail.com.


Re: Different results of 'test-all' cmd

2022-05-01 Thread tbp1...@gmail.com
And on my system, pylint still can check freewin without crashing:

Your code has been rated at 9.95/10 (previous run: 9.89/10, +0.05)

On Sunday, May 1, 2022 at 9:19:50 AM UTC-4 Edward K. Ream wrote:

> On Sunday, May 1, 2022 at 8:04:14 AM UTC-5 Edward K. Ream wrote:
>
> > I am running pylint tests as I write this. Some complaints may remain. 
> If necessary I'll create a PR.
>
> pylint is happy on python 3.9, but for python 3.10 dozens of messages such 
> as:
>
> leo\core\leoBackground.py:122:12: E1120:
> No value for argument 'slot' in method call (no-value-for-parameter)
>
> This appears to be pylint bug #6464 
> , fixed at 
> https://github.com/PyCQA/astroid, but possibly not merged into pylint's 
> master branch.
>
> Edward
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/leo-editor/6bd8cdcd-a818-4d6e-8bef-2354c3959811n%40googlegroups.com.


Re: Different results of 'test-all' cmd

2022-05-01 Thread Edward K. Ream
On Sunday, May 1, 2022 at 8:04:14 AM UTC-5 Edward K. Ream wrote:

> I am running pylint tests as I write this. Some complaints may remain. If 
necessary I'll create a PR.

pylint is happy on python 3.9, but for python 3.10 dozens of messages such 
as:

leo\core\leoBackground.py:122:12: E1120:
No value for argument 'slot' in method call (no-value-for-parameter)

This appears to be pylint bug #6464 
, fixed at 
https://github.com/PyCQA/astroid, but possibly not merged into pylint's 
master branch.

Edward

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/leo-editor/e3f7ba9c-b119-440d-90e7-53e5612767c5n%40googlegroups.com.


Re: Different results of 'test-all' cmd

2022-05-01 Thread Edward K. Ream
On Sunday, May 1, 2022 at 8:04:14 AM UTC-5 Edward K. Ream wrote:

> pylint issue #6438  [and] 
issue #1534 ...involve astroid, 
a package that handles ast nodes.  

At present pylint-leo skips leo/plugins/freewin.py because of the pylint 
crashes. Imo, there is no great harm in continuing not to check freewin.py.

Edward

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/leo-editor/cbaa08d6-a4f9-4bcf-8f0f-597b0fc15a77n%40googlegroups.com.


Re: Different results of 'test-all' cmd

2022-05-01 Thread Edward K. Ream
On Sun, May 1, 2022 at 3:54 AM Viktor Ransmayr wrote:

Lately I have adapted my defaults a bit - and - execute 'test-all' cmd
> whenever I modify / upgrade any Leo instance.
>

Thanks for your continued testing, which is one of the most important tasks
in maintenance mode.

> Doing this now also with versions I downloaded directly from PyPI I
> noticed that 'test-all' cmd returns failures & errors.
>
> * See "Log-001" for the results of the 'test-all' cmd ...
>

The log probably reveals two issues:

1. Make sure you `pip install pytest` before running unit tests. I'm not
sure exactly how this dependency has crept in.

2. (python:1317): Gdk-CRITICAL **: 08:37:04.625: gdk_atom_intern: assertion
'atom_name != NULL' failed

I recently reported pylint issue #6438
, which is related to pylint
issue #1534 . Both issues
involve astroid, a package that handles ast nodes.  If I am not mistaken,
both issues affect pylint for python 3.9 and 3.10.

If you want to run pylint unit tests on python 3.9 or 3.10, I suggest
cloning the pylint repository and running the tests from the repo's latest
master branch.

I am running pylint tests as I write this. Some complaints may remain. If
necessary I'll create a PR.

One more thing. Rev b88f411 in devel updates leo/test/pylint-leo-rc-ref.txt
to match my private pylint config file. It's hard/impossible to create a
config file that will work with all versions of pylint. I'm good with a
config file that will work with pylint for python 3.9+.

Edward

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/leo-editor/CAMF8tS1%3DvpjHs2Fg%3D9q5ZD4ixBTsytEeUPQ_xcNz294rLNXLxA%40mail.gmail.com.


Different results of 'test-all' cmd

2022-05-01 Thread Viktor Ransmayr
Hello Edward,

Lately I have adapted my defaults a bit - and - execute 'test-all' cmd 
whenever I modify / upgrade any Leo instance.

Doing this now also with versions I downloaded directly from PyPI I noticed 
that 'test-all' cmd returns failures & errors.

* See "Log-001" for the results of the 'test-all' cmd ...

I've started to compare the list of installed packages - but - that did 
also revealed a surprise (at least for me):

The variant of Leo installed from GitHub uses less packages than the one 
installed from PyPI.

* See "Log-002" for the installed package details & differences ...

Is this different behavior expected - or - is this a bug?

With kind regards,

Viktor




E.E.E...

..s...s.

sss.

...s..FFs...



E..F









.FFF
..
(python:1317): Gdk-CRITICAL **: 08:37:04.625: gdk_atom_intern: 
assertion 'atom_name != NULL' failed

(python:1317): Gdk-CRITICAL **: 08:37:04.626: gdk_atom_intern: 
assertion 'atom_name != NULL' failed

Fs.s.sss

ssss..FFF..EE...s..FFF..EEss

s...EE...E..EE.EEsssEEEE

...EEE.EE..EEE.E.ssEEE..EExxEExx

EExxxE.EExEExEEs

EEEE

EEE.

...E..s.s...EEE.

...F.s..s...s...

.s..s...s.s.

..s...ss

..s..s..s.ss..s.

s.s.s...s.s...s.



...ss..s..s.

ss.sss..

s...

..ss..s.s.s.ECHARACTER
 
MATCH 'a'

...E
==
ERROR: astroid.test_utils (unittest.loader._FailedTest)
--
ImportError: Failed to import test module: astroid.test_utils
Traceback (most recent call last):
  File "/usr/lib64/python3.9/unittest/loader.py", line 436, in 
_find_test_path
module = self._get_module_from_name(name)
  File "/usr/lib64/python3.9/unittest/loader.py", line 377, in 
_get_module_from_name
__import__(name)
  File 
"/home/user/PyVE/PyPI/Leo/lib/python3.9/site-packages/astroid/test_utils.py", 
line 20, in 
import pytest
ModuleNotFoundError: No module named 'pytest'

5000+ lines deleted !!!

==
FAIL: test_readFromStdin (pyflakes.test.test_api.IntegrationTests)
If no arguments are passed to C{pyflakes} then it reads from stdin.
--
Traceback (most recent call last):
  File 
"/home/user/PyVE/PyPI/Leo/lib/python3.9/site-packages/pyflakes/test/test_api.py",
 
line 816, in test_readFromStdin
self.assertEqual(d, ("%s%s" % (expected, os.linesep), '', 1))
AssertionError: Tuples differ: ('', 
"/home/user/PyVE/PyPI/Leo/bin/python:[135 chars]", 2) != (":1:1 
'contraband' imported but unused\n", '', 1)

First differing element 0: