From cd3b24c6704a714fe27df40f35ce432dc3e9c51c Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Wed, 20 Nov 2024 17:07:53 -0800 Subject: python3-pint: Upgrade to 0.24.4 - add error for prefixed non multi units - build: typing_extensions version - build: switch from appdirs to platformdirs - fix GenericPlainRegistry getattr type - Replace references to the deprecated `UnitRegistry.default_format` - fix: upgrade to flexparser>=0.4, exceptions are no longer dataclasses. (required for Python 3.13) - Drop the backported patch Signed-off-by: Khem Raj --- ...frozen-True-for-Python-3.13-compatibility.patch | 116 --------------------- .../recipes-devtools/python/python3-pint_0.24.3.bb | 43 -------- .../recipes-devtools/python/python3-pint_0.24.4.bb | 43 ++++++++ 3 files changed, 43 insertions(+), 159 deletions(-) delete mode 100644 meta-python/recipes-devtools/python/python3-pint/0001-dataclass-frozen-True-for-Python-3.13-compatibility.patch delete mode 100644 meta-python/recipes-devtools/python/python3-pint_0.24.3.bb create mode 100644 meta-python/recipes-devtools/python/python3-pint_0.24.4.bb (limited to 'meta-python/recipes-devtools/python') diff --git a/meta-python/recipes-devtools/python/python3-pint/0001-dataclass-frozen-True-for-Python-3.13-compatibility.patch b/meta-python/recipes-devtools/python/python3-pint/0001-dataclass-frozen-True-for-Python-3.13-compatibility.patch deleted file mode 100644 index 6f9b0f5bca..0000000000 --- a/meta-python/recipes-devtools/python/python3-pint/0001-dataclass-frozen-True-for-Python-3.13-compatibility.patch +++ /dev/null @@ -1,116 +0,0 @@ -From dc729d5b6574e1c44ec12e13b68c2b900e4a7ba1 Mon Sep 17 00:00:00 2001 -From: Simon Willison -Date: Fri, 12 Jul 2024 17:23:21 -0700 -Subject: [PATCH] @dataclass(frozen=True) for Python 3.13 compatibility - -Upstream-Status: Submitted [https://github.com/hgrecco/pint/pull/2037] -Signed-off-by: Khem Raj ---- - pint/errors.py | 24 ++++++++++++------------ - 1 file changed, 12 insertions(+), 12 deletions(-) - -diff --git a/pint/errors.py b/pint/errors.py -index 59d3b45..f080f52 100644 ---- a/pint/errors.py -+++ b/pint/errors.py -@@ -81,12 +81,12 @@ class WithDefErr: - return DefinitionError(self.name, self.__class__, msg) - - --@dataclass(frozen=False) -+@dataclass(frozen=True) - class PintError(Exception): - """Base exception for all Pint errors.""" - - --@dataclass(frozen=False) -+@dataclass(frozen=True) - class DefinitionError(ValueError, PintError): - """Raised when a definition is not properly constructed.""" - -@@ -102,7 +102,7 @@ class DefinitionError(ValueError, PintError): - return self.__class__, tuple(getattr(self, f.name) for f in fields(self)) - - --@dataclass(frozen=False) -+@dataclass(frozen=True) - class DefinitionSyntaxError(ValueError, PintError): - """Raised when a textual definition has a syntax error.""" - -@@ -115,7 +115,7 @@ class DefinitionSyntaxError(ValueError, PintError): - return self.__class__, tuple(getattr(self, f.name) for f in fields(self)) - - --@dataclass(frozen=False) -+@dataclass(frozen=True) - class RedefinitionError(ValueError, PintError): - """Raised when a unit or prefix is redefined.""" - -@@ -130,7 +130,7 @@ class RedefinitionError(ValueError, PintError): - return self.__class__, tuple(getattr(self, f.name) for f in fields(self)) - - --@dataclass(frozen=False) -+@dataclass(frozen=True) - class UndefinedUnitError(AttributeError, PintError): - """Raised when the units are not defined in the unit registry.""" - -@@ -150,13 +150,13 @@ class UndefinedUnitError(AttributeError, PintError): - return self.__class__, tuple(getattr(self, f.name) for f in fields(self)) - - --@dataclass(frozen=False) -+@dataclass(frozen=True) - class PintTypeError(TypeError, PintError): - def __reduce__(self): - return self.__class__, tuple(getattr(self, f.name) for f in fields(self)) - - --@dataclass(frozen=False) -+@dataclass(frozen=True) - class DimensionalityError(PintTypeError): - """Raised when trying to convert between incompatible units.""" - -@@ -183,7 +183,7 @@ class DimensionalityError(PintTypeError): - return self.__class__, tuple(getattr(self, f.name) for f in fields(self)) - - --@dataclass(frozen=False) -+@dataclass(frozen=True) - class OffsetUnitCalculusError(PintTypeError): - """Raised on ambiguous operations with offset units.""" - -@@ -208,7 +208,7 @@ class OffsetUnitCalculusError(PintTypeError): - return self.__class__, tuple(getattr(self, f.name) for f in fields(self)) - - --@dataclass(frozen=False) -+@dataclass(frozen=True) - class LogarithmicUnitCalculusError(PintTypeError): - """Raised on inappropriate operations with logarithmic units.""" - -@@ -233,7 +233,7 @@ class LogarithmicUnitCalculusError(PintTypeError): - return self.__class__, tuple(getattr(self, f.name) for f in fields(self)) - - --@dataclass(frozen=False) -+@dataclass(frozen=True) - class UnitStrippedWarning(UserWarning, PintError): - msg: str - -@@ -241,13 +241,13 @@ class UnitStrippedWarning(UserWarning, PintError): - return self.__class__, tuple(getattr(self, f.name) for f in fields(self)) - - --@dataclass(frozen=False) -+@dataclass(frozen=True) - class UnexpectedScaleInContainer(Exception): - def __reduce__(self): - return self.__class__, tuple(getattr(self, f.name) for f in fields(self)) - - --@dataclass(frozen=False) -+@dataclass(frozen=True) - class UndefinedBehavior(UserWarning, PintError): - msg: str - diff --git a/meta-python/recipes-devtools/python/python3-pint_0.24.3.bb b/meta-python/recipes-devtools/python/python3-pint_0.24.3.bb deleted file mode 100644 index 337f587202..0000000000 --- a/meta-python/recipes-devtools/python/python3-pint_0.24.3.bb +++ /dev/null @@ -1,43 +0,0 @@ -SUMMARY = "Physical quantities module" -DESCRIPTION = "Physical quantities Python module" -HOMEPAGE = "https://github.com/hgrecco/pint" -SECTION = "devel/python" - -LICENSE = "BSD-3-Clause" -LIC_FILES_CHKSUM = "file://LICENSE;md5=bccf824202692270a1e0829a62e3f47b" - -inherit pypi ptest python_setuptools_build_meta - -SRC_URI[sha256sum] = "d54771093e8b94c4e0a35ac638c2444ddf3ef685652bab7675ffecfa0c5c5cdf" - -DEPENDS += "python3-setuptools-scm-native" - -BBCLASSEXTEND = "native nativesdk" - -SRC_URI += " \ - file://run-ptest \ - file://0001-dataclass-frozen-True-for-Python-3.13-compatibility.patch \ -" - -RDEPENDS:${PN} += " \ - python3-setuptools \ - python3-packaging \ -" -# python3-misc for timeit.py -RDEPENDS:${PN}-ptest += " \ - python3-appdirs \ - python3-attrs \ - python3-flexcache \ - python3-flexparser \ - python3-misc \ - python3-pytest \ - python3-pytest-benchmark \ - python3-pytest-subtests \ - python3-statistics \ - python3-unittest-automake-output \ -" - -do_install_ptest() { - install -d ${D}${PTEST_PATH}/testsuite - cp -rf ${S}/pint/* ${D}${PTEST_PATH}/ -} diff --git a/meta-python/recipes-devtools/python/python3-pint_0.24.4.bb b/meta-python/recipes-devtools/python/python3-pint_0.24.4.bb new file mode 100644 index 0000000000..88efefff58 --- /dev/null +++ b/meta-python/recipes-devtools/python/python3-pint_0.24.4.bb @@ -0,0 +1,43 @@ +SUMMARY = "Physical quantities module" +DESCRIPTION = "Physical quantities Python module" +HOMEPAGE = "https://github.com/hgrecco/pint" +SECTION = "devel/python" + +LICENSE = "BSD-3-Clause" +LIC_FILES_CHKSUM = "file://LICENSE;md5=bccf824202692270a1e0829a62e3f47b" + +inherit pypi ptest python_setuptools_build_meta + +SRC_URI[sha256sum] = "35275439b574837a6cd3020a5a4a73645eb125ce4152a73a2f126bf164b91b80" + +DEPENDS += "python3-setuptools-scm-native" + +BBCLASSEXTEND = "native nativesdk" + +SRC_URI += " \ + file://run-ptest \ +" + +RDEPENDS:${PN} += " \ + python3-setuptools \ + python3-packaging \ + python3-platformdirs \ +" +# python3-misc for timeit.py +RDEPENDS:${PN}-ptest += " \ + python3-appdirs \ + python3-attrs \ + python3-flexcache \ + python3-flexparser \ + python3-misc \ + python3-pytest \ + python3-pytest-benchmark \ + python3-pytest-subtests \ + python3-statistics \ + python3-unittest-automake-output \ +" + +do_install_ptest() { + install -d ${D}${PTEST_PATH}/testsuite + cp -rf ${S}/pint/* ${D}${PTEST_PATH}/ +} -- cgit v1.2.3-54-g00ecf