Hi Alexei, I don't think you need python 3 support right now. I do feel that the winds are changing. When we switched to python in late 2012, a lot of libraries were not compatible with python 3. The past year however, I've seen a lot of projects switch to support both 2.7 and 3.x. I believe Django is now also compatible with 3.x.
Thing is, supporting both 2.7 and 3.x is fairly easy to do. The biggest issues have to do with handling of unicode and bytes. But there are some libraries out there that handle that fairly well. Whenever we set up something, we strive for compatibilty with 3.x on condition that all libraries we're using have been ported themselves. And lately, that seems to be the case more often. But, as most people out there, we're still running our production apps in 2.7. The nice thing is, that if you start coding 2.7 in a style compatible with 3.x, once 2.7 stops being supported, you're not facing a massive change to 3.x anymore. The fact that Arches creates it's own virtualenv during installation is one of the stranger aspects of Arches deployment. Most other projects I know tend to not create their own virtual environment. I thought the main reason Arches did this was because two Django files needed to be overwritten after installation of Django in the virtual environment? Other than that, does the installation specifically create a 2.7 environment or does it just end up with what the system python creates? Anyway, python 2.7 is not going away soon. Python 3.x (3.4 just came out this week) is gaining momentum, but it'll still take a while before it takes over. My 2 cents: supporting both 2.7 and 3.x at the same times is not that hard once you have a decent test environment set up. Without one, I really wouldn't recommend even trying it. Cheers, Koen ________________________________________ Van: Alexei Peters [apet...@fargeo.com] Verzonden: donderdag 20 maart 2014 17:27 Aan: Van Daele, Koen CC: Tharindu Rusira; archesproject@googlegroups.com Onderwerp: Re: [Arches] Test suite in Arches Hi Koen, No, there is no ticket yet for python 3 support. My question to you is, do you really think we need it? Remembering that Arches runs in it's own virtualenv and that 2.7 will probably be supported for a long time, is this something that might turn people away? I don't really have a sense of python 3 support/adoption in the community. Cheers, Alexei Director of Web Development - Farallon Geographics, Inc. - 971.227.3173 On Thu, Mar 20, 2014 at 1:37 AM, Van Daele, Koen <koen.vanda...@rwo.vlaanderen.be<mailto:koen.vanda...@rwo.vlaanderen.be>> wrote: Hi Alexei, I will ask you the Karl question: Has a ticket been added to the issue tracker yet? I had a quick look and I couldn't find one. I think the best way to try for py3 support is to first get a test suite running under python 2.7. Strive for a decent amount of code coverage (ideally 100%, but that's never easy). When you have that running, you can use tox (http://tox.readthedocs.org/) to run your test suite in different environments (py27, py32, py33, even stranger ones like jython and pypy). This allows for developing in one main environment and immediately checking for compatibiltiy under another one. I'm guessing that when you add py3 to the mix, you'll have some cleaning to do, but once that's finished it's relatively easy to maintain compatibility with different versions. Cheers, Koen ________________________________________ Van: Alexei Peters [apet...@fargeo.com<mailto:apet...@fargeo.com>] Verzonden: woensdag 19 maart 2014 17:50 Aan: Van Daele, Koen CC: Tharindu Rusira; archesproject@googlegroups.com<mailto:archesproject@googlegroups.com> Onderwerp: Re: [Arches] Test suite in Arches HI Koen, No plans on python 3 support yet. That doesn't mean we wouldn't be thrilled if someone from the community took that on (hint hint...). :) As far as the unit testing stuff goes, I still don't think django officially supports postgresql schemas. Cheers, Alexei Director of Web Development - Farallon Geographics, Inc. - 971.227.3173<tel:971.227.3173> On Wed, Mar 19, 2014 at 3:38 AM, Van Daele, Koen <koen.vanda...@rwo.vlaanderen.be<mailto:koen.vanda...@rwo.vlaanderen.be><mailto:koen.vanda...@rwo.vlaanderen.be<mailto:koen.vanda...@rwo.vlaanderen.be>>> wrote: Hi Alexei, Just had a look at the pytest-django docs. They seem to take a very sensible approach. Seems like a good way to move forward. I remember trying to get any kind of unit test running with Arches 0.x and the main issue were some of the changes to make Django use postgresql schemes. No idea how that's changed in 2.0 (since it's now Django 1.6), so hopefully that's no longer an issue. Good choice on dropping 2.6. It's only ArcGIS that sticks with ouddated python versions ;-) Any plans for python 3 support? Cheers, Koen Koen Van Daele Applicatiebeheerder M +32 (0)499 94 93 68<tel:%2B32%20%280%29499%2094%2093%2068><tel:%2B32%20%280%29499%2094%2093%2068> | T +32 (0)2 553 16 82<tel:%2B32%20%280%292%20553%2016%2082><tel:%2B32%20%280%292%20553%2016%2082> Van: Alexei Peters [mailto:apet...@fargeo.com<mailto:apet...@fargeo.com><mailto:apet...@fargeo.com<mailto:apet...@fargeo.com>>] Verzonden: dinsdag 18 maart 2014 19:27 Aan: Van Daele, Koen CC: Tharindu Rusira; archesproject@googlegroups.com<mailto:archesproject@googlegroups.com><mailto:archesproject@googlegroups.com<mailto:archesproject@googlegroups.com>> Onderwerp: Re: [Arches] Test suite in Arches Hi Koen, That's the one thing that I noticed about pytest-dango, is that you don't need to recreate the db for every test run. Also, I removed the ability to use python 2.6 in version Arches 2.0 Cheers, Alexei Director of Web Development - Farallon Geographics, Inc. - 971.227.3173<tel:971.227.3173><tel:971.227.3173<tel:971.227.3173>> On Tue, Mar 18, 2014 at 1:42 AM, Van Daele, Koen <koen.vanda...@rwo.vlaanderen.be<mailto:koen.vanda...@rwo.vlaanderen.be><mailto:koen.vanda...@rwo.vlaanderen.be<mailto:koen.vanda...@rwo.vlaanderen.be>>> wrote: What versions of python are you aiming at? Is Arches still trying to maintain compatibility with 2.6? And is python 3 compatibility wanted? Might influence your choice of testing framework. If you're trying to maintain compatibility with 2.6, look into the unittest2 library. I believe it brings python 2.6's unittest module up to the level of python 2.7's library. I've never used py.test but it looks rather nice. We normally use the standard unittest library, nose as a testrunner and coverage for the coverage report. I believe nose can also run py.test tests. And py.test seems to be able to run nose test suites. So, it all seems to be rather connected. When constructing your testsuite, it's a good idea to try and write as many unit tests as possible without needing a database. These can run a whole lot faster than unit tests requiring a database. Normally your testdatabase will be constructed and torn down for every single unit test. As soon as your database is anything non-trivial, this slows your testsuite down to a crawl. We currently solved this in one of our applications by only setting up and tearing down the database once per testsuite. This is using the Pyramid framework (not Django). What we did, was to setup the database at the beginning of the module, start a database transaction, run the unit test, rollback the transaction, start a new transaction, run the second test, rollback the transaction, etc... At the end of the module, the entire database is torn down. The next module does the same thing. The inspiration for this came from this blog post: http://sontek.net/blog/detail/writing-tests-for-pyramid-and-sqlalchemy. It's about Pyramid (and uses py.test), but I think the principal should be applicable to other frameworks as well. Django might have something for this as well. Cheers, Koen Koen Van Daele Applicatiebeheerder M +32 (0)499 94 93 68<tel:%2B32%20%280%29499%2094%2093%2068><tel:%2B32%20%280%29499%2094%2093%2068> | T +32 (0)2 553 16 82<tel:%2B32%20%280%292%20553%2016%2082><tel:%2B32%20%280%292%20553%2016%2082> Van: archesproject@googlegroups.com<mailto:archesproject@googlegroups.com><mailto:archesproject@googlegroups.com<mailto:archesproject@googlegroups.com>> [mailto:archesproject@googlegroups.com<mailto:archesproject@googlegroups.com><mailto:archesproject@googlegroups.com<mailto:archesproject@googlegroups.com>>] Namens Tharindu Rusira Verzonden: dinsdag 18 maart 2014 8:46 Aan: Alexei Peters CC: archesproject@googlegroups.com<mailto:archesproject@googlegroups.com><mailto:archesproject@googlegroups.com<mailto:archesproject@googlegroups.com>> Onderwerp: Re: [Arches] Test suite in Arches On Tue, Mar 18, 2014 at 12:25 PM, Alexei Peters <apet...@fargeo.com<mailto:apet...@fargeo.com><mailto:apet...@fargeo.com<mailto:apet...@fargeo.com>>> wrote: Hi Tharindu, It looks like PyUnit is in fact the unittest module in python (from their docs, 'Unless you're stuck in the year 2000, PyUnit is in your Python standard library as module unittest.') Yes, they are both the same. I also just saw this: https://pypi.python.org/pypi/pytest-django/ One thing caught my eye when they describe the advantages of pytest which was "Database re-use: no need to re-create the test database for every test run." That may be something we might have to look out for. Interesting. I have not worked with py.test yet. The documentation is pretty convincing but I think we better have a look at these[1][2] comparisons as well. (Also note that these discussions are quite old and probably obsolete). Also, I found[3][4][5] to be very comprehensive articles on Python testing frameworks. So this might be a good starting point to decide where we will be going with our testing work-flow. [1] http://stackoverflow.com/questions/191673/preferred-python-unit-testing-framework [2] http://bytes.com/topic/python/answers/43330-unittest-vs-py-test [3] http://pythontesting.net/framework/pytest/pytest-introduction/ [4] http://halfcooked.com/presentations/pyconau2013/why_I_use_pytest.html [5] http://pydanny.com/pytest-no-boilerplate-testing.html Thanks, -Tharindu. Anyway, we have options. Cheers, Alexei Director of Web Development - Farallon Geographics, Inc. - 971.227.3173<tel:971.227.3173><tel:971.227.3173<tel:971.227.3173>> On Mon, Mar 17, 2014 at 11:38 PM, Tharindu Rusira <tharindurus...@gmail.com<mailto:tharindurus...@gmail.com><mailto:tharindurus...@gmail.com<mailto:tharindurus...@gmail.com>>> wrote: On Tue, Mar 18, 2014 at 11:59 AM, Alexei Peters <apet...@fargeo.com<mailto:apet...@fargeo.com><mailto:apet...@fargeo.com<mailto:apet...@fargeo.com>>> wrote: Hi Tharindu, Django uses the builtin unittest module. It would be nice to use that if possible. Of course it's possible, Alexei. I think that would be a better approach to use this native unittest module. Thanks, -Tharindu https://docs.djangoproject.com/en/dev/topics/testing/ Cheers, Alexei Director of Web Development - Farallon Geographics, Inc. - 971.227.3173<tel:971.227.3173><tel:971.227.3173<tel:971.227.3173>> On Mon, Mar 17, 2014 at 10:05 PM, Tharindu Rusira <tharindurus...@gmail.com<mailto:tharindurus...@gmail.com><mailto:tharindurus...@gmail.com<mailto:tharindurus...@gmail.com>>> wrote: Thanks Alexei, In my gsoc project I'm planning to write unit tests using PyUnit[1]. So I wanted to know whether PyUnit framework is fine or we have a project specific test mechanism. [1] http://pyunit.sourceforge.net Regards, On Mar 18, 2014 10:05 AM, "Alexei Peters" <apet...@fargeo.com<mailto:apet...@fargeo.com><mailto:apet...@fargeo.com<mailto:apet...@fargeo.com>>> wrote: Hi Tharindu, At the moment we don't have any automated test routines. That's why we have project "Integrate a build/ci server and automated unit tests into the Arches dev environment". It would be lovely to have that! Cheers, Alexei Director of Web Development - Farallon Geographics, Inc. - 971.227.3173<tel:971.227.3173><tel:971.227.3173> On Mon, Mar 17, 2014 at 8:39 PM, Tharindu Rusira <tharindurus...@gmail.com<mailto:tharindurus...@gmail.com><mailto:tharindurus...@gmail.com<mailto:tharindurus...@gmail.com>>> wrote: Hi everyone, I would like to know the current level of code coverage in Arches. I browsed through Arches source code in bitbucket[1] but I could not find any test cases. [1] https://bitbucket.org/arches/arches Thanks, -- M.P. Tharindu Rusira Kumara Department of Computer Science and Engineering, University of Moratuwa, Sri Lanka. +94757033733<tel:%2B94757033733> www.tharindu-rusira.blogspot.com<http://www.tharindu-rusira.blogspot.com><http://www.tharindu-rusira.blogspot.com> -- -- To post, send email to archesproject@googlegroups.com<mailto:archesproject@googlegroups.com><mailto:archesproject@googlegroups.com<mailto:archesproject@googlegroups.com>>. To unsubscribe, send email to archesproject+unsubscr...@googlegroups.com<mailto:archesproject%2bunsubscr...@googlegroups.com><mailto:archesproject%2bunsubscr...@googlegroups.com<mailto:archesproject%252bunsubscr...@googlegroups.com>>. For more information, visit https://groups.google.com/d/forum/archesproject?hl=en --- You received this message because you are subscribed to the Google Groups "Arches Project" group. To unsubscribe from this group and stop receiving emails from it, send an email to archesproject+unsubscr...@googlegroups.com<mailto:archesproject%2bunsubscr...@googlegroups.com><mailto:archesproject+unsubscr...@googlegroups.com<mailto:archesproject%2bunsubscr...@googlegroups.com>>. For more options, visit https://groups.google.com/d/optout. -- M.P. Tharindu Rusira Kumara Department of Computer Science and Engineering, University of Moratuwa, Sri Lanka. +94757033733<tel:%2B94757033733> www.tharindu-rusira.blogspot.com<http://www.tharindu-rusira.blogspot.com><http://www.tharindu-rusira.blogspot.com> -- M.P. Tharindu Rusira Kumara Department of Computer Science and Engineering, University of Moratuwa, Sri Lanka. +94757033733<tel:%2B94757033733> www.tharindu-rusira.blogspot.com<http://www.tharindu-rusira.blogspot.com><http://www.tharindu-rusira.blogspot.com> -- -- To post, send email to archesproject@googlegroups.com<mailto:archesproject@googlegroups.com><mailto:archesproject@googlegroups.com<mailto:archesproject@googlegroups.com>>. To unsubscribe, send email to archesproject+unsubscr...@googlegroups.com<mailto:archesproject%2bunsubscr...@googlegroups.com><mailto:archesproject+unsubscr...@googlegroups.com<mailto:archesproject%2bunsubscr...@googlegroups.com>>. For more information, visit https://groups.google.com/d/forum/archesproject?hl=en --- You received this message because you are subscribed to the Google Groups "Arches Project" group. To unsubscribe from this group and stop receiving emails from it, send an email to archesproject+unsubscr...@googlegroups.com<mailto:archesproject%2bunsubscr...@googlegroups.com><mailto:archesproject+unsubscr...@googlegroups.com<mailto:archesproject%2bunsubscr...@googlegroups.com>>. For more options, visit https://groups.google.com/d/optout. -- -- To post, send email to archesproject@googlegroups.com. To unsubscribe, send email to archesproject+unsubscr...@googlegroups.com. For more information, visit https://groups.google.com/d/forum/archesproject?hl=en --- You received this message because you are subscribed to the Google Groups "Arches Project" group. To unsubscribe from this group and stop receiving emails from it, send an email to archesproject+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.