Ubuntu Pastebin

Paste from jamespage at Wed, 15 Nov 2017 12:21:07 +0000

Download as text
  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
diff -Nru dh-python-2.20170125/debian/changelog dh-python-2.20170125ubuntu1/debian/changelog
--- dh-python-2.20170125/debian/changelog	2017-01-25 14:47:18.000000000 +0000
+++ dh-python-2.20170125ubuntu1/debian/changelog	2017-11-15 10:26:20.000000000 +0000
@@ -1,3 +1,10 @@
+dh-python (2.20170125ubuntu1) UNRELEASED; urgency=medium
+
+  * Add support for stestr, testrepository and ostestr based unit test
+    detection and execution.
+
+ -- James Page <james.page@ubuntu.com>  Wed, 15 Nov 2017 10:26:20 +0000
+
 dh-python (2.20170125) unstable; urgency=medium
 
   * pybuild.pm:
diff -Nru dh-python-2.20170125/debian/control dh-python-2.20170125ubuntu1/debian/control
--- dh-python-2.20170125/debian/control	2017-01-25 14:20:05.000000000 +0000
+++ dh-python-2.20170125ubuntu1/debian/control	2017-11-15 10:26:20.000000000 +0000
@@ -1,7 +1,8 @@
 Source: dh-python
 Section: python
 Priority: optional
-Maintainer: Piotr Ożarowski <piotr@debian.org>
+Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>
+XSBC-Original-Maintainer: Piotr Ożarowski <piotr@debian.org>
 Uploaders: Stefano Rivera <stefanor@debian.org>, Barry Warsaw <barry@debian.org>
 Build-Depends: debhelper (>= 9), python3-minimal, libpython3-stdlib, libdpkg-perl,
 # provides rst2man command (python3-docutils not used to avoid circular deps):
diff -Nru dh-python-2.20170125/dh/pybuild.pm dh-python-2.20170125ubuntu1/dh/pybuild.pm
--- dh-python-2.20170125/dh/pybuild.pm	2016-09-07 21:39:26.000000000 +0100
+++ dh-python-2.20170125ubuntu1/dh/pybuild.pm	2017-11-15 10:26:20.000000000 +0000
@@ -128,12 +128,24 @@
 				push @py2opts, '--test-pytest'}
 			elsif (grep {$_ eq 'python-nose'} @deps and $ENV{'PYBUILD_TEST_NOSE'} ne '0') {
 				push @py2opts, '--test-nose'}
+            elsif (grep {$_ eq 'python-stestr'} @deps and $ENV{'PYBUILD_TEST_STESTR'} ne '0') {
+                push @py2opts, '--test-stestr'}
+            elsif (grep {$_ eq 'testrepository'} @deps and $ENV{'PYBUILD_TEST_TESTR'} ne '0') {
+                push @py2opts, '--test-testr'}
+            elsif (grep {$_ eq 'python-os-testr'} @deps and $ENV{'PYBUILD_TEST_OSTESTR'} ne '0') {
+                push @py2opts, '--test-ostestr'}
 			if (grep {$_ eq 'python3-tox'} @deps and $ENV{'PYBUILD_TEST_TOX'} ne '0') {
 				push @py3opts, '--test-tox'}
 			elsif (grep {$_ eq 'python3-pytest'} @deps and $ENV{'PYBUILD_TEST_PYTEST'} ne '0') {
 				push @py3opts, '--test-pytest'}
 			elsif (grep {$_ eq 'python3-nose'} @deps and $ENV{'PYBUILD_TEST_NOSE'} ne '0') {
 				push @py3opts, '--test-nose'}
