aboutcode-org / aboutcode-org/scancode-toolkit

Fix warnings in tests

未关闭
#2,711 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
主要语言
Python
星标
2.6k
派生
791
平均合并
1 天 12 小时
30 天内合并 PR
5

描述

A test run will yield this
> =============================== warnings summary ===============================
> lib/python3.6/site-packages/parameter_expansion/__init__.py:40
> lib/python3.6/site-packages/parameter_expansion/__init__.py:40
> lib/python3.6/site-packages/parameter_expansion/__init__.py:40
> /home/sctk/lib/python3.6/site-packages/parameter_expansion/__init__.py:40: UserWarning: Unable to determine version for parameter_expansion. Falling back to 0.0.0+unknown
> f"Unable to determine version for {name}. Falling back to {_default_version}"
>
> src/textcode/strings2.py:27
> /home/sctk/src/textcode/strings2.py:27: DeprecationWarning: invalid escape sequence \$
> " !\"#\$%&\'\(\)\*\+,-\./0123456789:;<=>\?@ABCDEFGHIJKLMNOPQRSTUVWXYZ"
>
> src/textcode/strings2.py:28
> /home/sctk/src/textcode/strings2.py:28: DeprecationWarning: invalid escape sequence \[
> "\[\]\^_`abcdefghijklmnopqrstuvwxyz\{\|\}\\\~\t"
>
> lib/python3.6/site-packages/patch.py:340
> /home/sctk/lib/python3.6/site-packages/patch.py:340: DeprecationWarning: invalid escape sequence \d
> re_hunk_start = re.compile(b"^@@ -(\d+)(,(\d+))? \+(\d+)(,(\d+))? @@")
>
> lib/python3.6/site-packages/patch.py:519
> /home/sctk/lib/python3.6/site-packages/patch.py:519: DeprecationWarning: invalid escape sequence \+
> re_filename = b"^\+\+\+ ([^\t]+)"
>
> lib/python3.6/site-packages/patch.py:545
> /home/sctk/lib/python3.6/site-packages/patch.py:545: DeprecationWarning: invalid escape sequence \d
> match = re.match(b"^@@ -(\d+)(,(\d+))? \+(\d+)(,(\d+))? @@(.*)", line)
>
> lib/python3.6/site-packages/dparse/regex.py:10
> /home/sctk/lib/python3.6/site-packages/dparse/regex.py:10: DeprecationWarning: invalid escape sequence \S
> "(?:\S+(?::\S*)?@)?"
>
> lib/python3.6/site-packages/dparse/regex.py:14
> /home/sctk/lib/python3.6/site-packages/dparse/regex.py:14: DeprecationWarning: invalid escape sequence \.
> "(?!(?:10|127)(?:\.\d{1,3}){3})"
>
> lib/python3.6/site-packages/dparse/regex.py:15
> /home/sctk/lib/python3.6/site-packages/dparse/regex.py:15: DeprecationWarning: invalid escape sequence \.
> "(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})"
>
> lib/python3.6/site-packages/dparse/regex.py:16
> /home/sctk/lib/python3.6/site-packages/dparse/regex.py:16: DeprecationWarning: invalid escape sequence \.
> "(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})"
>
> lib/python3.6/site-packages/dparse/regex.py:22
> /home/sctk/lib/python3.6/site-packages/dparse/regex.py:22: DeprecationWarning: invalid escape sequence \d
> "(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])"
>
> lib/python3.6/site-packages/dparse/regex.py:23
> /home/sctk/lib/python3.6/site-packages/dparse/regex.py:23: DeprecationWarning: invalid escape sequence \.
> "(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}"
>
> lib/python3.6/site-packages/dparse/regex.py:24
> /home/sctk/lib/python3.6/site-packages/dparse/regex.py:24: DeprecationWarning: invalid escape sequence \.
> "(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))"
>
> lib/python3.6/site-packages/dparse/regex.py:29
> /home/sctk/lib/python3.6/site-packages/dparse/regex.py:29: DeprecationWarning: invalid escape sequence \.
> "(?:\.(?:[a-z\u00a1-\uffff0-9]-?)*[a-z\u00a1-\uffff0-9]+)*"
>
> lib/python3.6/site-packages/dparse/regex.py:31
> /home/sctk/lib/python3.6/site-packages/dparse/regex.py:31: DeprecationWarning: invalid escape sequence \.
> "(?:\.(?:[a-z\u00a1-\uffff]{2,}))"
>
> lib/python3.6/site-packages/dparse/regex.py:34
> /home/sctk/lib/python3.6/site-packages/dparse/regex.py:34: DeprecationWarning: invalid escape sequence \d
> "(?::\d{2,5})?"
>
> lib/python3.6/site-packages/dparse/regex.py:36
> /home/sctk/lib/python3.6/site-packages/dparse/regex.py:36: DeprecationWarning: invalid escape sequence \S
> "(?:/\S*)?",
>
> tests/formattedcode/test_output_spdx.py: 14 warnings
> tests/formattedcode/test_reuse_output_plugins.py: 2 warnings
> /home/sctk/lib/python3.6/site-packages/spdx/document.py:365: DeprecationWarning: document.package and document.files are deprecated; use document.packages instead
> DeprecationWarning)
>
> tests/formattedcode/test_output_spdx.py: 28 warnings
> tests/formattedcode/test_reuse_output_plugins.py: 4 warnings
> /home/sctk/lib/python3.6/site-packages/spdx/document.py:355: DeprecationWarning: document.package and document.files are deprecated; use document.packages instead
> DeprecationWarning)
>
> tests/formattedcode/test_output_spdx.py::test_spdx_rdf_with_license_ref_with_text
> /home/sctk/lib/python3.6/site-packages/rdflib/compat.py:118: DeprecationWarning: invalid escape sequence \
> """
>
> tests/formattedcode/test_output_spdx.py::test_spdx_rdf_with_license_ref_with_text
> /home/sctk/lib/python3.6/site-packages/rdflib/paths.py:186: DeprecationWarning: invalid escape sequence \
> """
>
> tests/packagedcode/test_pubspec.py::TestPubspecDatadriven::test_pubspec_lockdart_pubspec_lock
> /home/sctk/src/packagedcode/pubspec.py:229: UserWarning: Dart pubspec.locks with unsupported external repo description or source: {'dependency': 'direct main', 'description': {'path': '../pub_dartdoc_data', 'relative': True}, 'source': 'path', 'version': '0.0.0'}
> stacklevel=1,
>
> tests/packagedcode/test_rpm_installed.py::TestRpmInstalled::test_collect_installed_rpmdb_xmlish_from_rootfs
> /home/sctk/src/packagedcode/rpm_installed.py:439: DeprecationWarning: commoncode.command.execute2 is deprecated. Use execute() instead.
> to_files=True,
>
> tests/summarycode/test_plugin_consolidate.py::TestConsolidate::test_consolidate_package
> tests/summarycode/test_plugin_consolidate.py::TestConsolidate::test_consolidate_e2fsprogs
> /home/sctk/lib/python3.6/site-packages/fingerprints/cleanup.py:54: ICUWarning: Install 'pyicu' for better text transliteration.
> text = ascii_text(text)
>
> -- Docs: https://docs.pytest.org/en/stable/warnings.html
> =========================== short test summary info ============================

贡献指南

打开贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。