diff -Nru python-distutils-extra-2.44/debian/changelog python-distutils-extra-2.45/debian/changelog --- python-distutils-extra-2.44/debian/changelog 2020-03-27 14:04:30.000000000 +0000 +++ python-distutils-extra-2.45/debian/changelog 2020-06-21 19:37:06.000000000 +0000 @@ -1,3 +1,20 @@ +python-distutils-extra (2.45) unstable; urgency=medium + + [ Michał Górny ] + * Run unittest.main() only when running script directly. + * test: Find .egg-info file rather than guessing path (wrong) + This fixes the test failure due to looking for wrong .egg-info filename, + in the top directory rather than site-packages. + * Fix install_auto command with --skip-build + python-distutils-extra seems to rely on a very bad practice of modifying + internal state (file lists) in middle of `build` commands. As a result, + if the package is installed via `build` command followed by `install + --skip-build` (since everything was built already!), most of the files + are not installed. + * Unset environment variables that break tests + + -- Martin Pitt Sun, 21 Jun 2020 21:37:06 +0200 + python-distutils-extra (2.44) unstable; urgency=medium [ Debian Janitor ] diff -Nru python-distutils-extra-2.44/DistUtilsExtra/auto.py python-distutils-extra-2.45/DistUtilsExtra/auto.py --- python-distutils-extra-2.44/DistUtilsExtra/auto.py 2020-03-27 14:04:30.000000000 +0000 +++ python-distutils-extra-2.45/DistUtilsExtra/auto.py 2020-06-21 19:35:37.000000000 +0000 @@ -711,6 +711,13 @@ class install_auto(distutils.command.install.install): def run(self): + # run build_* subcommands to get file lists if install command + # won't run 'build' for us + if self.skip_build: + self.run_command('build_help') + self.run_command('build_i18n') + self.run_command('build_icons') + # install files from etc/ if os.path.isdir('etc'): # work around a bug in copy_tree() which fails with "File exists" on diff -Nru python-distutils-extra-2.44/test/auto.py python-distutils-extra-2.45/test/auto.py --- python-distutils-extra-2.44/test/auto.py 2020-03-27 14:04:30.000000000 +0000 +++ python-distutils-extra-2.45/test/auto.py 2020-06-21 19:35:37.000000000 +0000 @@ -734,7 +734,9 @@ # parse .egg-info (o, e, s) = self.setup_py(['install_egg_info', '-d', self.install_tree]) self.assertEqual(e, 'ERROR: Python module unknown not found\n') - egg = self._installed_contents('foo-0.1.egg-info').splitlines() + egg_paths = [x for x in inst if x.endswith('.egg-info')] + self.assertEqual(len(egg_paths), 1) + egg = self._installed_contents(egg_paths[0].strip(os.path.sep)).splitlines() self.assertIn('Name: foo', egg) # check provides @@ -856,6 +858,9 @@ env['PYTHONPATH'] = oldcwd + os.pathsep + env['PYTHONPATH'] else: env['PYTHONPATH'] = oldcwd + # unset envvars that alter results + env.pop('LINGUAS', '') + env.pop('PYTHONDONTWRITEBYTECODE', '') os.chdir(self.src) s = subprocess.Popen(['/proc/self/exe', 'setup.py'] + args, env=env, stdout=subprocess.PIPE, stderr=subprocess.PIPE) @@ -873,8 +878,9 @@ ''' self.install_tree = tempfile.mkdtemp() - return self.setup_py(['install', '--no-compile', '--prefix=/usr', - '--root=' + self.install_tree]) + self.setup_py(['build']) + return self.setup_py(['install', '--no-compile', '--skip-build', + '--prefix=/usr', '--root=' + self.install_tree]) def installed_files(self): '''Return list of file paths in install tree.''' @@ -1029,4 +1035,6 @@ f.close() return contents -unittest.main() + +if __name__ == '__main__': + unittest.main()