Source: python-qrcode Version: 7.4.2-2 Severity: serious -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA512
Dear maintainer, your package implicitly depends on python3-pkg-resources for its autopkgtest, which used to be provided through python3-pytest. However, pytest has dropped that dependency, breaking your autopkgtest and possibly your package. Note that pkg_resources is deprecated in favor of importlib.resources [1], which is part of the Python Standard Library and has better performance. Cheers Timo [1] https://docs.python.org/3/library/importlib.resources.html - --- Relevant excerpt from https://ci.debian.net/data/autopkgtest/testing/amd64/p/python-qrcode/35451521/log.gz 26s =================================== FAILURES =================================== 26s _________________________ ScriptTest.test_bad_factory __________________________ 26s 26s self = <tests.test_script.ScriptTest testMethod=test_bad_factory> 26s mock_stderr = <MagicMock name='stderr' id='140388587079440'> 26s 26s @mock.patch("sys.stderr") 26s def test_bad_factory(self, mock_stderr): 26s > self.assertRaises(SystemExit, main, "testtext --factory fish".split()) 26s 26s tests/test_script.py:68: 26s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 26s 26s def main(args=None): 26s if args is None: 26s args = sys.argv[1:] 26s > from pkg_resources import get_distribution 26s E ModuleNotFoundError: No module named 'pkg_resources' 26s 26s /usr/lib/python3/dist-packages/qrcode/console_scripts.py:43: ModuleNotFoundError 26s ___________________________ ScriptTest.test_factory ____________________________ 26s 26s self = <tests.test_script.ScriptTest testMethod=test_factory> 26s mock_stdout = <MagicMock name='stdout' id='140388582610896'> 26s 26s @mock.patch("sys.stdout") 26s def test_factory(self, mock_stdout): 26s > main("testtext --factory svg".split()) 26s 26s tests/test_script.py:64: 26s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 26s 26s args = ['testtext', '--factory', 'svg'] 26s 26s def main(args=None): 26s if args is None: 26s args = sys.argv[1:] 26s > from pkg_resources import get_distribution 26s E ModuleNotFoundError: No module named 'pkg_resources' 26s 26s /usr/lib/python3/dist-packages/qrcode/console_scripts.py:43: ModuleNotFoundError 26s ________________________ ScriptTest.test_factory_drawer ________________________ 26s 26s self = <tests.test_script.ScriptTest testMethod=test_factory_drawer> 26s mock_stderr = <_io.StringIO object at 0x7faec4596b90> 26s 26s @mock.patch("sys.stderr", new_callable=io.StringIO) 26s def test_factory_drawer(self, mock_stderr): 26s > main("testtext --factory svg --factory-drawer circle".split()) 26s 26s tests/test_script.py:98: 26s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 26s 26s args = ['testtext', '--factory', 'svg', '--factory-drawer', 'circle'] 26s 26s def main(args=None): 26s if args is None: 26s args = sys.argv[1:] 26s > from pkg_resources import get_distribution 26s E ModuleNotFoundError: No module named 'pkg_resources' 26s 26s /usr/lib/python3/dist-packages/qrcode/console_scripts.py:43: ModuleNotFoundError 26s ______________________ ScriptTest.test_factory_drawer_bad ______________________ 26s 26s self = <tests.test_script.ScriptTest testMethod=test_factory_drawer_bad> 26s mock_stderr = <_io.StringIO object at 0x7faec4b97e20> 26s 26s @mock.patch("sys.stderr", new_callable=io.StringIO) 26s def test_factory_drawer_bad(self, mock_stderr): 26s with self.assertRaises(SystemExit): 26s > main("testtext --factory svg --factory-drawer sobad".split()) 26s 26s tests/test_script.py:93: 26s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 26s 26s def main(args=None): 26s if args is None: 26s args = sys.argv[1:] 26s > from pkg_resources import get_distribution 26s E ModuleNotFoundError: No module named 'pkg_resources' 26s 26s /usr/lib/python3/dist-packages/qrcode/console_scripts.py:43: ModuleNotFoundError 26s _____________________ ScriptTest.test_factory_drawer_none ______________________ 26s 26s self = <tests.test_script.ScriptTest testMethod=test_factory_drawer_none> 26s mock_stderr = <_io.StringIO object at 0x7faec4595e10> 26s 26s @mock.patch("sys.stderr", new_callable=io.StringIO) 26s @unittest.skipIf(not Image, "Requires PIL") 26s def test_factory_drawer_none(self, mock_stderr): 26s with self.assertRaises(SystemExit): 26s > main("testtext --factory pil --factory-drawer nope".split()) 26s 26s tests/test_script.py:85: 26s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 26s 26s def main(args=None): 26s if args is None: 26s args = sys.argv[1:] 26s > from pkg_resources import get_distribution 26s E ModuleNotFoundError: No module named 'pkg_resources' 26s 26s /usr/lib/python3/dist-packages/qrcode/console_scripts.py:43: ModuleNotFoundError 26s ____________________________ ScriptTest.test_isatty ____________________________ 26s 26s self = <tests.test_script.ScriptTest testMethod=test_isatty> 26s mock_print_ascii = <MagicMock name='print_ascii' id='140388595588688'> 26s 26s @mock.patch("os.isatty", lambda *args: True) 26s @mock.patch("qrcode.main.QRCode.print_ascii") 26s def test_isatty(self, mock_print_ascii): 26s > main(["testtext"]) 26s 26s tests/test_script.py:26: 26s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 26s 26s args = ['testtext'] 26s 26s def main(args=None): 26s if args is None: 26s args = sys.argv[1:] 26s > from pkg_resources import get_distribution 26s E ModuleNotFoundError: No module named 'pkg_resources' 26s 26s /usr/lib/python3/dist-packages/qrcode/console_scripts.py:43: ModuleNotFoundError 26s ___________________________ ScriptTest.test_optimize ___________________________ 26s 26s self = <tests.test_script.ScriptTest testMethod=test_optimize> 26s mock_print_ascii = <MagicMock name='print_ascii' id='140388586972624'> 26s 26s @mock.patch("os.isatty", lambda *args: True) 26s @mock.patch("qrcode.main.QRCode.print_ascii") 26s def test_optimize(self, mock_print_ascii): 26s > main("testtext --optimize 0".split()) 26s 26s tests/test_script.py:60: 26s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 26s 26s args = ['testtext', '--optimize', '0'] 26s 26s def main(args=None): 26s if args is None: 26s args = sys.argv[1:] 26s > from pkg_resources import get_distribution 26s E ModuleNotFoundError: No module named 'pkg_resources' 26s 26s /usr/lib/python3/dist-packages/qrcode/console_scripts.py:43: ModuleNotFoundError 26s ____________________________ ScriptTest.test_output ____________________________ 26s 26s self = <tests.test_script.ScriptTest testMethod=test_output> 26s 26s @unittest.skipIf(not Image, "Requires PIL") 26s def test_output(self): 26s tmpfile = os.path.join(self.tmpdir, "test.png") 26s > main(["testtext", "--output", tmpfile]) 26s 26s tests/test_script.py:78: 26s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 26s 26s args = ['testtext', '--output', '/tmp/tmpboq4w331/test.png'] 26s 26s def main(args=None): 26s if args is None: 26s args = sys.argv[1:] 26s > from pkg_resources import get_distribution 26s E ModuleNotFoundError: No module named 'pkg_resources' 26s 26s /usr/lib/python3/dist-packages/qrcode/console_scripts.py:43: ModuleNotFoundError 26s ____________________________ ScriptTest.test_piped _____________________________ 26s 26s self = <tests.test_script.ScriptTest testMethod=test_piped> 26s mock_stdout = <MagicMock name='stdout' id='140388595296208'> 26s 26s @mock.patch("os.isatty", lambda *args: False) 26s @mock.patch("sys.stdout") 26s @unittest.skipIf(not Image, "Requires PIL") 26s def test_piped(self, mock_stdout): 26s > main(["testtext"]) 26s 26s tests/test_script.py:33: 26s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 26s 26s args = ['testtext'] 26s 26s def main(args=None): 26s if args is None: 26s args = sys.argv[1:] 26s > from pkg_resources import get_distribution 26s E ModuleNotFoundError: No module named 'pkg_resources' 26s 26s /usr/lib/python3/dist-packages/qrcode/console_scripts.py:43: ModuleNotFoundError 26s ____________________________ ScriptTest.test_stdin _____________________________ 26s 26s self = <tests.test_script.ScriptTest testMethod=test_stdin> 26s mock_stdin = <MagicMock name='stdin' id='140388582197840'> 26s mock_print_ascii = <MagicMock name='print_ascii' id='140388582198160'> 26s 26s @mock.patch("os.isatty", lambda *args: True) 26s @mock.patch("qrcode.main.QRCode.print_ascii") 26s @mock.patch("sys.stdin") 26s def test_stdin(self, mock_stdin, mock_print_ascii): 26s mock_stdin.buffer.read.return_value = "testtext" 26s > main([]) 26s 26s tests/test_script.py:40: 26s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 26s 26s args = [] 26s 26s def main(args=None): 26s if args is None: 26s args = sys.argv[1:] 26s > from pkg_resources import get_distribution 26s E ModuleNotFoundError: No module named 'pkg_resources' 26s 26s /usr/lib/python3/dist-packages/qrcode/console_scripts.py:43: ModuleNotFoundError 26s _________________ ScriptTest.test_stdin_py3_unicodedecodeerror _________________ 26s 26s self = <tests.test_script.ScriptTest testMethod=test_stdin_py3_unicodedecodeerror> 26s mock_print_ascii = <MagicMock name='print_ascii' id='140388595637776'> 26s 26s @mock.patch("os.isatty", lambda *args: True) 26s @mock.patch("qrcode.main.QRCode.print_ascii") 26s def test_stdin_py3_unicodedecodeerror(self, mock_print_ascii): 26s mock_stdin = mock.Mock(sys.stdin) 26s mock_stdin.buffer.read.return_value = "testtext" 26s mock_stdin.read.side_effect = bad_read 26s with mock.patch("sys.stdin", mock_stdin): 26s # sys.stdin.read() will raise an error... 26s self.assertRaises(UnicodeDecodeError, sys.stdin.read) 26s # ... but it won't be used now. 26s > main([]) 26s 26s tests/test_script.py:54: 26s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 26s 26s args = [] 26s 26s def main(args=None): 26s if args is None: 26s args = sys.argv[1:] 26s > from pkg_resources import get_distribution 26s E ModuleNotFoundError: No module named 'pkg_resources' 26s 26s /usr/lib/python3/dist-packages/qrcode/console_scripts.py:43: ModuleNotFoundError 26s ___________________________ ScriptTest.test_sys_argv ___________________________ 26s 26s self = <tests.test_script.ScriptTest testMethod=test_sys_argv> 26s 26s @mock.patch.object(sys, "argv", "qr testtext output".split()) 26s @unittest.skipIf(not Image, "Requires PIL") 26s def test_sys_argv(self): 26s > main() 26s 26s tests/test_script.py:73: 26s _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 26s 26s args = ['testtext', 'output'] 26s 26s def main(args=None): 26s if args is None: 26s args = sys.argv[1:] 26s > from pkg_resources import get_distribution 26s E ModuleNotFoundError: No module named 'pkg_resources' -----BEGIN PGP SIGNATURE----- iQGzBAEBCgAdFiEEJvtDgpxjkjCIVtam+C8H+466LVkFAmSoT7UACgkQ+C8H+466 LVlixQwAgn8yRZzZjhkQDlNx87kVePfiK+M7w3fZKERWs1Ua2ge+D276drHB6Q+c ZQ8Y6idHoM762wUQ6EaiDfPauUmz6bIbx0uOLASaSACKr4gNxndMq6nVHg2rJSp4 UIBNepaXvEu56MsshnhWW8DIw8ptKspb23Jqqb3r6jJqrdRfAxNuLuC+5jVuS786 w27Ncw7P3Tr3qxYDSLlDY/TIsHlLVsljRtKUEboyK3vW7gW/mFJ/YADIAPja6Nft 9Z3kKV9UVOUiUoElLO9O+9ehr55ItRqyFXdntJs2QCn41BqZT+4l/Oj5VaLqNrQQ QuCAXfKOBqnnDjZoVobUPdo8YhPZBkw0qvp/dOCaY8F4AUK9XeneFCEUr12cVTC9 uMR5FB1BEjKtd7wxfp78NDhzEvd2x9KSAVuxkBo4kaZcYFsm13j6EN+iX9eo0di/ MU/TorLPRix1Z1sm/ac8z7PGL7QXK+/+rLFUUum3ME5hjFYyUu9UYO1MuswgRrnJ Dnxnnr7h =fVbd -----END PGP SIGNATURE-----