Merge lp:~verterok/ols-tests/drop-python2 into lp:ols-tests

Proposed by Guillermo Gonzalez
Status: Merged
Approved by: Guillermo Gonzalez
Approved revision: 233
Merge reported by: Otto Co-Pilot
Merged at revision: not available
Proposed branch: lp:~verterok/ols-tests/drop-python2
Merge into: lp:ols-tests
Diff against target: 339 lines (+57/-112)
13 files modified
debian/changelog (+6/-0)
debian/control (+4/-25)
debian/python-ols-tests.install (+0/-2)
debian/python3-ols-tests.install (+0/-2)
debian/rules (+1/-2)
debian/tests/control (+0/-3)
debian/tests/upstream2 (+0/-2)
ols-run-tests2 (+0/-27)
ols-vms.conf (+15/-19)
olstests/features.py (+5/-5)
olstests/fixtures.py (+1/-1)
olstests/tests/test_runners.py (+23/-17)
setup.py (+2/-7)
To merge this branch: bzr merge lp:~verterok/ols-tests/drop-python2
Reviewer Review Type Date Requested Status
Maximiliano Bertacchini Approve
Review via email: mp+472330@code.launchpad.net

Commit message

Drop python 2 and updates related to make things work in newer Python 3

To post a comment you must log in.
Revision history for this message
Maximiliano Bertacchini (maxiberta) wrote :

+1

review: Approve
Revision history for this message
Otto Co-Pilot (otto-copilot) wrote :
lp:~verterok/ols-tests/drop-python2 updated
233. By Guillermo Gonzalez

use focal as default release, update ols-vms.conf

