[GRASS-dev] Regarding testing

Anna Petrášová kratochanna at gmail.com
Mon May 21 19:03:05 PDT 2018


Hi Sanjeet and others,

sorry for late answer, I hope to be more responsive now.

I created a ticket where we can discuss changes for Python Scripting
Library [1]. I uploaded your patch, so please upload your future
patches there, you can upload final patches to your github (I suggest
to structure your repo in some way and use more descriptive names than
patch.diff).
Look at my patch, hopefully it makes sense.

We discussed further changes in this library regarding unicode/bytes
handling with Vaclav and collected ideas here [2]. Basically, we need
to adjust many functions to accept and return unicode ('str' in
Python3), otherwise the functions won't behave as expected when used
by Python 3 users. For Popen wrapper functions (read_command,
run_command, ...) we suggest to use new encoding parameter (similar to
Popen in Python3.6) allowing to switch the behavior for fine control,
with using unicode by default (to work as expected by Python 3 users).
There will be problems because it's not garbage in garbage out as it
used to be, so something encoded on Windows won't be read correctly on
Linux. However this is our current idea, we can discuss it further.

So, Sanjeet, let me know if it makes sense to you and try to implement
the changes where necessary (starting with core.py). It would be good
to write more tests during the process.

Anna


[1] https://trac.osgeo.org/grass/ticket/3565
[2] https://trac.osgeo.org/grass/wiki/Python3Support#PythonScriptingLibrary

On Wed, May 16, 2018 at 1:36 AM, Sanjeet <edu.sanjeet at gmail.com> wrote:
> On Tue, May 15, 2018 at 7:47 PM, Luca Delucchi <lucadeluge at gmail.com> wrote:
>> On 13 May 2018 at 08:12, Sanjeet <edu.sanjeet at gmail.com> wrote:
>> Hi Sanjeet
>> What other devs think about the patches?
>>
>> They seem ok for me, I tested and they work
>>
>>> Please take a look here:
>>> https://github.com/sanjeetbhatti/FullSupportPython3
>>>
>>> For other tests, I have created a google sheet:
>>> https://docs.google.com/spreadsheets/d/1eAIJtegNWSbBscFChhQzMTl0vmbGPjmrW_013hSw9bI
>
> Hi Luca,
>
> Sorry about the access, I thought I already had given access, but it
> is provided now. :)
>
>> A comment about results, for me the test_doctest.py is working fine
>> with Python 3.5.3
>>
>>  100%
>>  100%
>> Loading floating point data with 8 bytes ... (6x4x3)
>>  100%
>> Loading floating point data with 8 bytes ... (6x4x3)
>>  100%
>> .
>> ----------------------------------------------------------------------
>> Ran 1 test in 0.785s
>> OK
>
> I will test it again on the Python 3.6.5 as well as on the version
> that you mentioned (3.5.3).
>
> Thanks
> --
> Sanjeet Bhatti


More information about the grass-dev mailing list