[GRASS-dev] [SoC] Week 13 - Final Report - Full support of Python 3 in GRASS GIS
Hi everyone, This is my Week 13 final report for the GSoC project "Full support of Python 3 in GRASS GIS" -- Title: Full support of Python 3 in GRASS GIS Community: GRASS GIS - OSGeo Abstract: This project updates the GRASS GIS software to support Python 3, where earlier it only worked with the Python 2.7 version. All the libraries, modules and components of the system have been updated to include the latest changes that have been introduced in Python 3. One of the important updates was a way to deal with unicode and bytes strings that helped in making GRASS compatible with both the versions of Python by properly encoding and decoding the strings. Additionally, the ctypes library, which was only working with Python 2.7, has been upgraded to deal with Python 3 which further helped in modifying the temporal and pygrass libraries. The pydispatch and guinittest modules have also been altered to properly deal with unicodes while the trunk/scripts have been modified and tested by writing new testsuites for them. The GUI module of GRASS is built with wxPython Classic version, which now with the help of wrapper classes works well with the latest wxPython 4 - Phoenix version. The state of the art BEFORE the start of GSoC: Before the start of the project, GRASS GIS had partial support for Python 3. The ctypes library failed to compile with Python 3 while a lot of code in other modules was also incompatible with Python 3 syntax. The GUI module worked with wxPython 3 (Classic version) but not with the latest wxPython 4 (Phoenix). There were a lot of assertion errors and deprecated code warnings that were seen when GRASS was coupled with the wxPython 4. The state of the art AFTER GSoC: After the GSoC, GRASS can now be compiled with Python 3 version. The different libraries and components of GRASS have been updated and are thus compilable with Python 3. The GUI module now has support for both the versions of wxPython, i.e. Classic (3 or older) and Phoenix (4). Challenges: The biggest challenge in updating GRASS was dealing with the ‘ctypes’ library. The official library has not been updated since some time now and the Python 3 support is not complete. It was a major hurdle to get the 'ctypes' working in GRASS to compile other modules/libraries that are dependent on this library. After making the desired changes in the library, the GRASS system is able to compile but there are some lingering issues that make it hard to fix other errors that persist in the temporal and pygrass libraries. Next Steps: The next step would be to discuss ‘ctypes’ issue in further detail with mentors and the development community. Even though some issues related to ctypes have been solved in this project, it still requires some significant efforts and time to make it fully compatible with all Python versions. Moreover, fixing ctypes will help in solving all the remaining issues in other GRASS modules that are closely dependent on this library. Permanent Links: Code Repository for GSoC: https://github.com/sanjeetbhatti/FullSupportPython3 Weekly Reports: https://trac.osgeo.org/grass/wiki/GSoC/2018/FullSupportPython3 Python 2 - 3 and wxPython compatibility guidelines for developers: https://trac.osgeo.org/grass/wiki/Python3Support Image for project representation: https://raw.githubusercontent.com/sanjeetbhatti/FullSupportPython3/master/GSoC-final-report-project-pic.png Thanks, Sanjeet ___ grass-dev mailing list grass-dev@lists.osgeo.org https://lists.osgeo.org/mailman/listinfo/grass-dev
[GRASS-dev] [SoC] Week 12 Report - Full support of Python 3 in GRASS GIS
Hi everyone, This is my week Week 12 report for the project "Full support of Python 3 in GRASS GIS" 1) What did I complete this week? Fixed assertion errors [0] Tested GUI and fixed deprecation warnings and errors Fixed toolboxes.py for bytes Fixed gmodeler, subprocess errors Fixed profile tool and map Fixed list errors 2) What am I going to achieve for the next week? Do more testing, and fix bugs and errors Prepare deliverables, update all patches with the latest revision Prepare guidelines for Py2/3 compatibility code Write Final Report 3) Is there any blocking issue? Not at the moment. The link to my wiki page is here [1]. [0] https://github.com/sanjeetbhatti/FullSupportPython3/blob/master/grass_trunk/gui/patch_gui.diff [1] https://trac.osgeo.org/grass/wiki/GSoC/2018/FullSupportPython3#Week12 Thanks, Sanjeet ___ grass-dev mailing list grass-dev@lists.osgeo.org https://lists.osgeo.org/mailman/listinfo/grass-dev
[GRASS-dev] [SoC] Week 11 Report - Full support of Python 3 in GRASS GIS
Hi everyone, This is my week Week 11 report for the project "Full support of Python 3 in GRASS GIS" 1) What did I complete this week? Replaced instances of old wx.* code with wrapper classes where suitable Fixed forms.py string errors Added cmp function in utils Fixed remaining gui command files Decoded strings where necessary gui files Added encoding in gmcd before hashing 2) What am I going to achieve for the next week? Fix assertion errors Fix remaining warnings in GUI library Do testing for GUI Prepare for evaluation, prepare deliverables 3) Is there any blocking issue? Not at the moment. The link to my wiki page is here [1]. [0] https://github.com/sanjeetbhatti/FullSupportPython3/blob/master/grass_trunk/gui/patch_gui.diff [1] https://trac.osgeo.org/grass/wiki/GSoC/2018/FullSupportPython3#Week11 Thanks, Sanjeet ___ grass-dev mailing list grass-dev@lists.osgeo.org https://lists.osgeo.org/mailman/listinfo/grass-dev
[GRASS-dev] [SoC] Week 10 Report - Full support of Python 3 in GRASS GIS
Hi everyone, This is my week Week 10 report for the project "Full support of Python 3 in GRASS GIS" 1) What did I complete this week? Replaced deprecated code warnings for set-tooltip [0] Fixed psmap issue for map Created new wrapper classes for widgets Fixed animation and mapswipe events binding deprecation warnings Fixed 'cmp' function calls, created custom function to deal with all instances 2) What am I going to achieve for the next week? Replace remaining code deprecated warnings in GUI library Fix remaining gui command files Work on forms.py to fix string errors Replace all instances of old wx.* code with wrapper classes where suitable 3) Is there any blocking issue? Not at the moment. The link to my wiki page is here [1]. [0] https://github.com/sanjeetbhatti/FullSupportPython3/blob/master/grass_trunk/gui/patch_gui.diff [1] https://trac.osgeo.org/grass/wiki/GSoC/2018/FullSupportPython3#Week10 Thanks, Sanjeet ___ grass-dev mailing list grass-dev@lists.osgeo.org https://lists.osgeo.org/mailman/listinfo/grass-dev
[GRASS-dev] [SoC] Week 9 Report - Full support of Python 3 in GRASS GIS
Hi everyone, This is my week Week 9 report for the project "Full support of Python 3 in GRASS GIS" 1) What did I complete this week? Fixed 'temporal' library's connection issue (t.connect) [0] Tested the code with temporal t.connect tests Fixed code for relative paths Fixed g.gui.animation part of gui [1] Wrote two new tests for trunk/scripts (testing pending) 2) What am I going to achieve for the next week? Fix deprecated code in GUI library Fix other gui command files Keep working on temporal library Test all the reamining files in temporal testsuite 3) Is there any blocking issue? Not at the moment. The link to my wiki page is here [2]. [0] https://github.com/sanjeetbhatti/FullSupportPython3/blob/master/grass_trunk/lib-python-temporal/patch_temporal.diff [1] https://github.com/sanjeetbhatti/FullSupportPython3/blob/master/grass_trunk/gui/patch_gui.diff [2] https://trac.osgeo.org/grass/wiki/GSoC/2018/FullSupportPython3#Week9 Thanks Sanjeet ___ grass-dev mailing list grass-dev@lists.osgeo.org https://lists.osgeo.org/mailman/listinfo/grass-dev
[GRASS-dev] [SoC] Week 8 Report - Full support of Python 3 in GRASS GIS
Hi everyone, This is my week Week 8 report for the project "Full support of Python 3 in GRASS GIS" 1) What did I complete this week? Updated 'pygrass' library [0] fixed failing errors Updated 'pydispatch' to deal with dict iterator [1] Fixed 'ctypes' patch [2], was failing to apply Fixed import issues in GUI library [3] Fixed gconsole, goutput and gcmd errors to run the wxpython4 on Py3 Updated all dict iterators (keys, values, items) in GUI library 2) What am I going to achieve for the next week? Fix deprecated code in GUI library Keep working on ctypes-pygrass-temporal libraries Write tests for trunk/scripts 3) Is there any blocking issue? Not at the moment. The link to my wiki page is here [4]. [0] https://github.com/sanjeetbhatti/FullSupportPython3/blob/master/grass_trunk/lib-python-pygrass/patch_pygrass.diff [1] https://github.com/sanjeetbhatti/FullSupportPython3/blob/master/grass_trunk/lib-python-pydispatch/patch_pydispatch.diff [2] https://github.com/sanjeetbhatti/FullSupportPython3/blob/master/grass_trunk/lib-python-ctypes/patch_ctypes_changes_from_fork.diff [3] https://github.com/sanjeetbhatti/FullSupportPython3/blob/master/grass_trunk/gui/patch_gui.diff [4] https://trac.osgeo.org/grass/wiki/GSoC/2018/FullSupportPython3#Week8 Thanks, Sanjeet ___ grass-dev mailing list grass-dev@lists.osgeo.org https://lists.osgeo.org/mailman/listinfo/grass-dev
Re: [GRASS-dev] : [SoC] Week 7 Report - Full support of Python 3 in GRASS GIS
Hi Michael, Yes, I am working on the latest trunk code. Sanjeet Sanjeet On Tue, Jul 3, 2018 at 5:40 PM, Michael Barton wrote: > Sanjeev, > > I recommend working with the trunk code on this. Anna has recently updated > several modules to work with wxp 4. > > Michael > > Michael Barton > School of Human Evolution Change > Center for Social Dynamics & Complexity > Arizona State University > > ...Sent from my iPad > >> On Jul 3, 2018, at 5:32 PM, Sanjeet wrote: >> >>> On Tue, Jul 3, 2018 at 9:24 AM, Michael Barton >>> wrote: >>> Hi Sanjeet, >>> >>> Since you are starting in on the GUI now, I thought I'd let you know that >>> I've compiled GRASS with wxPython 3 and 4 on the Mac and it works pretty >>> well, with a few glitches. Anna Petrasova has solved most of the glitches. >>> I'm compiling this with Python 2.7, but the current versions of wxPython (4 >>> is most current stable) work with Python 3. >> >> Hi Michael, >> >> Thank you for informing that wxPython 3 and 4 both work on Python 2.7. >> Currently, I am updating the GUI files(starting with mapdisp and imgr) >> to work with wxPython 4 on all versions of Python (2.7 and above). >> >> Once I get it working on my system I'll share the patch. It will be >> great to have a lot of people testing it and giving feedback. >> >> Thanks >> Sanjeet ___ grass-dev mailing list grass-dev@lists.osgeo.org https://lists.osgeo.org/mailman/listinfo/grass-dev
Re: [GRASS-dev] : [SoC] Week 7 Report - Full support of Python 3 in GRASS GIS
On Tue, Jul 3, 2018 at 9:24 AM, Michael Barton wrote: > Hi Sanjeet, > > Since you are starting in on the GUI now, I thought I'd let you know that > I've compiled GRASS with wxPython 3 and 4 on the Mac and it works pretty > well, with a few glitches. Anna Petrasova has solved most of the glitches. > I'm compiling this with Python 2.7, but the current versions of wxPython (4 > is most current stable) work with Python 3. Hi Michael, Thank you for informing that wxPython 3 and 4 both work on Python 2.7. Currently, I am updating the GUI files(starting with mapdisp and imgr) to work with wxPython 4 on all versions of Python (2.7 and above). Once I get it working on my system I'll share the patch. It will be great to have a lot of people testing it and giving feedback. Thanks Sanjeet ___ grass-dev mailing list grass-dev@lists.osgeo.org https://lists.osgeo.org/mailman/listinfo/grass-dev
[GRASS-dev] [SoC] Week 7 Report - Full support of Python 3 in GRASS GIS
Hi everyone, This is my week Week 7 report for the project "Full support of Python 3 in GRASS GIS" 1) What did I complete this week? Updated ctypes to deal with bytes[0] Worked on 'temporal' library [1], lot of errors were encountered Looked into issues for 'pygrass' testsuites which were failing too Created a spreadsheet[2] detailing errors and information regarding the temporal testsuites Also, updated the pygrass testsuite details on spreadsheet[3] 2) What am I going to achieve for the next week? Start exploring GUI library, starting with mapdisp and imgr Continue working on fixing ctypes module Continue working on 'temporal' library 3) Is there any blocking issue? Ctypes are not fully compatible with the Python3 even if they are compiling without any issues. Discussed witb mentors about the next steps and how to deal with ctypes. Will discuss more about the upcoming milestones and how ctypes handling is to be done so as not to interfare too much with the pending work. The link to my wiki page is here [4]. [0] https://github.com/sanjeetbhatti/FullSupportPython3/blob/master/grass_trunk/lib-python-ctypes/patch_ctypes_changes_from_fork.diff [1] https://github.com/sanjeetbhatti/FullSupportPython3/blob/master/grass_trunk/lib-python-temporal/patch_temporal.diff [2] https://docs.google.com/spreadsheets/d/1eAIJtegNWSbBscFChhQzMTl0vmbGPjmrW_013hSw9bI/edit#gid=408919374 [3] https://docs.google.com/spreadsheets/d/1eAIJtegNWSbBscFChhQzMTl0vmbGPjmrW_013hSw9bI/edit#gid=587128881 [4] https://trac.osgeo.org/grass/wiki/GSoC/2018/FullSupportPython3#Week7 Thanks, Sanjeet ___ grass-dev mailing list grass-dev@lists.osgeo.org https://lists.osgeo.org/mailman/listinfo/grass-dev
[GRASS-dev] [SoC] Week 6 Report - Full support of Python 3 in GRASS GIS
Hi everyone, This is my week Week 6 report for the project "Full support of Python 3 in GRASS GIS" 1) What did I complete this week? Fixed few issues and updated ctypes [0] Worked on 'Pygrass' library to make it work with the updated ctypes [1] Updated tests in 'pygrass' library [1] 2) What am I going to achieve for the next week? Continue working on 'pygrass' module Work on 'temporal' library Fix pending issues in pygrass 3) Is there any blocking issue? Not at the moment. The link to my wiki page is here [2]. [0] https://github.com/sanjeetbhatti/FullSupportPython3/blob/master/grass_trunk/lib-python-ctypes/patch_ctypes_changes_from_fork.diff [1] https://github.com/sanjeetbhatti/FullSupportPython3/blob/master/grass_trunk/lib-python-pygrass/patch_pygrass.diff [2] https://trac.osgeo.org/grass/wiki/GSoC/2018/FullSupportPython3#Week6 Thanks, Sanjeet ___ grass-dev mailing list grass-dev@lists.osgeo.org https://lists.osgeo.org/mailman/listinfo/grass-dev
[GRASS-dev] [SoC] Week 5 Report - Full support of Python 3 in GRASS GIS
Hi everyone, This is my week Week 5 report for the project "Full support of Python 3 in GRASS GIS" 1) What did I complete this week? Updated tests for 'trunk/scripts' as per the feedback [0] Made changes in the 'ctypes' library to make it compile with Py3 [1] Added another patch for 'ctypes' to include the changes from the latest fork of ctypes [2] Tested the changes with Python versions 2.7, 3.5 and 3.6 2) What am I going to achieve for the next week? Work on 'pygrass' module Compare changes of ctypes compiled version among all 3 versions with and without changes Write new tests for some of the remaining scripts in 'trunk/scripts' 3) Is there any blocking issue? Not at the moment. The link to my wiki page is here [3]. [0] https://github.com/sanjeetbhatti/FullSupportPython3/tree/master/grass_trunk/scripts [1] https://github.com/sanjeetbhatti/FullSupportPython3/blob/master/grass_trunk/lib-python-ctypes/patch_ctypes.diff [2] https://github.com/sanjeetbhatti/FullSupportPython3/blob/master/grass_trunk/lib-python-ctypes/patch_ctypes_changes_from_fork.diff [3] https://trac.osgeo.org/grass/wiki/GSoC/2018/FullSupportPython3#Week5 Thanks, Sanjeet ___ grass-dev mailing list grass-dev@lists.osgeo.org https://lists.osgeo.org/mailman/listinfo/grass-dev
[GRASS-dev] [SoC] Week 4 Report - Full support of Python 3 in GRASS GIS
Hi everyone, This is my Week 4 report for the project "Full support of Python 3 in GRASS GIS" 1) What did I complete this week? Wrote new tests for 'trunk/scripts' according to the priority [0] Updated some files in 'gunittest' library pertaining to the 'trunk/scripts' [1] Looked into different forks of ctypes library Got the fork with latest changes, tried compiling with Py3 Tested the changes done, updated the repository [2] 2) What am I going to achieve for the next week? Submit the first evaluation Work on any changes necessary after discussion and feedback from the mentors Start working on porting the ctypes library 3) Is there any blocking issue? Not at the moment. The link to my wiki page is here [4]. [0] https://github.com/sanjeetbhatti/FullSupportPython3/tree/master/grass_trunk/scripts [1] https://github.com/sanjeetbhatti/FullSupportPython3/tree/master/grass_trunk/lib-python-gunittest [2] https://github.com/sanjeetbhatti/FullSupportPython3/ [3] https://trac.osgeo.org/grass/wiki/GSoC/2018/FullSupportPython3#Week4 Thanks, Sanjeet ___ grass-dev mailing list grass-dev@lists.osgeo.org https://lists.osgeo.org/mailman/listinfo/grass-dev
Re: [GRASS-dev] [Issue] String formatting issue
On Mon, Jun 4, 2018 at 3:54 AM, Nikos Alexandris wrote: > * Sanjeet [2018-06-03 18:08:29 -0600]: >> >> I can resolve this by using fomat() like this: >> msg = _(("Module run {} {} ended with error").format(module,code)) >> >> Do you think this is a good way to resolve this? >> Is "format()" going to work well with translations using the >> ''gettext()'' used as _() as shown in the above line? > > Normally everyone would want to follow the "new" style of formatting > strings, which offers many more options. Why stick to the old style, > i.e. using the % notation? Hi Nikos, Yes, the .format() style should be followed in most cases. I could be wrong but I guess the old style has been used to support older versions of Python. But it seems we can use the 'format' style since we are only keeping support for Python 2.7 (or 2.6 if possible). Sanjeet ___ grass-dev mailing list grass-dev@lists.osgeo.org https://lists.osgeo.org/mailman/listinfo/grass-dev
Re: [GRASS-dev] [Issue] String formatting issue
On Mon, Jun 4, 2018 at 1:58 AM, Maris Nartiss wrote: > Hi Sanjeet, > try like this: > > msg = _("Bla bla {0} with {1}").format(zero, one) > Hi Maris, I tried and it worked too. Thanks, Sanjeet ___ grass-dev mailing list grass-dev@lists.osgeo.org https://lists.osgeo.org/mailman/listinfo/grass-dev
[GRASS-dev] [Issue] String formatting issue
Hi everyone, I came across this type error while porting libs. msg = _("Module run %s %s ended with error") % (module, code) TypeError: %b requires a bytes-like object, or an object that implements __bytes__, not 'NoneType' This uses % format specifier which sometimes fails on Python 3 because of strings and bytes differences. I can resolve this by using fomat() like this: msg = _(("Module run {} {} ended with error").format(module,code)) Do you think this is a good way to resolve this? Is "format()" going to work well with translations using the ''gettext()'' used as _() as shown in the above line? Thanks, Sanjeet ___ grass-dev mailing list grass-dev@lists.osgeo.org https://lists.osgeo.org/mailman/listinfo/grass-dev
[GRASS-dev] [SoC] Week 3 Report - Full support of Python 3 in GRASS GIS
Hi everyone, This is my Week 3 report for the project "Full support of Python 3 in GRASS GIS" 1) What did I complete this week? Wrote new tests for 'Script' library [0] Made changes to the existing source files according to the failing tests [1] Updated scripts in 'trunk/Scripts' [2] Created a spreadsheet to keep track of the status for all trunk/scripts [3] Tested the changes with Python versions 2.7, 3.5 and 3.6 [1,3] Cleaned the patches according to the pep8 guidelines and pushed those patches to the repository 2) What am I going to achieve for the next week? After discussion and feedback from the mentors, finish pending work Look into ctypes and pygrass libraries Discuss with mentors about possible solutions for ctypes Test all the changes done for the evaluation period 3) Is there any blocking issue? Not at the moment. The link to my wiki page is here [4]. Thanks, Sanjeet [0] https://github.com/sanjeetbhatti/FullSupportPython3/tree/master/grass_trunk/lib-python-script [1] https://docs.google.com/spreadsheets/d/1eAIJtegNWSbBscFChhQzMTl0vmbGPjmrW_013hSw9bI/#gid=0 [2] https://github.com/sanjeetbhatti/FullSupportPython3/tree/master/grass_trunk/scripts [3] https://docs.google.com/spreadsheets/d/1eAIJtegNWSbBscFChhQzMTl0vmbGPjmrW_013hSw9bI/#gid=278198865 [4] https://trac.osgeo.org/grass/wiki/GSoC/2018/FullSupportPython3#Week3 ___ grass-dev mailing list grass-dev@lists.osgeo.org https://lists.osgeo.org/mailman/listinfo/grass-dev
Re: [GRASS-dev] GSoC Week 2 Report - Full support of Python 3 in GRASS GIS
On Sun, May 27, 2018 at 12:57 PM, Sanjeet <edu.sanj...@gmail.com> wrote: > Hi everyone, > > This is my Week 2 report for the project "Full support of Python 3 in GRASS > GIS" > > 1) What did I complete this week? > > Updated the encode and decode function in utils.py to accept the > encoding type > Ported functions from 'Script' library to deal with unicode/bytes > (https://gist.github.com/sanjeetbhatti/6714dff40b8a0a6d30df25ce9e4faa20) > Tested the changes by running tests (testsuites) > Tested against the python-grass-addon scripts available from here > (https://github.com/wenzeslaus/python-grass-addon) > > 2) What am I going to achieve for next week? > > Write more tests for script library to test the changes > Look into the issue of running scripts for Python 3.5 and Python > 3.6 (some tests fail on either of the versions) > Port other small libraries and scripts > > 3) Is there any blocking issue? > Not at the moment. > These are my links to wiki and public repository. https://trac.osgeo.org/grass/wiki/GSoC/2018/FullSupportPython3#Week2 https://github.com/sanjeetbhatti/FullSupportPython3 -- Sanjeet Bhatti ___ grass-dev mailing list grass-dev@lists.osgeo.org https://lists.osgeo.org/mailman/listinfo/grass-dev
[GRASS-dev] GSoC Week 2 Report - Full support of Python 3 in GRASS GIS
Hi everyone, This is my Week 2 report for the project "Full support of Python 3 in GRASS GIS" 1) What did I complete this week? Updated the encode and decode function in utils.py to accept the encoding type Ported functions from 'Script' library to deal with unicode/bytes (https://gist.github.com/sanjeetbhatti/6714dff40b8a0a6d30df25ce9e4faa20) Tested the changes by running tests (testsuites) Tested against the python-grass-addon scripts available from here (https://github.com/wenzeslaus/python-grass-addon) 2) What am I going to achieve for next week? Write more tests for script library to test the changes Look into the issue of running scripts for Python 3.5 and Python 3.6 (some tests fail on either of the versions) Port other small libraries and scripts 3) Is there any blocking issue? Not at the moment. Thanks -- Sanjeet Bhatti ___ grass-dev mailing list grass-dev@lists.osgeo.org https://lists.osgeo.org/mailman/listinfo/grass-dev
Re: [GRASS-dev] Python3 GSoC plan for next week
On Sat, May 26, 2018 at 8:12 PM, Anna Petrášová <kratocha...@gmail.com> wrote: > Hi Sanjeet, > > I was looking what you have there for next week and realized we need > to change the order - I forgot that temporal lib depends partially on > ctypes and pygrass, so in order to not get stuck on this now, I > suggest to focus next week on porting scripts and other small > libraries (June 11 - June 17), which makes more sense given this > week's work on python scripting library. Use the following week for > resolving any issues and doing some research on ctypesgen and pygrass. > Please adjust the timeline on your wiki appropriately (order should be > ctypes, pygrass, temporal). Hi Anna, I have updated the timeline on wiki[1]. I hope it seems reasonable now. > Related to that Pietro did some initial work on an alternative to ctypes: > https://github.com/zarch/python-cffi-grass > but I have no idea how difficult it would be to finish this and > replace ctypes, I guess quite a bit of work, so I would focus on > ctypes. Thanks, I will go through this. -- Sanjeet [1] https://trac.osgeo.org/grass/wiki/GSoC/2018/FullSupportPython3#Timeline ___ grass-dev mailing list grass-dev@lists.osgeo.org https://lists.osgeo.org/mailman/listinfo/grass-dev
Re: [GRASS-dev] Regarding testing
On Mon, May 21, 2018 at 8:03 PM, Anna Petrášová <kratocha...@gmail.com> wrote: > Hi Sanjeet and others, Hi Anna, > 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. I uploaded a small patch (on the ticket[1]) last night regarding these changes in the core.py. Let me know if I am doing it correctly. Thanks -- Sanjeet Bhatti [1] https://trac.osgeo.org/grass/ticket/3565 ___ grass-dev mailing list grass-dev@lists.osgeo.org https://lists.osgeo.org/mailman/listinfo/grass-dev
[GRASS-dev] GSoC Week 1 Report - Full support of Python 3 in GRASS GIS
Hi everyone, This is my Week 1 report for my GSoC Project. 1) What did I complete this week? Updated the script for redundant lines in the patch submitted for utils.py Tested the patches on Python versions 2.7.x, 3.5.x and 3.6.x Read and understood the main differences about Strings, Unicode strings and Byte strings in Python 2 and 3 versions. Wrote some brief differences for quick reference(https://docs.google.com/document/d/18Tvl0vpTSwOfO4xGKXpAo-h6o6WAAZmHX8neYIsHTtA) Read python's package futurize's documentation for Py2 to Py3 conversion Updated source code in python lib files (uncommitted, still testing) 2) What am I going to achieve for next week? Finish porting 'script' library to support Python3 Test the changes for both the versions Implement any tests required for testing 3) Is there any blocking issue? Not at the moment. Thanks -- Sanjeet Bhatti ___ grass-dev mailing list grass-dev@lists.osgeo.org https://lists.osgeo.org/mailman/listinfo/grass-dev
Re: [GRASS-dev] Regarding testing
On Tue, May 15, 2018 at 7:47 PM, Luca Delucchi <lucadel...@gmail.com> wrote: > On 13 May 2018 at 08:12, Sanjeet <edu.sanj...@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 ___ grass-dev mailing list grass-dev@lists.osgeo.org https://lists.osgeo.org/mailman/listinfo/grass-dev
[GRASS-dev] Community Bonding Period Activity Report "Full support of Python 3 in GRASS GIS"
Hi all, I have completed the following tasks during the community bonding period: * Introduction to Community * Created Project Wiki page and added links on the official wiki pages * Set up my code repository and my development environment. * Had a discussion with mentors about the libraries' tests for the project * Got familiar with the testing framework, python script library, followed tutorials for it. * Updated current tests of the python script library, adjust them to work with Python3 * Read the documentation and practiced fixing bugs You can find the details on my wiki page here: https://trac.osgeo.org/grass/wiki/GSoC/2018/FullSupportPython3#CommunityBondingPeriodReport Regards, -- Sanjeet Bhatti ___ grass-dev mailing list grass-dev@lists.osgeo.org https://lists.osgeo.org/mailman/listinfo/grass-dev
Re: [GRASS-dev] Regarding testing
On Wed, May 9, 2018 at 3:30 AM, Luca Delucchi <lucadel...@gmail.com> wrote: > On 8 May 2018 at 07:39, Sanjeet <edu.sanj...@gmail.com> wrote: >> I made some minor changes in 'utils.py' in lib/python/script and >> 'test_utils.py' in its testsuite. >> https://github.com/sanjeetbhatti/FullSupportPython3/blob/master/patch.diff >> >> The Python 3's bytes cannot contain ASCII literal characters, >> therefore I can't seem to test it as such, I encoded it first before >> checking for an assertion, which I am not sure is a correct way to do >> so as we are ensuring that we do not pass any bytes with ASCII literal >> characters. > > could be this a problem with languages using strange accent mark? > We had and have problem with some languages in translations > >> Same thing is in test_start_command_functions.py. >> Moreover, I generalized the encode and decode functions by using >> string conversion for int and float values. >> >> Please let me know if this is the correct way to go about it. >> > It seems correct to me, but please Anna answer Hi Anna and Luca, I have been working with scripts and testing them with python3 and I made some changes in 2 different patches: 1. patch.diff -> has changes for unicode/bytes in utils and its test_utils.py along with test_start_command_functions.py (depending on the changes in utils) 2. raster.diff -> has changes for raster.py 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 I'm working on few other testsuites and hoping to have a couple of patches submitted by tomorrow. Thanks -- Sanjeet Bhatti ___ grass-dev mailing list grass-dev@lists.osgeo.org https://lists.osgeo.org/mailman/listinfo/grass-dev
Re: [GRASS-dev] Regarding testing
On Fri, May 4, 2018 at 10:23 PM, Anna Petrášová <kratocha...@gmail.com> wrote: > On Fri, May 4, 2018 at 1:19 PM, Sanjeet <edu.sanj...@gmail.com> wrote: >> Also, I was wondering if there is any priority for working with testsuites? > > Look at the tests in Python scripting library > (lib/python/script/testsuite). Test it under Python 3 to see how they > work, specifically test_utils.py will definitely fail for Python 3, > there will be changes needed in utils.py and its test to make it work > (we can discuss those). I am not sure if the other tests work with > Python 3, so let us know. You should try to add some where you feel > there is not enough testing coverage. Please keep asking if > something's unclear. Hi Anna, I made some minor changes in 'utils.py' in lib/python/script and 'test_utils.py' in its testsuite. https://github.com/sanjeetbhatti/FullSupportPython3/blob/master/patch.diff The Python 3's bytes cannot contain ASCII literal characters, therefore I can't seem to test it as such, I encoded it first before checking for an assertion, which I am not sure is a correct way to do so as we are ensuring that we do not pass any bytes with ASCII literal characters. Same thing is in test_start_command_functions.py. Moreover, I generalized the encode and decode functions by using string conversion for int and float values. Please let me know if this is the correct way to go about it. Thanks -- Sanjeet Bhatti ___ grass-dev mailing list grass-dev@lists.osgeo.org https://lists.osgeo.org/mailman/listinfo/grass-dev
Re: [GRASS-dev] GSoC Introduction
On Sat, Apr 28, 2018 at 12:33 AM, Luca Delucchi <lucadel...@gmail.com> wrote: > On 25 April 2018 at 05:40, Anna Petrášová <kratocha...@gmail.com> wrote: >> Hi Sanjeet, >> > Hi Sanjeet, Anna >> >> welcome! For start, please create a wiki page on trac wiki (you should >> already have access there), look at the examples from the past years, >> and follow similar structure: >> https://trac.osgeo.org/grass/wiki/GSoC >> > yes please create the page looking at previous year projects. Hi, Here is my wiki page link: https://trac.osgeo.org/grass/wiki/GSoC/2018/FullSupportPython3 -- Sanjeet Bhatti ___ grass-dev mailing list grass-dev@lists.osgeo.org https://lists.osgeo.org/mailman/listinfo/grass-dev
[GRASS-dev] GSoC Introduction
Hi everyone, My name is Sanjeet Bhatti and I have got selected for GSOC 2018 in GRASS GIS. My project is "Full support of Python 3 in GRASS GIS" with Anna Petrášová and Luca Delucchi as my mentors. Here is my project proposal and everyone is welcome to give suggestions and feedback: https://docs.google.com/document/d/18kD6I7adTKmtXpGOKr4A8hf1pBcf0LNU7jiiRoi9wJ8 This will certainly help me in understanding the requirements and flesh out the ideas that I would be implementing in the coding period. I will soon share my wiki page where I'll be reporting my progress throughout the GSoC period, once I receive the writing access to the OSGeo wiki. Thank you so much for giving me this opportunity. I am excited to be part of OSGeo and GRASS GIS community. Thanks -- Sanjeet Bhatti ___ grass-dev mailing list grass-dev@lists.osgeo.org https://lists.osgeo.org/mailman/listinfo/grass-dev
Re: [GRASS-dev] GSOC 2018 Proposal
On Mon, Mar 26, 2018 at 8:04 AM, Anna Petrášová <kratocha...@gmail.com> wrote: > I just added a note for the timeline. I don't see your proposal on the > google dashboard, please submit it there as draft as soon as possible, > the application period ends tomorrow. Hi Anna, I updated the timeline and shared the draft on the google dashboard. -- Sanjeet Bhatti ___ grass-dev mailing list grass-dev@lists.osgeo.org https://lists.osgeo.org/mailman/listinfo/grass-dev
Re: [GRASS-dev] GSOC 2018 Proposal
On Thu, Mar 22, 2018 at 10:08 PM, Sanjeet <edu.sanj...@gmail.com> wrote: > Hi, > > This is my GSOC proposal for the idea: 'Full support of Python 3 in > GRASS GIS'. Please suggest any improvements, or share any other > feedback. > > https://docs.google.com/document/d/18kD6I7adTKmtXpGOKr4A8hf1pBcf0LNU7jiiRoi9wJ8 I've updated my proposal according to the feedback I received. Please let me know if I was able to address all the changed correctly. Additional feedback and comments are still welcome. :-) Thanks -- Sanjeet Bhatti ___ grass-dev mailing list grass-dev@lists.osgeo.org https://lists.osgeo.org/mailman/listinfo/grass-dev
[GRASS-dev] GSOC 2018 Proposal
Hi, This is my GSOC proposal for the idea: 'Full support of Python 3 in GRASS GIS'. Please suggest any improvements, or share any other feedback. https://docs.google.com/document/d/18kD6I7adTKmtXpGOKr4A8hf1pBcf0LNU7jiiRoi9wJ8 Thanks -- Sanjeet Bhatti ___ grass-dev mailing list grass-dev@lists.osgeo.org https://lists.osgeo.org/mailman/listinfo/grass-dev
Re: [GRASS-dev] GSOC 2018 project for GRASS GIS
On Mar 6, 2018 11:26 AM, "Newcomb, Doug" <doug_newc...@fws.gov> wrote: Sanjeet, Spotted this the other day if it helps. https://medium.com/@boxed/moving-a-large-and-old-codebase-to-python3- 33a5a13f8c99 Hi Doug, Thank you so much for sharing that. It is going to be really helpful in listing the steps to port to python 3. Sanjeet ___ grass-dev mailing list grass-dev@lists.osgeo.org https://lists.osgeo.org/mailman/listinfo/grass-dev
Re: [GRASS-dev] GSOC 2018 project for GRASS GIS
On Mar 6, 2018 3:38 AM, "Margherita Di Leo" <direg...@gmail.com> wrote: On Tue, Mar 6, 2018 at 5:37 AM, Sanjeet <edu.sanj...@gmail.com> wrote: > On Sat, Mar 3, 2018 at 10:50 PM, Anna Petrášová <kratocha...@gmail.com> > wrote: > > Hi Anna, > > I've created a patch file for the ticket #3510. > > > To post a patch in that ticket, you need to get osgeo id: > > https://www.osgeo.org/community/getting-started-osgeo/osgeo_userid/ > > I'm waiting for 'mantra' to create the osgeo user id, so that I can > upload the patch file. > What's your username? > Hi Margherita, I got the email from osgeo and I was able to proceed further and create id. So, my osgeo userid is 'sanjeet'. Is this the username that you were referring to? Thanks ___ grass-dev mailing list grass-dev@lists.osgeo.org https://lists.osgeo.org/mailman/listinfo/grass-dev
Re: [GRASS-dev] GSOC 2018 project for GRASS GIS
On Sat, Mar 3, 2018 at 10:50 PM, Anna Petrášová <kratocha...@gmail.com> wrote: > Basically, the GUI is mostly ported to work with wxPython4 (phoenix), > which is (unlike wxpython 3) Python 3 ready. So far we are running the > GUI on Python 2.7 only. There are some loose ends and depreciation > warnings, which would be nice to get rid of. Since we need to keep > backwards compatibility with wxpython 3, we wrapped some GUI classes > (gui/wxpython/gui_core/wrap.py), so you can start there. You need to > test your changes under both wxpython 3 and 4. Let me know if you need > more clarification. More info what is Attribute Table manager: > > https://grass.osgeo.org/grass75/manuals/wxGUI.dbmgr.html > https://grasswiki.osgeo.org/wiki/WxGUI_Attribute_Table_Manager Hi Anna, I've created a patch file for the ticket #3510. > To post a patch in that ticket, you need to get osgeo id: > https://www.osgeo.org/community/getting-started-osgeo/osgeo_userid/ I'm waiting for 'mantra' to create the osgeo user id, so that I can upload the patch file. -- Sanjeet Bhatti ___ grass-dev mailing list grass-dev@lists.osgeo.org https://lists.osgeo.org/mailman/listinfo/grass-dev
Re: [GRASS-dev] GSOC 2018 project for GRASS GIS
On Mon, Mar 5, 2018 at 6:43 PM, Anna Petrášová <kratocha...@gmail.com> wrote: > Look in the GUI console (second tab at the bottom in Layer Manager). > You can check if you are indeed running wxpython 4 easily from GUI, go > to Python tab and try: >>>> import wx >>>> wx.version() > 4.0.1 gtk2 (phoenix) > > I would recommend running it in virtualenv. > Yes, I see them now. Thanks! -- Sanjeet Bhatti ___ grass-dev mailing list grass-dev@lists.osgeo.org https://lists.osgeo.org/mailman/listinfo/grass-dev
Re: [GRASS-dev] GSOC 2018 project for GRASS GIS
On Sat, Mar 3, 2018 at 10:50 PM, Anna Petrášová <kratocha...@gmail.com> wrote: > Hi Sanjeet, Hi Anna, > On Mon, Feb 26, 2018 at 9:08 PM, Sanjeet <edu.sanj...@gmail.com> wrote: > > I would leave that up to you, you can send it in email, post it on > your github or whatever seems convenient for you. I will share the list soon. > Regarding the GUI, you can look at this ticket: > https://trac.osgeo.org/grass/ticket/3510 > > Basically, the GUI is mostly ported to work with wxPython4 (phoenix), > which is (unlike wxpython 3) Python 3 ready. So far we are running the > GUI on Python 2.7 only. There are some loose ends and depreciation > warnings, which would be nice to get rid of. Since we need to keep > backwards compatibility with wxpython 3, we wrapped some GUI classes > (gui/wxpython/gui_core/wrap.py), so you can start there. You need to > test your changes under both wxpython 3 and 4. Let me know if you need > more clarification. More info what is Attribute Table manager: > > https://grass.osgeo.org/grass75/manuals/wxGUI.dbmgr.html > https://grasswiki.osgeo.org/wiki/WxGUI_Attribute_Table_Manager Meanwhile, I've setup my development environment and compiled the source code. I did not see the warning messages when I opened the Attribution Table Manager as mentioned in the ticket #3510 even when I installed wxpython 4 (on system Ubuntu 16.04 with Python 2.7.x). Is it supposed to be displaying in the console? Because I did not get any warnings. I even tried to set the g.gisenv set="DEBUG=5" to print the debugging messages along with WX_DEBUG. Am I missing some step? Thanks -- Sanjeet Bhatti ___ grass-dev mailing list grass-dev@lists.osgeo.org https://lists.osgeo.org/mailman/listinfo/grass-dev
Re: [GRASS-dev] GSOC 2018 project for GRASS GIS
On Wed, Feb 28, 2018 at 8:38 AM, Markus Neteler <nete...@osgeo.org> wrote: > > There are some tickets flagged with "python3": > https://trac.osgeo.org/grass/query?status=!closed=~python3 > > I suppose that more tickets should carry that keyword but they need to > be identified by scanning those with "python" keyword. > > The topic suggestions are posted here (as you know): > https://trac.osgeo.org/grass/wiki/GSoC/2018 > > but did you already check this page? > https://wiki.osgeo.org/wiki/Google_Summer_of_Code_Recommendations_for_Students Hi Markus, Thanks for sharing the links. I've gone through them now. -- Sanjeet Bhatti ___ grass-dev mailing list grass-dev@lists.osgeo.org https://lists.osgeo.org/mailman/listinfo/grass-dev
[GRASS-dev] GSOC 2018 project for GRASS GIS
Hi, My name is Sanjeet Bhatti and I am an MSc. student in Computer Science from University of Saskatchewan, Canada. I was going through the list of GSOC project ideas of GRASS GIS and I found one that caught my interest: "Full support of Python 3 in GRASS GIS". I am familiar with python programming as well as have a basic understanding of wxPython. Currently, I am setting up my development environment by checking out the development branch (trunk) of GRASS 7 available at this link[0]. Are there any initial tasks that I should be doing apart from listing the generally used solutions for migrating from Python 2 to 3? And, where do I need to submit these? Thank you, Sanjeet [0] svn.osgeo.org/grass/grass/ ___ grass-dev mailing list grass-dev@lists.osgeo.org https://lists.osgeo.org/mailman/listinfo/grass-dev