From caeb0954a7fee9dd469b7f0df0129bbf39aec60d Mon Sep 17 00:00:00 2001 From: donBarbos Date: Thu, 20 Nov 2025 12:32:18 +0400 Subject: [PATCH] [reportlab] Update to 4.4.5 * based on git diff * Annotate few helper functions --- stubs/reportlab/METADATA.toml | 2 +- stubs/reportlab/reportlab/lib/testutils.pyi | 52 ++++++++++--------- .../reportlab/platypus/flowables.pyi | 2 +- 3 files changed, 29 insertions(+), 27 deletions(-) diff --git a/stubs/reportlab/METADATA.toml b/stubs/reportlab/METADATA.toml index e4f6253d99e5..2b4ec1515c40 100644 --- a/stubs/reportlab/METADATA.toml +++ b/stubs/reportlab/METADATA.toml @@ -1,4 +1,4 @@ -version = "4.4.4" +version = "4.4.5" # 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/lib/testutils.pyi b/stubs/reportlab/reportlab/lib/testutils.pyi index 0dd2fa224150..7a55147e3739 100644 --- a/stubs/reportlab/reportlab/lib/testutils.pyi +++ b/stubs/reportlab/reportlab/lib/testutils.pyi @@ -1,40 +1,42 @@ +import re import unittest -from _typeshed import Incomplete -from configparser import ConfigParser +from _typeshed import Incomplete, StrPath, Unused +from configparser import ConfigParser, _SectionName +from types import ModuleType from typing import Final, Literal __version__: Final[str] -def haveRenderPM(): ... -def isWritable(D): ... +def invariantSeed(n: float | str | bytes | bytearray | None) -> None: ... +def haveRenderPM() -> ModuleType | Literal[False]: ... -RL_HOME: Incomplete -testsFolder: Incomplete - -DEJAVUSANS: tuple[ - Literal["DejaVuSans"], Literal["DejaVuSans-Bold"], Literal["DejaVuSans-Oblique"], Literal["DejaVuSans-BoldOblique"] -] = ... +DEJAVUSANS: Final = ("DejaVuSans", "DejaVuSans-Bold", "DejaVuSans-Oblique", "DejaVuSans-BoldOblique") def haveDejaVu() -> bool: ... -def setOutDir(name): ... -def mockUrlRead(name): ... -def outputfile(fn): ... +def isWritable(D: Unused) -> Literal[0, 1]: ... + +RL_HOME: str | None +testsFolder: str | None + +def setOutDir(name: str) -> str: ... +def mockUrlRead(name: str): ... +def outputfile(fn: StrPath | None) -> str: ... def printLocation(depth: int = 1) -> None: ... -def makeSuiteForClasses(*classes, testMethodPrefix=None): ... -def getCVSEntries(folder, files: int = 1, folders: int = 0): ... +def makeSuiteForClasses(*classes: type[unittest.TestCase], testMethodPrefix: str | None = None) -> unittest.TestSuite: ... +def getCVSEntries(folder: StrPath, files: bool | Literal[1, 0] = 1, folders: bool | Literal[1, 0] = 0) -> list[str]: ... class ExtConfigParser(ConfigParser): - pat: Incomplete - def getstringlist(self, section, option): ... + pat: re.Pattern[str] + def getstringlist(self, section: _SectionName, option: str): ... class GlobDirectoryWalker: index: int - pattern: Incomplete - stack: Incomplete - files: Incomplete - directory: Incomplete - def __init__(self, directory, pattern: str = "*") -> None: ... - def __getitem__(self, index): ... + pattern: str + stack: list[str] + files: list[str] + directory: str + def __init__(self, directory: str, pattern: str = "*") -> None: ... + def __getitem__(self, index) -> str | None: ... def filterFiles(self, folder, files): ... class RestrictedGlobDirectoryWalker(GlobDirectoryWalker): @@ -64,9 +66,9 @@ class ScriptThatMakesFileTest(unittest.TestCase): def tearDown(self) -> None: ... def runTest(self) -> None: ... -def equalStrings(a, b, enc: str = "utf8"): ... +def equalStrings(a: str | bytes, b: str | bytes, enc: str = "utf8") -> bool: ... def eqCheck(r, x) -> None: ... -def rlextraNeeded(): ... +def rlextraNeeded() -> bool: ... def rlSkipIf(cond, reason, __module__=None): ... def rlSkipUnless(cond, reason, __module__=None): ... def rlSkip(reason, __module__=None): ... diff --git a/stubs/reportlab/reportlab/platypus/flowables.pyi b/stubs/reportlab/reportlab/platypus/flowables.pyi index 76dc086703ff..da28237e3850 100644 --- a/stubs/reportlab/reportlab/platypus/flowables.pyi +++ b/stubs/reportlab/reportlab/platypus/flowables.pyi @@ -411,7 +411,7 @@ class ListItem: # TODO: Use Unpack for kwds with the ListStyle properties + value/spaceBefore/spaceAfter def __init__(self, flowables: _FlowableSublist, style: PropertySet | None = None, **kwds) -> None: ... -class ListFlowable(_Container, Flowable): +class ListFlowable(_Container, Flowable, _FindSplitterMixin): style: ListStyle # NOTE: style has to be a ListStyle, but this will be annoying with sheet["ul"] # TODO: Use Unpack for kwds with the ListStyle properties + spaceBefore/spaceAfter