+            elsif (grep {$_ eq 'python3-stestr'} @deps and $ENV{'PYBUILD_TEST_STESTR'} ne '0') {
+                push @py3opts, '--test-stestr'}
+            elsif (grep {$_ eq 'testrepository'} @deps and $ENV{'PYBUILD_TEST_TESTR'} ne '0') {
+                push @py3opts, '--test-testr'}
+            elsif (grep {$_ eq 'python3-os-testr'} @deps and $ENV{'PYBUILD_TEST_OSTESTR'} ne '0') {
+                push @py3opts, '--test-ostestr'}
 			if (grep {$_ eq 'pypy-tox'} @deps and $ENV{'PYBUILD_TEST_TOX'} ne '0') {
 				push @pypyopts, '--test-tox'}
 			elsif (grep {$_ eq 'pypy-pytest'} @deps and $ENV{'PYBUILD_TEST_PYTEST'} ne '0') {
diff -Nru dh-python-2.20170125/dhpython/build/base.py dh-python-2.20170125ubuntu1/dhpython/build/base.py
--- dh-python-2.20170125/dhpython/build/base.py	2016-06-17 21:05:56.000000000 +0100
+++ dh-python-2.20170125ubuntu1/dhpython/build/base.py	2017-11-15 10:26:20.000000000 +0000
@@ -169,6 +169,14 @@
             return 'cd {build_dir}; {interpreter} -m pytest {args}'
         elif self.cfg.test_tox:
             return 'cd {build_dir}; tox -c {dir}/tox.ini -e py{version.major}{version.minor}'
+        elif self.cfg.test_stestr:
+            return ('python{version.major}-stestr init;'
+                    'PYTHON=python{version.major}.{version.minor} python{version.major}-stestr run')
+        elif self.cfg.test_testr:
+            return ('testr-python{version.major} init;'
+                    'PYTHON=python{version.major}.{version.minor} testr-python{version.major} run')
+        elif self.cfg.test_ostestr:
+            return ('PYTHON=python{version.major}.{version.minor} python{version.major}-ostestr')
         elif args['version'] == '2.7' or args['version'] >> '3.1' or args['interpreter'] == 'pypy':
             return 'cd {build_dir}; {interpreter} -m unittest discover -v {args}'
 
diff -Nru dh-python-2.20170125/pybuild dh-python-2.20170125ubuntu1/pybuild
--- dh-python-2.20170125/pybuild	2017-01-25 11:29:41.000000000 +0000
+++ dh-python-2.20170125ubuntu1/pybuild	2017-11-15 10:09:23.000000000 +0000
@@ -407,6 +407,15 @@
     tests.add_argument('--test-tox', action='store_true',
                        default=environ.get('PYBUILD_TEST_TOX') == '1',
                        help='use tox in --test step')
+    tests.add_argument('--test-stestr', action='store_true',
+                       default=environ.get('PYBUILD_TEST_STESTR') == '1',
+                       help='use stestr in --test step')
+    tests.add_argument('--test-testr', action='store_true',
+                       default=environ.get('PYBUILD_TEST_TESTR') == '1',
+                       help='use testr in --test step')
+    tests.add_argument('--test-ostestr', action='store_true',
+                       default=environ.get('PYBUILD_TEST_OSTESTR') == '1',
+                       help='use ostestr in --test step')
 
     dirs = parser.add_argument_group('DIRECTORIES')
     dirs.add_argument('-d', '--dir', action='store', metavar='DIR',
@@ -454,6 +463,7 @@
         args.versions = versions
 
     if args.test_nose or args.test_pytest or args.test_tox\
+       or args.test_stestr or args.test_testr or args.test_ostestr\
        or args.system == 'custom':
         args.custom_tests = True
     else:
diff -Nru dh-python-2.20170125/pybuild.rst dh-python-2.20170125ubuntu1/pybuild.rst
--- dh-python-2.20170125/pybuild.rst	2016-06-17 21:05:56.000000000 +0100
+++ dh-python-2.20170125ubuntu1/pybuild.rst	2017-11-15 10:26:20.000000000 +0000
@@ -86,6 +86,16 @@
     --test-tox
         use tox command in test step, remember to add python-tox
         to Build-Depends. Requires tox.ini file
+    --test-stestr
+        use stestr command in test step, remember to add python-stestr and/or
+        python3-stestr to Build-Depends.
+    --test-testr
+        use testr command in test step, remember to add testrepository
+        to Build-Depends.
+    --test-ostestr
+        use ostestr command in test step, remember to add python-os-testr and/or
+        python3-os-testr to Build-Depends.
+
 
 BUILD SYSTEM ARGUMENTS
 ----------------------
Download as text