From: Patrick Steinhardt <ps@pks.im>
To: git@vger.kernel.org
Subject: [PATCH 4/4] ci/test-documentation: work around SyntaxWarning in Python 3.12
Date: Wed, 5 Jun 2024 07:17:01 +0200 [thread overview]
Message-ID: <c758b45282f8eb5fec401da6021d7ded6cebb243.1717564310.git.ps@pks.im> (raw)
In-Reply-To: <cover.1717564310.git.ps@pks.im>
[-- Attachment #1: Type: text/plain, Size: 2027 bytes --]
In Python 3.6, unrecognized escape sequences in regular expressions
started to produce a DeprecationWarning [1]. In Python 3.12, this was
upgraded to a SyntaxWarning and will eventually be raised even further
to a SyntaxError. We indirectly hit such unrecognized escape sequences
via Asciidoc, which results in a bunch of warnings:
$ asciidoc -o /dev/null git-cat-file.txt
<unknown>:1: SyntaxWarning: invalid escape sequence '\S'
<unknown>:1: SyntaxWarning: invalid escape sequence '\S'
This in turn causes our "ci/test-documentation.sh" script to fail, as it
checks that stderr of `make doc` is empty.
These escape sequences seem to be part of Asciidoc itself. In the long
term, we should probably consider dropping support for Asciidoc in favor
of Asciidoctor. Upstream also considers itself to be legacy software and
recommends to move away from it [2]:
It is suggested that unless you specifically require the AsciiDoc.py
toolchain, you should find a processor that handles the modern
AsciiDoc syntax.
For now though, let's expand its lifetime a little bit more by filtering
out these new warnings. We should probably reconsider once the warnings
are upgraded to errors by Python.
[1]: https://docs.python.org/3/reference/lexical_analysis.html#string-and-bytes-literals
[2]: https://github.com/asciidoc-py/asciidoc-py/blob/6d9f76cff0dc3b7ca21bdd570200f8518464d99b/README.md#asciidocpy
Signed-off-by: Patrick Steinhardt <ps@pks.im>
---
ci/test-documentation.sh | 1 +
1 file changed, 1 insertion(+)
diff --git a/ci/test-documentation.sh b/ci/test-documentation.sh
index de41888430..02b3af3941 100755
--- a/ci/test-documentation.sh
+++ b/ci/test-documentation.sh
@@ -11,6 +11,7 @@ filter_log () {
-e '/^ \* new asciidoc flags$/d' \
-e '/stripped namespace before processing/d' \
-e '/Attributed.*IDs for element/d' \
+ -e '/SyntaxWarning: invalid escape sequence/d' \
"$1"
}
--
2.45.2.409.g7b0defb391.dirty
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
next prev parent reply other threads:[~2024-06-05 5:17 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-06-05 5:16 [PATCH 0/4] Documentation: improve linting of manpage existence Patrick Steinhardt
2024-06-05 5:16 ` [PATCH 1/4] Makefile: extract script to lint missing/extraneous manpages Patrick Steinhardt
2024-06-05 5:20 ` Junio C Hamano
2024-06-05 5:27 ` Patrick Steinhardt
2024-06-06 6:03 ` James Liu
2024-06-06 6:12 ` Junio C Hamano
2024-06-05 5:16 ` [PATCH 2/4] Documentation/lint-manpages: bubble up errors Patrick Steinhardt
2024-06-05 5:22 ` Junio C Hamano
2024-06-05 5:16 ` [PATCH 3/4] gitlab-ci: add job to run `make check-docs` Patrick Steinhardt
2024-06-05 5:17 ` Patrick Steinhardt [this message]
2024-06-05 5:24 ` [PATCH 4/4] ci/test-documentation: work around SyntaxWarning in Python 3.12 Junio C Hamano
2024-06-06 8:00 ` [PATCH v2 0/4] Documentation: improve linting for manpage existence Patrick Steinhardt
2024-06-06 8:01 ` [PATCH v2 1/4] Makefile: extract script to lint missing/extraneous manpages Patrick Steinhardt
2024-06-07 16:51 ` Junio C Hamano
2024-06-06 8:01 ` [PATCH v2 2/4] Documentation/lint-manpages: bubble up errors Patrick Steinhardt
2024-06-06 8:01 ` [PATCH v2 3/4] gitlab-ci: add job to run `make check-docs` Patrick Steinhardt
2024-06-06 8:01 ` [PATCH v2 4/4] ci/test-documentation: work around SyntaxWarning in Python 3.12 Patrick Steinhardt
2024-06-07 0:59 ` [PATCH v2 0/4] Documentation: improve linting for manpage existence James Liu
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=c758b45282f8eb5fec401da6021d7ded6cebb243.1717564310.git.ps@pks.im \
--to=ps@pks.im \
--cc=git@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).