[narval] lgp and pkginfo now lives in logilab-packaging draft
authorDavid Douard <david.douard@logilab.fr>
Fri, 14 Nov 2014 12:31:47 +0100
changeset 1776 f1a23fc56270
parent 1775 7fcbeba48fd4
child 1777 46fc18db6cc5
[narval] lgp and pkginfo now lives in logilab-packaging And pkginfo is in fact mandatory for the python checkers. Also ensure lgp checkers are properly disabled if lgp is not found.
__pkginfo__.py
_narval/checkers/apycot/lgp.py
_narval/checkers/apycot/python.py
debian/control
--- a/__pkginfo__.py	Fri Nov 14 10:48:37 2014 +0100
+++ b/__pkginfo__.py	Fri Nov 14 12:31:47 2014 +0100
@@ -25,11 +25,11 @@
                'cubicweb-narval': '>= 4.1',
                'Pygments': None,
                'lxml': None,
+               'logilab-packaging': '>= 1.0.0',
                }
 __recommends__ = {'cubicweb-tracker': None,
                   'cubicweb-nosylist': '>= 0.5.0',
                   'cubicweb-jqplot': '>= 0.1.2',
-                  'logilab-devtools': None,
                   'coverage': None,
                   }
 
--- a/_narval/checkers/apycot/lgp.py	Fri Nov 14 10:48:37 2014 +0100
+++ b/_narval/checkers/apycot/lgp.py	Fri Nov 14 12:31:47 2014 +0100
@@ -1,11 +1,11 @@
 import os
 import logging
 from glob import glob
+from warnings import warn
 
 import apycotlib as apycot
 from checkers.apycot import BaseChecker, AbstractFilteredFileChecker
 
-from logilab.devtools.lgp import *
 
 class FilePath(object):
     def __init__(self, path, host=None, **kwargs):
@@ -61,7 +61,6 @@
         os.chdir(cwd)
         return handler.status
 
-apycot.register('checker', LgpCheckChecker)
 
 class LgpBuildChecker(BaseChecker):
     """build debian packages with lgp"""
@@ -116,4 +115,10 @@
             os.chdir(cwd)
         return handler.status
 
-apycot.register('checker', LgpBuildChecker)
+try:
+    from logilab.packaging.lgp import LGP
+    apycot.register('checker', LgpBuildChecker)
+    apycot.register('checker', LgpCheckChecker)
+
+except ImportError:
+    warn("unable to import logilab.packaging.lgp; lgp checkers are disabled")
--- a/_narval/checkers/apycot/python.py	Fri Nov 14 10:48:37 2014 +0100
+++ b/_narval/checkers/apycot/python.py	Fri Nov 14 12:31:47 2014 +0100
@@ -24,6 +24,8 @@
 from logilab.common.decorators import cached
 from logilab.common.proc import RESOURCE_LIMIT_EXCEPTION
 
+from logilab.packaging.lib.pkginfo import PackageInfo
+
 try:
     import coverage
     if coverage.__version__ < "3":
@@ -53,7 +55,6 @@
     modname = config.get('python_modname')
     project_path = test.project_path()
     if not modname and exists(join(project_path, '__pkginfo__.py')):
-        from logilab.devtools.lib.pkginfo import PackageInfo
         pkginfo = PackageInfo(directory=project_path)
         modname = pkginfo.modname
         distname = pkginfo.distname or modname
--- a/debian/control	Fri Nov 14 10:48:37 2014 +0100
+++ b/debian/control	Fri Nov 14 12:31:47 2014 +0100
@@ -36,12 +36,12 @@
  python-unittest2 | python (>= 2.7),
  python-lxml,
  mercurial (>= 2.2),
- python-hglib,
+ python-logilab-packaging,
  ${misc:Depends},
  ${python:Depends},
 Recommends:
  pylint,
  python-coverage,
- logilab-packaging,
+ python-hglib,
 Description: apycot extensions for the narval agent
  Provides a basic set of Narval checkers for Continuous Integration.