[narval] Remove the narval checker and the associated debian packaging scripts (closes #192263)

authorVladimir Popescu <vladimir.popescu@logilab.fr>
changeset028f64ef4434
branchdefault
phasepublic
hiddenno
parent revision#3b10c712cc40 [hooks] use https to download logilab's apt key
child revision#1d1ec91734d2 fold lglb-tools@b1a86a736dec into logilab.devtools (closes #269783), #8edc6f26123e fold lglb-tools@b1a86a736dec into logilab.devtools (closes #269783)
files modified by this revision
MANIFEST.in
__pkginfo__.py
debian/control
debian/narval-lgp.install
debian/rules
narval/lgp.py
# HG changeset patch
# User Vladimir Popescu <vladimir.popescu@logilab.fr>
# Date 1385642336 -3600
# Thu Nov 28 13:38:56 2013 +0100
# Node ID 028f64ef4434550ab6f9cc7f5687834bf24a8ef2
# Parent 3b10c712cc401d8d8303c9b20fa568cc4d8924dc
[narval] Remove the narval checker and the associated debian packaging scripts (closes #192263)

diff --git a/MANIFEST.in b/MANIFEST.in
@@ -27,6 +27,5 @@
1  include doc/*.html
2 
3  include man/*.1
4  recursive-include etc *
5 
6 -include narval/lgp.py
diff --git a/__pkginfo__.py b/__pkginfo__.py
@@ -32,13 +32,10 @@
7 
8  from os.path import join, isdir
9 
10  include_dirs = ['templates', join('test', 'data')]
11 
12 -if isdir('narval'):
13 -    data_files = [[join('var', 'lib', 'narval', 'plugins'), [join('narval', 'lgp.py')]]]
14 -
15  scripts = [
16      # logilab-packaging
17      'bin/changelog',
18      'bin/update_gettext',
19      'bin/lgp',
diff --git a/debian/control b/debian/control
@@ -37,11 +37,5 @@
20   Set of elisp goodies including :
21    * an emacs mode for pycover files
22    * an emacs mode for ChangeLog files
23    * a small set of emacs shortcuts used at logilab
24 
25 -Package: narval-lgp
26 -Architecture: all
27 -Depends: ${misc:Depends}, ${python:Depends}, cubicweb-apycot, narval-apycot, logilab-packaging (= ${source:Version})
28 -Description: lgp extensions for apycot
29 - This package provides a set of actions to run lgp check and build from
30 - Narval/Apycot.
diff --git a/debian/narval-lgp.install b/debian/narval-lgp.install
@@ -1,1 +0,0 @@
31 -debian/tmp/usr/var/lib/narval var/lib
diff --git a/debian/rules b/debian/rules
@@ -50,11 +50,11 @@
32  	dh_installdocs -i README changelog.gz
33  	dh_installman -i
34  	dh_installcron -i
35  	-dh_lintian -i
36  	dh_installemacsen -plogilab-elisp
37 -	dh_pysupport -i -Nlogilab-elisp /var/lib/narval/plugins
38 +	dh_pysupport -i -Nlogilab-elisp 
39  	dh_link -i
40  	dh_compress -i -X.py -X.ini -X.xml -Xtest
41  	dh_fixperms -i
42  	dh_installdeb -i
43  	dh_gencontrol -i 
diff --git a/narval/lgp.py b/narval/lgp.py
@@ -1,122 +0,0 @@
44 -
45 -import sys
46 -import os, os.path as osp
47 -import logging
48 -
49 -from narvalbot.prototype import input, output
50 -from narvalbot.elements import FilePath
51 -
52 -import cubes.apycot
53 -import apycotlib as apycot
54 -from apycotlib.checkers import BaseChecker, AbstractFilteredFileChecker
55 -
56 -STEP_DEBIANPKG = 3
57 -
58 -from logilab.devtools.lgp import *
59 -
60 -@apycot.apycotaction('lgp.check', 'CHECKEDOUT in elmt.done_steps')
61 -def act_lgp_check(inputs):
62 -    test = inputs['apycot']
63 -    cwd = os.getcwd()
64 -    os.chdir(test.project_path())
65 -    try:
66 -        checker, status = test.run_checker('lgp.check', inputs.get('options'))
67 -    finally:
68 -        os.chdir(cwd)
69 -    return {}
70 -
71 -@output('changes-files', 'isinstance(elmt, FilePath)', 'elmt.type == "debian.changes"', list=True)
72 -@apycot.apycotaction('lgp.build', 'CHECKEDOUT in elmt.done_steps')
73 -def act_lgp_build(inputs):
74 -    test = inputs['apycot']
75 -    checker, status = test.run_checker('lgp.build', inputs.get('options'))
76 -    return {'changes-files': checker.debian_changes}
77 -
78 -class LgpLogHandler(logging.Handler):
79 -    def __init__(self, writer):
80 -        logging.Handler.__init__(self)
81 -        self.writer = writer
82 -        self.path = None
83 -        self.status = apycot.SUCCESS
84 -
85 -    def emit(self, record):
86 -        if record.levelno >= logging.CRITICAL:
87 -            f = self.writer.fatal
88 -            self.status = apycot.FAILURE
89 -        elif record.levelno >= logging.ERROR:
90 -            f = self.writer.error
91 -            self.status = apycot.FAILURE
92 -        elif record.levelno >= logging.WARNING:
93 -            f = self.writer.warning
94 -        elif record.levelno >= logging.INFO:
95 -            f = self.writer.info
96 -        else:
97 -            f = self.writer.debug
98 -        f(record.getMessage(), path=self.path)
99 -
100 -class LgpCheckChecker(BaseChecker):
101 -    """run tests on a project with lgp"""
102 -
103 -    id = 'lgp.check'
104 -    command = 'check'
105 -    options_def = {
106 -    }
107 -
108 -    def do_check(self, test):
109 -        cmd = LGP.get_command(self.command)
110 -        handler = LgpLogHandler(self.writer)
111 -        cmd.logger.addHandler(handler)
112 -        exit_status = cmd.main_run(['-vv'], LGP.rcfile)
113 -        if exit_status:
114 -            self.writer.fatal('lgp %s exited with status %s', self.command, exit_status)
115 -            self.set_status(apycot.ERROR)
116 -        return apycot.SUCCESS
117 -
118 -apycot.register('checker', LgpCheckChecker)
119 -
120 -class LgpBuildChecker(BaseChecker):
121 -    """build debian packages with lgp"""
122 -
123 -    id = 'lgp.build'
124 -    command = 'build'
125 -    options_def = {
126 -        'lgp_build_distrib': {
127 -            'type': 'csv',
128 -            'help': ('comma-separated list of distributions to build against'),
129 -        },
130 -        'lgp_sign': {
131 -            'help': ('whether to sign packages'),
132 -            'default': 'no',
133 -        },
134 -        'lgp_suffix': {
135 -            'help': ('append vcs revision to the package version'),
136 -        },
137 -    }
138 -
139 -    def do_check(self, test):
140 -        dist = self.options.get('lgp_build_distrib') or ['all']
141 -        sign = self.options.get('lgp_sign')
142 -        suffix = self.options.get('lgp_suffix')
143 -        cwd = os.getcwd()
144 -        os.chdir(test.project_path())
145 -        repo = test.apycot_repository()
146 -        try:
147 -                handler = LgpLogHandler(self.writer)
148 -                cmd = LGP.get_command(self.command)
149 -                cmd.logger.addHandler(handler)
150 -                args = ['-v', '-s', sign, '-d', ','.join(dist), '-r', os.path.join(test.project_path(), '..')]
151 -                if suffix:
152 -                    args += ['--suffix', '~rev%s' % repo.revision()]
153 -                exit_status = cmd.main_run(args, LGP.rcfile)
154 -                self.debian_changes = [FilePath(changes, type='debian.changes', distribution=os.path.basename(os.path.dirname(changes)))
155 -                                       for changes in cmd.packages if changes.endswith('.changes')]
156 -                if exit_status:
157 -                    self.writer.fatal('lgp %s exited with status %s', self.command, exit_status)
158 -                    self.set_status(apycot.ERROR)
159 -                else:
160 -                    test.done_steps.add(STEP_DEBIANPKG)
161 -        finally:
162 -            os.chdir(cwd)
163 -        return handler.status
164 -
165 -apycot.register('checker', LgpBuildChecker)