From 1195359a9094681de0e7d6959b534cab28df75a2 Mon Sep 17 00:00:00 2001 From: donbarbos Date: Tue, 5 May 2026 00:20:51 +0400 Subject: [PATCH 1/2] [reportlab] Update to 4.5.0 Closes: #15686 Diff: https://github.com/MrBitBucket/reportlab-mirror/compare/b6879c88a6c3a86d2bd4074de50037718ba59733...35c1b5bb90722b75ae75f11f283b2a6f642378f9 --- stubs/reportlab/METADATA.toml | 2 +- .../reportlab/graphics/transform.pyi | 2 + stubs/reportlab/reportlab/lib/colors.pyi | 3 +- stubs/reportlab/reportlab/lib/extformat.pyi | 9 ---- .../reportlab/reportlab/pdfbase/acroform.pyi | 43 +++++++++++-------- 5 files changed, 29 insertions(+), 30 deletions(-) delete mode 100644 stubs/reportlab/reportlab/lib/extformat.pyi diff --git a/stubs/reportlab/METADATA.toml b/stubs/reportlab/METADATA.toml index d2708fba9e5f..331cc235f449 100644 --- a/stubs/reportlab/METADATA.toml +++ b/stubs/reportlab/METADATA.toml @@ -1,4 +1,4 @@ -version = "4.4.10" +version = "4.5.0" # GitHub mirror of https://hg.reportlab.com/hg-public/reportlab/file upstream-repository = "https://github.com/MrBitBucket/reportlab-mirror" diff --git a/stubs/reportlab/reportlab/graphics/transform.pyi b/stubs/reportlab/reportlab/graphics/transform.pyi index b8b8b59c9950..820531addd22 100644 --- a/stubs/reportlab/reportlab/graphics/transform.pyi +++ b/stubs/reportlab/reportlab/graphics/transform.pyi @@ -5,6 +5,7 @@ def rotate(angle: float, cx: float = 0, cy: float = 0): ... def skewX(angle: float): ... def skewY(angle: float): ... def mmult(A, B): ... +def combineTransforms(*T): ... def inverse(A): ... def zTransformPoint(A, v): ... def transformPoint(A, v): ... @@ -19,6 +20,7 @@ __all__ = ( "skewX", "skewY", "mmult", + "combineTransforms", "inverse", "zTransformPoint", "transformPoint", diff --git a/stubs/reportlab/reportlab/lib/colors.pyi b/stubs/reportlab/reportlab/lib/colors.pyi index 362233967f88..febec8a47e71 100644 --- a/stubs/reportlab/reportlab/lib/colors.pyi +++ b/stubs/reportlab/reportlab/lib/colors.pyi @@ -290,9 +290,10 @@ def hue2rgb(m1: float, m2: float, h: float) -> float: ... def hsl2rgb(h: float, s: float, l: float) -> tuple[float, float, float]: ... @type_check_only class _cssParse: - def pcVal(self, v: str) -> float: ... + def pcVal(self, v: str, n: str = "argument") -> float: ... def rgbPcVal(self, v: str) -> float: ... def rgbVal(self, v: str) -> float: ... + def floatVal(self, v: str) -> float: ... def hueVal(self, v: str) -> float: ... def alphaVal(self, v: str, c: float = 1, n: str = "alpha") -> float: ... s: str diff --git a/stubs/reportlab/reportlab/lib/extformat.pyi b/stubs/reportlab/reportlab/lib/extformat.pyi deleted file mode 100644 index 4d9f857e35f8..000000000000 --- a/stubs/reportlab/reportlab/lib/extformat.pyi +++ /dev/null @@ -1,9 +0,0 @@ -from collections.abc import Mapping -from typing import Any, Final - -__version__: Final[str] - -def dictformat( - _format: str, L: Mapping[str, object] | None = {}, G: dict[str, Any] | None = {} # `L` and `G` are passed to `eval` function -) -> str: ... -def magicformat(format: str) -> str: ... diff --git a/stubs/reportlab/reportlab/pdfbase/acroform.pyi b/stubs/reportlab/reportlab/pdfbase/acroform.pyi index d183e55f0c73..4ecc91cd7a35 100644 --- a/stubs/reportlab/reportlab/pdfbase/acroform.pyi +++ b/stubs/reportlab/reportlab/pdfbase/acroform.pyi @@ -1,6 +1,7 @@ from _typeshed import Incomplete from weakref import ReferenceType +from reportlab.lib.colors import Color from reportlab.pdfbase.pdfdoc import PDFDictionary, PDFObject, PDFStream __all__ = ("AcroForm",) @@ -36,6 +37,8 @@ class AcroForm(PDFObject): extras: dict[Incomplete, Incomplete] def __init__(self, canv, **kwds) -> None: ... @property + def useDefault(self) -> object: ... + @property def canv(self) -> ReferenceType[Incomplete]: ... def fontRef(self, f) -> str: ... def format(self, doc) -> bytes: ... @@ -51,7 +54,7 @@ class AcroForm(PDFObject): fillColor=None, borderColor=None, textColor=None, - borderWidth: int = 1, + borderWidth: int | None = None, borderStyle: str = "solid", size: int = 20, dashLen: int = 3, @@ -61,8 +64,10 @@ class AcroForm(PDFObject): def zdMark(self, c, size, ds, iFontName) -> str: ... def getRef(self, obj): ... def getRefStr(self, obj) -> str: ... - @staticmethod - def stdColors(t, b, f) -> tuple[Incomplete, Incomplete, Incomplete]: ... + def setDefault(self, name: str, value: Color | float | None) -> None: ... + def getDefaults( + self, textColor, borderColor, fillColor, borderWidth + ) -> tuple[Incomplete, Incomplete, Incomplete, Incomplete]: ... @staticmethod def varyColors(key, t, b, f) -> tuple[Incomplete, Incomplete, Incomplete]: ... def checkForceBorder( @@ -73,9 +78,9 @@ class AcroForm(PDFObject): checked: bool = False, buttonStyle: str = "check", shape: str = "square", - fillColor=None, - borderColor=None, - textColor=None, + fillColor=..., + borderColor=..., + textColor=..., borderWidth: int = 1, borderStyle: str = "solid", size: int = 20, @@ -95,9 +100,9 @@ class AcroForm(PDFObject): selected: bool = False, buttonStyle: str = "circle", shape: str = "circle", - fillColor=None, - borderColor=None, - textColor=None, + fillColor=..., + borderColor=..., + textColor=..., borderWidth: int = 1, borderStyle: str = "solid", size: int = 20, @@ -123,7 +128,7 @@ class AcroForm(PDFObject): fillColor=None, borderColor=None, textColor=None, - borderWidth: int = 1, + borderWidth: int | None = None, borderStyle: str = "solid", width: int = 120, height: int = 36, @@ -138,9 +143,9 @@ class AcroForm(PDFObject): def textfield( self, value: str = "", - fillColor=None, - borderColor=None, - textColor=None, + fillColor=..., + borderColor=..., + textColor=..., borderWidth: int = 1, borderStyle: str = "solid", width: int = 120, @@ -161,9 +166,9 @@ class AcroForm(PDFObject): def listbox( self, value: str = "", - fillColor=None, - borderColor=None, - textColor=None, + fillColor=..., + borderColor=..., + textColor=..., borderWidth: int = 1, borderStyle: str = "solid", width: int = 120, @@ -185,9 +190,9 @@ class AcroForm(PDFObject): def choice( self, value: str = "", - fillColor=None, - borderColor=None, - textColor=None, + fillColor=..., + borderColor=..., + textColor=..., borderWidth: int = 1, borderStyle: str = "solid", width: int = 120, From d6c9e53996b8c60c998c1c1d38ad6e46374ec24d Mon Sep 17 00:00:00 2001 From: donbarbos Date: Tue, 5 May 2026 00:35:08 +0400 Subject: [PATCH 2/2] back `extformat` --- stubs/reportlab/reportlab/lib/extformat.pyi | 9 ++++ .../reportlab/reportlab/pdfbase/acroform.pyi | 50 +++++++++---------- 2 files changed, 34 insertions(+), 25 deletions(-) create mode 100644 stubs/reportlab/reportlab/lib/extformat.pyi diff --git a/stubs/reportlab/reportlab/lib/extformat.pyi b/stubs/reportlab/reportlab/lib/extformat.pyi new file mode 100644 index 000000000000..4d9f857e35f8 --- /dev/null +++ b/stubs/reportlab/reportlab/lib/extformat.pyi @@ -0,0 +1,9 @@ +from collections.abc import Mapping +from typing import Any, Final + +__version__: Final[str] + +def dictformat( + _format: str, L: Mapping[str, object] | None = {}, G: dict[str, Any] | None = {} # `L` and `G` are passed to `eval` function +) -> str: ... +def magicformat(format: str) -> str: ... diff --git a/stubs/reportlab/reportlab/pdfbase/acroform.pyi b/stubs/reportlab/reportlab/pdfbase/acroform.pyi index 4ecc91cd7a35..aa8f2288ac84 100644 --- a/stubs/reportlab/reportlab/pdfbase/acroform.pyi +++ b/stubs/reportlab/reportlab/pdfbase/acroform.pyi @@ -81,7 +81,7 @@ class AcroForm(PDFObject): fillColor=..., borderColor=..., textColor=..., - borderWidth: int = 1, + borderWidth: int = ..., borderStyle: str = "solid", size: int = 20, x: int = 0, @@ -103,7 +103,7 @@ class AcroForm(PDFObject): fillColor=..., borderColor=..., textColor=..., - borderWidth: int = 1, + borderWidth: int = ..., borderStyle: str = "solid", size: int = 20, x: int = 0, @@ -146,7 +146,7 @@ class AcroForm(PDFObject): fillColor=..., borderColor=..., textColor=..., - borderWidth: int = 1, + borderWidth: int = ..., borderStyle: str = "solid", width: int = 120, height: int = 36, @@ -169,7 +169,7 @@ class AcroForm(PDFObject): fillColor=..., borderColor=..., textColor=..., - borderWidth: int = 1, + borderWidth: int = ..., borderStyle: str = "solid", width: int = 120, height: int = 36, @@ -193,7 +193,7 @@ class AcroForm(PDFObject): fillColor=..., borderColor=..., textColor=..., - borderWidth: int = 1, + borderWidth: int = ..., borderStyle: str = "solid", width: int = 120, height: int = 36, @@ -217,10 +217,10 @@ class AcroForm(PDFObject): checked: bool = False, buttonStyle: str = "check", shape: str = "square", - fillColor=None, - borderColor=None, - textColor=None, - borderWidth: int = 1, + fillColor=..., + borderColor=..., + textColor=..., + borderWidth: int = ..., borderStyle: str = "solid", size: int = 20, x: int = 0, @@ -239,10 +239,10 @@ class AcroForm(PDFObject): selected: bool = False, buttonStyle: str = "circle", shape: str = "circle", - fillColor=None, - borderColor=None, - textColor=None, - borderWidth: int = 1, + fillColor=..., + borderColor=..., + textColor=..., + borderWidth: int = ..., borderStyle: str = "solid", size: int = 20, x: int = 0, @@ -258,10 +258,10 @@ class AcroForm(PDFObject): self, *, value: str = "", - fillColor=None, - borderColor=None, - textColor=None, - borderWidth: int = 1, + fillColor=..., + borderColor=..., + textColor=..., + borderWidth: int = ..., borderStyle: str = "solid", width: int = 120, height: int = 36, @@ -281,10 +281,10 @@ class AcroForm(PDFObject): self, *, value: str = "", - fillColor=None, - borderColor=None, - textColor=None, - borderWidth: int = 1, + fillColor=..., + borderColor=..., + textColor=..., + borderWidth: int = ..., borderStyle: str = "solid", width: int = 120, height: int = 36, @@ -304,10 +304,10 @@ class AcroForm(PDFObject): self, *, value: str = "", - fillColor=None, - borderColor=None, - textColor=None, - borderWidth: int = 1, + fillColor=..., + borderColor=..., + textColor=..., + borderWidth: int = ..., borderStyle: str = "solid", width: int = 120, height: int = 36,