Source: python-libcst
Version: 1.8.6-2
Severity: important
Tags: patch
User: [email protected]
Usertags: annotate-snippets-0.12
X-Debbugs-Cc: [email protected]

Dear maintainer,

I am preparing a rust-annotate-snippets transition to 0.12, which will likely 
be uploaded in the coming days.

python-libcst depends on annotate-snippets 0.11, so it needs a dependency bump 
and a small port.

I have attached a debdiff fixing this.

Best regards,
Simon Quigley
[email protected]
diff -Nru python-libcst-1.8.6/debian/changelog 
python-libcst-1.8.6/debian/changelog
--- python-libcst-1.8.6/debian/changelog        2026-04-18 19:52:06.000000000 
-0500
+++ python-libcst-1.8.6/debian/changelog        2026-08-20 11:05:40.000000000 
-0500
@@ -1,3 +1,10 @@
+python-libcst (1.8.6-2.1) UNRELEASED; urgency=medium
+
+  * Non-maintainer upload.
+  * Add annotate-snippets-0.12.patch to port to annotate-snippets 0.12.
+
+ -- Simon Quigley <[email protected]>  Thu, 20 Aug 2026 11:05:40 -0500
+
 python-libcst (1.8.6-2) unstable; urgency=medium
 
   [ Carl Keinath ]
diff -Nru python-libcst-1.8.6/debian/control python-libcst-1.8.6/debian/control
--- python-libcst-1.8.6/debian/control  2026-04-18 19:52:06.000000000 -0500
+++ python-libcst-1.8.6/debian/control  2026-08-20 11:01:00.000000000 -0500
@@ -22,7 +22,7 @@
                python3-wheel,
                python3-yaml (>= 5.2),
                rustc:native (>= 1.70),
-               librust-annotate-snippets-0.11+default-dev (>= 0.11.5),
+               librust-annotate-snippets-0.12+default-dev,
                librust-libcst-derive-1+default-dev (>= 1.8.6-~~),
                librust-memchr-2+default-dev (>= 2.7.4),
                librust-paste-1+default-dev (>= 1.0.15),
diff -Nru python-libcst-1.8.6/debian/patches/annotate-snippets-0.12.patch 
python-libcst-1.8.6/debian/patches/annotate-snippets-0.12.patch
--- python-libcst-1.8.6/debian/patches/annotate-snippets-0.12.patch     
1969-12-31 18:00:00.000000000 -0600
+++ python-libcst-1.8.6/debian/patches/annotate-snippets-0.12.patch     
2026-08-20 11:05:40.000000000 -0500
@@ -0,0 +1,64 @@
+Description: Relax annotate-snippets to 0.12
+Author: Simon Quigley <[email protected]>
+Origin: vendor
+Forwarded: no
+Last-Update: 2026-08-20
+---
+This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
+--- a/native/libcst/Cargo.toml
++++ b/native/libcst/Cargo.toml
+@@ -39,7 +39,7 @@ paste = "1.0.15"
+ pyo3 = { version = "0.28", optional = true }
+ thiserror = "2.0.12"
+ peg = "0.8.5"
+-annotate-snippets = "0.11.5"
++annotate-snippets = "0.12"
+ regex = "1.11.2"
+ memchr = "2.7.4"
+ libcst_derive = { path = "../libcst_derive", version = "1.8.6" }
+--- a/native/libcst/src/lib.rs
++++ b/native/libcst/src/lib.rs
+@@ -91,7 +91,7 @@ fn bol_offset(source: &str, n: i32) -> u
+ pub fn prettify_error(err: ParserError, label: &str) -> std::string::String {
+     match err {
+         ParserError::ParserError(e, module_text) => {
+-            use annotate_snippets::{Level, Renderer, Snippet};
++            use annotate_snippets::{AnnotationKind, Level, Renderer, Snippet};
+ 
+             let loc = e.location;
+             let context = 1;
+@@ -113,17 +113,23 @@ pub fn prettify_error(err: ParserError,
+                 end
+             };
+             Renderer::styled()
+-                .render(
+-                    Level::Error.title(label).snippet(
+-                        Snippet::source(source)
+-                            .line_start(line_start)
+-                            .fold(false)
+-                            
.annotations(vec![Level::Error.span(start..end).label(&format!(
+-                                "expected {} {} -> {}",
+-                                e.expected, loc.start_pos, loc.end_pos
+-                            ))]),
+-                    ),
+-                )
++                .render(&[
++                    Level::ERROR
++                        .primary_title(label)
++                        .element(
++                            Snippet::source(source)
++                                .line_start(line_start)
++                                .fold(false)
++                                .annotations(vec![
++                                    AnnotationKind::Primary
++                                        .span(start..end)
++                                        .label(&format!(
++                                            "expected {} {} -> {}",
++                                            e.expected, loc.start_pos, 
loc.end_pos
++                                        )),
++                                ]),
++                        ),
++                ])
+                 .to_string()
+         }
+         e => format!("Parse error for {}: {}", label, e),
diff -Nru python-libcst-1.8.6/debian/patches/series 
python-libcst-1.8.6/debian/patches/series
--- python-libcst-1.8.6/debian/patches/series   2026-04-18 19:52:06.000000000 
-0500
+++ python-libcst-1.8.6/debian/patches/series   2026-08-20 11:01:21.000000000 
-0500
@@ -2,3 +2,4 @@
 chic-api
 Cargo.toml-Relax-criterion-to-0.5.1.patch
 pyo3-0.28
+annotate-snippets-0.12.patch

Attachment: OpenPGP_signature.asc
Description: OpenPGP digital signature

Reply via email to