Revision history for this message
Otto Co-Pilot (otto-copilot) wrote :

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'debian/changelog'
2--- debian/changelog 2016-07-22 13:18:32 +0000
3+++ debian/changelog 2024-08-30 14:01:32 +0000
4@@ -1,3 +1,9 @@
5+ols-tests (1.0.3) unstable; urgency=medium
6+
7+ * Drop Python 2 support
8+
9+ -- Guillermo Gonzalez <guillermo.gonzalez@canonical.com> Wed, 07 Jun 2023 21:31:04 +0000
10+
11 ols-tests (1.0.2) unstable; urgency=medium
12
13 * Fix pep8 dep broken by the previous pyflakes fix.
14
15=== modified file 'debian/control'
16--- debian/control 2016-07-22 13:18:32 +0000
17+++ debian/control 2024-08-30 14:01:32 +0000
18@@ -4,44 +4,23 @@
19 Standards-Version: 3.9.8
20 Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>
21 XSBC-Original-Maintainer: Vincent Ladeuil <vila+ols@canonical.com>
22-# Starting with ubuntu xenial, pep8 has been split between python-pep8 (module)
23-# and pep8 (script but for python3 !). We only need the module.
24-# For pyflakes, xenial split python-pyflakes and python3-pyflakes
25 Build-Depends: debhelper (>= 9),
26 dh-python,
27- python-pep8 | pep8 (<< 1.6.2-0.1ubuntu2),
28- python3-pyflakes | pyflakes,
29- python-pyflakes | pyflakes,
30- python-all,
31- python-subunit,
32- python-testtools,
33- python-setuptools,
34+ python3-pyflakes | pyflakes3,
35 python3-all,
36+ python3-distro,
37 python3-pep8,
38 python3-setuptools,
39 python3-subunit,
40 python3-testtools,
41
42-Package: python-ols-tests
43-Architecture: all
44-# Same remark as above regarding python2 pep8
45-Depends: python-pep8 | pep8 (<< 1.6.2-0.1ubuntu2),
46- python-pyflakes | pyflakes,
47- python-subunit,
48- python-testtools,
49- ${misc:Depends},
50- ${python:Depends}
51-Description: Online Services test tools.
52-
53 Package: python3-ols-tests
54 Architecture: all
55-# Either the python3 pyflakes library is its own package or is provided as
56-# part of pyflakes (pyflakes3 was introduced later for the python3 script but
57-# we don't need nor use it)
58-Depends: python3-pyflakes | pyflakes,
59+Depends: python3-pyflakes | pyflakes3,
60 python3-pep8,
61 python3-subunit,
62 python3-testtools,
63+ python3-distro,
64 ${misc:Depends},
65 ${python3:Depends}
66 Description: Online Services test tools.
67
68=== removed file 'debian/python-ols-tests.install'
69--- debian/python-ols-tests.install 2016-02-10 11:44:07 +0000
70+++ debian/python-ols-tests.install 1970-01-01 00:00:00 +0000
71@@ -1,2 +0,0 @@
72-usr/lib/python2*
73-usr/bin/ols-run-tests2 /usr/bin/
74
75=== removed file 'debian/python3-ols-tests.install'
76--- debian/python3-ols-tests.install 2016-02-10 11:44:07 +0000
77+++ debian/python3-ols-tests.install 1970-01-01 00:00:00 +0000
78@@ -1,2 +0,0 @@
79-usr/lib/python3*
80-usr/bin/ols-run-tests /usr/bin/
81
82=== modified file 'debian/rules'
83--- debian/rules 2016-02-08 17:54:01 +0000
84+++ debian/rules 2024-08-30 14:01:32 +0000
85@@ -2,8 +2,7 @@
86 #export DH_VERBOSE=1
87
88 %:
89- dh "$@" --with python2,python3 --buildsystem=pybuild
90+ dh "$@" --with python3 --buildsystem=pybuild
91
92 override_dh_auto_test:
93 ./ols-run-tests
94- ./ols-run-tests2
95
96=== modified file 'debian/tests/control'
97--- debian/tests/control 2016-07-22 13:18:32 +0000
98+++ debian/tests/control 2024-08-30 14:01:32 +0000
99@@ -1,5 +1,2 @@
100-Tests: upstream2
101-Depends: python-ols-tests
102-
103 Tests: upstream
104 Depends: python3-ols-tests
105
106=== removed file 'debian/tests/upstream2'
107--- debian/tests/upstream2 2016-02-08 17:54:01 +0000
108+++ debian/tests/upstream2 1970-01-01 00:00:00 +0000
109@@ -1,2 +0,0 @@
110-#!/bin/sh -e
111-ols-run-tests2 -m olstests
112
113=== removed file 'ols-run-tests2'
114--- ols-run-tests2 2016-02-08 17:54:01 +0000
115+++ ols-run-tests2 1970-01-01 00:00:00 +0000
116@@ -1,27 +0,0 @@
117-#!/usr/bin/env python
118-# -*- Mode: python -*-
119-# This file is part of the Online Services test tools
120-#
121-# Copyright 2015 Canonical Ltd.
122-#
123-# This program is free software: you can redistribute it and/or modify it under
124-# the terms of the GNU General Public License version 3, as published by the
125-# Free Software Foundation.
126-#
127-# This program is distributed in the hope that it will be useful, but WITHOUT
128-# ANY WARRANTY; without even the implied warranties of MERCHANTABILITY,
129-# SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
130-# General Public License for more details.
131-#
132-# You should have received a copy of the GNU General Public License along with
133-# this program. If not, see <http://www.gnu.org/licenses/>.
134-"""The CLI Ubuntu CI test runner."""
135-
136-import sys
137-
138-from olstests import runners
139-
140-if __name__ == '__main__':
141- sys.exit(runners.cli_run())
142-
143-
144
145=== modified file 'ols-vms.conf'
146--- ols-vms.conf 2017-02-01 16:42:21 +0000
147+++ ols-vms.conf 2024-08-30 14:01:32 +0000
148@@ -1,29 +1,25 @@
149-packages.olstests = bzr, bzr-builddeb, debhelper, python-all, python-subunit, python-testtools, python-setuptools, python3-all, python3-pep8, python3-setuptools, python3-subunit, python3-testtools
150-packages.before_xenial = pep8, pyflakes
151-packages.from_xenial = python-pep8, python-pyflakes, python3-pyflakes
152+packages.olstests = bzr, bzr-builddeb, debhelper, python3-all, python3-subunit, python3-testtools, python3-setuptools, python3-all, python3-pep8, python3-setuptools, python3-subunit, python3-testtools
153+packages.from_xenial = python3-pyflakes, python3-pyflakes
154 [ols-tests]
155 vm.class = lxd
156+vm.release = focal
157 vm.update = True
158-vm.packages = {packages.olstests}, {packages.before_xenial}
159+vm.packages = {packages.olstests}
160 vm.published_as = ols-tests/{vm.release}/{vm.architecture}
161
162-[ols-tests-trusty]
163-vm.release = trusty
164-
165-[ols-tests-vivid]
166-vm.release = vivid
167-
168-[ols-tests-wily]
169-vm.release = wily
170
171 [ols-tests-xenial]
172 vm.release = xenial
173 vm.packages = {packages.olstests}, {packages.from_xenial}
174
175-[ols-tests-yakkety]
176-vm.release = yakkety
177-vm.packages = {packages.olstests}, {packages.from_xenial}
178-
179-[ols-tests-zesty]
180-vm.release = zesty
181-lxd.image = ubuntu-daily:{vm.release}/{vm.architecture}
182+[ols-tests-bionic]
183+vm.release = bionic
184+vm.packages = {packages.olstests}
185+
186+[ols-tests-focal]
187+vm.release = focal
188+vm.packages = {packages.olstests}
189+
190+[ols-tests-jammy]
191+vm.release = jammy
192+vm.packages = {packages.olstests}
193
194=== modified file 'olstests/features.py'
195--- olstests/features.py 2023-05-01 10:05:24 +0000
196+++ olstests/features.py 2024-08-30 14:01:32 +0000
197@@ -16,7 +16,7 @@
198 """A collection of commonly used 'Features' to optionally run tests."""
199
200 from distutils import spawn
201-import platform
202+import distro
203 import unittest
204
205
206@@ -85,7 +85,7 @@
207 super(PlatformFeature, self).__init__()
208 # self.distro structure may vary between distros, the daughter classes
209 # handle the differences.
210- self.distro = platform.linux_distribution()
211+ self.distro = distro.name(), distro.version(), distro.codename()
212
213
214 class UbuntuPlatformFeature(PlatformFeature):
215@@ -113,10 +113,10 @@
216
217
218 trusty = UbuntuPlatformFeature('trusty')
219-utopic = UbuntuPlatformFeature('utopic')
220-vivid = UbuntuPlatformFeature('vivid')
221-wily = UbuntuPlatformFeature('wily')
222 xenial = UbuntuPlatformFeature('xenial')
223+bionic = UbuntuPlatformFeature('bionic')
224+focal = UbuntuPlatformFeature('focal')
225+jammy = UbuntuPlatformFeature('jammy')
226
227
228 def requires(feature):
229
230=== modified file 'olstests/fixtures.py'
231--- olstests/fixtures.py 2016-02-08 17:54:01 +0000
232+++ olstests/fixtures.py 2024-08-30 14:01:32 +0000
233@@ -148,7 +148,7 @@
234 def test_error(self):
235 self.traceback_line = inspect.currentframe().f_lineno + 2
236 raise SyntaxError('invalid syntax',
237- (self.traceback_file, 1, 1, 'No python'))
238+ (self.traceback_file, 1, 1, 'No python', 1, 1))
239
240 def test_skip(self):
241 self.skipTest('')
242
243=== modified file 'olstests/tests/test_runners.py'
244--- olstests/tests/test_runners.py 2016-02-08 17:54:01 +0000
245+++ olstests/tests/test_runners.py 2024-08-30 14:01:32 +0000
246@@ -287,6 +287,8 @@
247 super(TestOptionParsing, self).setUp()
248 self.out = StringIO()
249 self.err = StringIO()
250+ fixtures.override_env(self, 'COLUMNS', '300')
251+ fixtures.override_env(self, 'LINES', '300')
252
253 def parse_args(self, args):
254 ns = runners.RunTestsArgParser().parse_args(args, self.out, self.err)
255@@ -296,36 +298,40 @@
256 with self.assertRaises(SystemExit):
257 self.parse_args(['-h'])
258 self.maxDiff = None
259- assertions.assertMultiLineAlmostEqual(self, '''\
260-usage: ols-run-tests [-h] [--module MODULE] [--exclude EXCLUDE] [--list]
261- [--load LOAD_FILE] [--format {text,subunit}]
262- [--concurrency CONCURRENCY] [--pick PICK]
263- [INCLUDE [INCLUDE ...]]
264+ include_format = "[INCLUDE ...]"
265+ options_text = "options:"
266+ if not features.jammy.available():
267+ include_format = "[INCLUDE [INCLUDE ...]]"
268+ options_text = "optional arguments:"
269+
270+ assertions.assertMultiLineAlmostEqual(self, ('''\
271+usage: ols-run-tests [-h] [--module MODULE] [--exclude EXCLUDE] [--list] \
272+[--load LOAD_FILE] [--format {{text,subunit}}] [--concurrency CONCURRENCY] \
273+[--pick PICK] {}
274
275 Load and run tests.
276
277 positional arguments:
278- INCLUDE All tests matching the INCLUDE regexp will be run. Can
279- be repeated.
280+ INCLUDE All tests matching the INCLUDE regexp will be run. \
281+Can be repeated.
282
283-optional arguments:
284+{}
285 -h, --help show this help message and exit
286 --module MODULE, -m MODULE
287- Load tests from MODULE[:PATH]. MODULE is found in
288- python path or PATH if specified. Can be repeated.
289+ Load tests from MODULE[:PATH]. MODULE is found in \
290+python path or PATH if specified. Can be repeated.
291 --exclude EXCLUDE, -X EXCLUDE
292- All tests matching the EXCLUDE regexp will not be run.
293- Can be repeated.
294+ All tests matching the EXCLUDE regexp will not be run.\
295+ Can be repeated.
296 --list, -l List the tests instead of running them.
297- --load LOAD_FILE A file name containing test ids to be run in the
298- specified order.
299- --format {text,subunit}, -f {text,subunit}
300+ --load LOAD_FILE A file name containing test ids to be run in the \
301+specified order.
302+ --format {{text,subunit}}, -f {{text,subunit}}
303 Output format for the test results.
304 --concurrency CONCURRENCY, -c CONCURRENCY
305 concurrency (number of processes).
306 --pick PICK n/m pick nth test every m tests.
307-''',
308- self.out.getvalue())
309+'''.format(include_format, options_text)), self.out.getvalue())
310
311 def test_default_values(self):
312 ns = self.parse_args([])
313
314=== modified file 'setup.py'
315--- setup.py 2016-07-22 13:18:32 +0000
316+++ setup.py 2024-08-30 14:01:32 +0000
317@@ -22,10 +22,7 @@
318
319
320 def get_scripts():
321- if sys.version_info < (3,):
322- return ['ols-run-tests2']
323- else:
324- return ['ols-run-tests']
325+ return ['ols-run-tests']
326
327
328 setuptools.setup(
329@@ -36,9 +33,7 @@
330 author_email='vila+ols@canonical.com',
331 url='https://launchpad.net/ols-tests',
332 license='GPLv3',
333- # FIXME: We want 'pyflakes' below but this confuses dh_python3 on xenial
334- # (but not on yakkety...) -- vila 2016-07-22
335- install_requires=['pep8', 'python-subunit', 'testtools'],
336+ install_requires=['pep8', 'subunit', 'testtools'],
337 packages=['olstests', 'olstests.tests'],
338 scripts=get_scripts(),
339 )

Subscribers

People subscribed via source and target branches