subscribe to this blog

Logilab.org - en

News from Logilab and our Free Software projects, as well as on topics dear to our hearts (Python, Debian, Linux, the semantic web, scientific computing...)

show 208 results
  • Emacs and mercurial trick

    2009/04/03 by Ludovic Aubry
    http://www.logilab.org/image/8863?vid=download

    While using emacs I always find the need to use grep on a terminal to search for things within a specific project. This is not ideal, even within an embedded emacs shell.

    Since I recently discovered the emacs command grep-find I decided to make it work nicely with mercurial projects, and here's the result:

    (defun grep-project (s)
      (interactive "sSearch project for: ")
       (grep-find (concat "files=(`hg manifest`);grep -nH -e \"" s "\" ${files[@]/#/`hg root`/}"))
    )
    (global-set-key (quote [f4]) (quote grep-project))
    

  • Pylint at BayPIGgies

    2009/03/30 by Sandrine Ribeau
    http://farm4.static.flickr.com/3232/3140527012_23d9d97f69_m_d.jpg

    I am pleased to announce that Pylint was presented during a Tools night meeting organized by BayPIGgies on thursday march 26th. This meeting has been recorded and you can enjoy the video.

    One point was missing from the presentation and I'll take the opportunity now to mention it. Flymake, an on-the-fly syntax checker for GNU Emacs which has been discussed, does work in combination with Pylint (please see EmacsWiki for more informations).

    photo by ten safe frogs under creative commons


  • new pylint / astng / common releases

    2009/03/25 by Sylvain Thenault
    http://janckos.net/blog/wp-content/uploads/2008/08/python.png

    I'm pleased to announce releases of pylint 0.18, logilab-astng 0.19 and logilab-common 0.39. All these packages should now be cleanly available through easy install.

    Also, happy pylint users will get:

    • fixed python 2.6 support (pylint/astng tested from 2.4 to 2.6)
    • get source code (and so astng) for zip/egg imports
    • some understanding of the property decorator and of unbound methods
    • some false positives fixed and others minor improvments

    See projects home page and ChangeLog for more information:

    http://www.logilab.org/project/pylint http://www.logilab.org/project/logilab-astng http://www.logilab.org/project/logilab-common

    Please report any problem / question to the python-projects@lists.logilab.org mailing-list.

    Enjoy!


  • broken easy_install support

    2009/03/25 by Sylvain Thenault
    http://3.bp.blogspot.com/_lh41g82r7rk/SHIY6tMEk-I/AAAAAAAAABQ/Xh33EO1oa-U/s200/system-software-install48b.png

    I recently understood why easy_install wasn't able to find so many of our packages anymore.

    The problem was due to a recent change on our website. The project page was ajaxified, and since easy_install uses some screenscrapping techniques to get distribution archives, it can not find the files it is looking for.

    To fix this, we should make our tarballs downloadable from PyPI, by using

    python setup.py register sdist upload
    

    instead of the current:

    python setup.py register
    

    Uploading our public python software packages to PyPI will make them easy_installable in a breeze !


  • Pylint and Astng support for the _ast module

    2009/03/19 by Emile Anclin

    Supporting _ast and compiler

    Python 2.5 introduces a new module _ast for Abstract Syntax Tree (AST) representation of python code. This module is quite faster than the compiler.ast representation that logilab-astng (and therefore pylint) used until now and the compiler module was removed in Python 3.0.

    Faster is good, but the representations of python code are quite different in _ast and in compiler : some nodes exist in one AST but not the other and almost all child nodes have different names.

    We had to engage in a big refactoring to use the new _ast module, since we wanted to stay compatible with python version < 2.5, which meant keeping the compiler module support. A lot of work was done to find a common representation for the two different trees. In most cases we used _ast-like representations and names, but in some cases we kept ideas or attribute names of compiler.

    Abstract Syntax Trees

    Let's look at an example to compare both representations. Here is a seamingly harmless snippet of code:

    CODE = """
    if cond:
        del delvar
    elif next:
        print
    """
    

    Now, compare the respective _ast and compiler representations (nodes are in upper case and their attributes are in lower case).

    compiler representation

    Module
        node =
        Stmt
            nodes = [
            If
                tests = [
                Name
                    name = 'cond'
                Stmt
                    nodes = [
                    AssName
                        flags = 'OP_DELETE'
                        name = 'delvar'
                    ]
                Name
                    name = 'next'
                Stmt
                    nodes = [
                    Printnl
                    ]
                ]
    

    _ast representation

    Module
        body = [
        If
            test =
            Name
                id = 'cond'
            body = [
            Delete
                targets = [
                Name
                    id = 'delvar'
                ]
            ]
            orelse = [
            If
                test =
                Name
                    id = 'next'
                body = [
                Print
                    nl = True
                ]
            ]
        ]
    

    Can you spot any differences? I would say, they differ quite a lot... For instance, compiler turns a "elif" statements into a list called 'tests' when _ast treats "elif cond:" as if it were "else:if cond:".

    Tree Rebuilding

    We transform these trees by renaming attributes and nodes, or removing or introducing new ones: with compiler, we remove the Stmt node, introduce a Delete node, and recursively build the If nodes coming from an "elif"; and with _ast, we reintroduce the AssName node. This might be only a temporary step towards full _ast like representation.

    This is done by the TreeRebuilder Visitors, one for each representation, which are respectively in astng._nodes_compiler and astng._ast.

    In the simplest case, the TreeRebuilder method looks like this (_nodes_compiler):

    def visit_list(self, node):
        node.elts = node.nodes
        del node.nodes
    

    (and nothing to do for _ast).

    So, after doing all this and a lot more, we get the following representation from both input trees:

    Module()
        body = [
        If()
            test =
            Name(cond)
            body = [
            Delete()
                targets = [
                DelName(delvar)
                ]
            ]
            orelse = [
            If()
                test =
                Name(next)
                body = [
                Print()
                    dest =
                    None
                    values = [
                    ]
                ]
                orelse = [
                ]
            ]
        ]
    

    Faster towards Py3k

    Of course, you can imagine these modifications had some API repercussions, and thus required a lot of smaller Pylint modifications. But all was done so that you should see no difference in Pylint's behavior using either python <2.5 or python >=2.5, except that with the _ast module pylint is around two times faster!

    Oh, and we fixed small bugs on the way and maybe introduced a few new ones...

    Finally, it is a major step towards Pylint Py3k!


  • hgview 0.10.2 released

    2009/03/13 by Graziella Toutoungis

    I have the pleasure of announcing that the version hgview 0.10.2 was posted on this site and is available for downloading. In this version we added some new functionalities like :

    • Change the search behavior: the button "Next" will move the focus on the next found searched text.
    • Diff works on the merge node.
    • The command --version shows the current version of hgview
    • Fix a bug when the file's name contains space.
    http://www.selenic.com/hg-logo/logo-droplets-50.png

  • New version of projman

    2009/03/10

    Projman is a project management tool. It reads project descriptions and activity logs to schedule tasks and to generate gantt diagrams.

    The version 0.13.6 fix some gantt diagram generation bugs. Graphics library helper is now Cairo instead of matplotlib. Some examples, according to the new model (use of resources type and roles in tasks) have been added to the project.

    And, of course, the compulsory screenshot.

    http://www.logilab.org/image/8387?vid=download

  • Debian Lenny release date - almost there ?

    2009/02/09 by Arthur Lutz
    http://www.debian.org/logos/openlogo-nd-50.png

    Being big fans of debian, we are impatiently awaiting the new stable release of the distribution : lenny. Finding it pretty difficult to find information about when they were expecting to release it, I asked a colleague if he knew. He's a debian developer so I though he might have the info. And he did : according to the debian.devel mailing list we should be having the release for the 14th of February 2009. In other words : in 5 days!

    http://thread.gmane.org/gmane.linux.debian.devel.announce/1318

    There's a few geeky emails on the release date if you have time to read the threads.

    http://www.sinologic.net/wp-content/uploads/2008/08/lenny_debian.jpg

  • LUTIN77: Logilab Unit Test IN fortran 77

    2009/01/28 by Andre Espaze

    We've just released a new project on logilab.org : lutin77. It's a test framework for Fortran77.

    The goal of this framework is to make unit tests in fortran 77 by having few dependencies: a POSIX environment with C and fortran 77 compilers. Of course, you can use it for making integration or acceptance tests too. The 0.1 version has just been released here: http://www.logilab.org/project/lutin77

    If you are new to the unit tests way of building software, I must admit it lacks examples. For an introduction to the techniques involved, you can have a look at Growing Object-Oriented Software, Guided by Tests even if mocked subroutines will be for later. But remember that if you do not like to write tests, you are probably not writing unit tests.


  • Apycot big version change

    2009/01/26 by Arthur Lutz

    The version convention that we use is pretty straight forward and standard : it's composed of 3 numbers separated by dots. What are the rules to incrementing each on of these numbers ?

    • The last number is a incremented when bugs are corrected
    • The middle number is incremented when stories (functionalities) are implemented to the software
    • The first number is incremented when we have a major change of technology

    Well... if you've been paying attention, apycot just turned 1.0.0, the major change of technology is that it is now integrated to CubicWeb (instead of just generating html files). So for a project in your forge, you describe the apycot configuration for it, and the tests for quality assurance are launched on a regular basis. We're still in the process of stabilizing it (latest right now it 1.0.5), but it already runs on the CubicWeb projects, see the screenshot below :

    http://www.logilab.org/image/7682?vid=download

    You should also know that now apycot has two components : the apycotbot which runs the tests and an cubicweb-apycot which displays the results in cubicweb (download cubicweb-apycot-1.0.5.tar.gz and apycotbot-1.0.5.tar.gz).


show 208 results