diff options
| author | Khem Raj <raj.khem@gmail.com> | 2024-11-20 17:07:53 -0800 |
|---|---|---|
| committer | Khem Raj <raj.khem@gmail.com> | 2024-11-21 21:42:34 -0800 |
| commit | cd3b24c6704a714fe27df40f35ce432dc3e9c51c (patch) | |
| tree | ae32bcca27d4e88b0dcd826e1f3ae140ec4a1630 | |
| parent | 4c2d0dc913d96ef6083b321e5cc7390513b4bb94 (diff) | |
| download | meta-openembedded-cd3b24c6704a714fe27df40f35ce432dc3e9c51c.tar.gz | |
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 <raj.khem@gmail.com>
| -rw-r--r-- | meta-python/recipes-devtools/python/python3-pint/0001-dataclass-frozen-True-for-Python-3.13-compatibility.patch | 116 | ||||
| -rw-r--r-- | meta-python/recipes-devtools/python/python3-pint_0.24.4.bb (renamed from meta-python/recipes-devtools/python/python3-pint_0.24.3.bb) | 4 |
2 files changed, 2 insertions, 118 deletions
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 @@ | |||
| 1 | From dc729d5b6574e1c44ec12e13b68c2b900e4a7ba1 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Simon Willison <swillison@gmail.com> | ||
| 3 | Date: Fri, 12 Jul 2024 17:23:21 -0700 | ||
| 4 | Subject: [PATCH] @dataclass(frozen=True) for Python 3.13 compatibility | ||
| 5 | |||
| 6 | Upstream-Status: Submitted [https://github.com/hgrecco/pint/pull/2037] | ||
| 7 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
| 8 | --- | ||
| 9 | pint/errors.py | 24 ++++++++++++------------ | ||
| 10 | 1 file changed, 12 insertions(+), 12 deletions(-) | ||
| 11 | |||
| 12 | diff --git a/pint/errors.py b/pint/errors.py | ||
| 13 | index 59d3b45..f080f52 100644 | ||
| 14 | --- a/pint/errors.py | ||
| 15 | +++ b/pint/errors.py | ||
| 16 | @@ -81,12 +81,12 @@ class WithDefErr: | ||
| 17 | return DefinitionError(self.name, self.__class__, msg) | ||
| 18 | |||
| 19 | |||
| 20 | -@dataclass(frozen=False) | ||
| 21 | +@dataclass(frozen=True) | ||
| 22 | class PintError(Exception): | ||
| 23 | """Base exception for all Pint errors.""" | ||
| 24 | |||
| 25 | |||
| 26 | -@dataclass(frozen=False) | ||
| 27 | +@dataclass(frozen=True) | ||
| 28 | class DefinitionError(ValueError, PintError): | ||
| 29 | """Raised when a definition is not properly constructed.""" | ||
| 30 | |||
| 31 | @@ -102,7 +102,7 @@ class DefinitionError(ValueError, PintError): | ||
| 32 | return self.__class__, tuple(getattr(self, f.name) for f in fields(self)) | ||
| 33 | |||
| 34 | |||
| 35 | -@dataclass(frozen=False) | ||
| 36 | +@dataclass(frozen=True) | ||
| 37 | class DefinitionSyntaxError(ValueError, PintError): | ||
| 38 | """Raised when a textual definition has a syntax error.""" | ||
| 39 | |||
| 40 | @@ -115,7 +115,7 @@ class DefinitionSyntaxError(ValueError, PintError): | ||
| 41 | return self.__class__, tuple(getattr(self, f.name) for f in fields(self)) | ||
| 42 | |||
| 43 | |||
| 44 | -@dataclass(frozen=False) | ||
| 45 | +@dataclass(frozen=True) | ||
| 46 | class RedefinitionError(ValueError, PintError): | ||
| 47 | """Raised when a unit or prefix is redefined.""" | ||
| 48 | |||
| 49 | @@ -130,7 +130,7 @@ class RedefinitionError(ValueError, PintError): | ||
| 50 | return self.__class__, tuple(getattr(self, f.name) for f in fields(self)) | ||
| 51 | |||
| 52 | |||
| 53 | -@dataclass(frozen=False) | ||
| 54 | +@dataclass(frozen=True) | ||
| 55 | class UndefinedUnitError(AttributeError, PintError): | ||
| 56 | """Raised when the units are not defined in the unit registry.""" | ||
| 57 | |||
| 58 | @@ -150,13 +150,13 @@ class UndefinedUnitError(AttributeError, PintError): | ||
| 59 | return self.__class__, tuple(getattr(self, f.name) for f in fields(self)) | ||
| 60 | |||
| 61 | |||
| 62 | -@dataclass(frozen=False) | ||
| 63 | +@dataclass(frozen=True) | ||
| 64 | class PintTypeError(TypeError, PintError): | ||
| 65 | def __reduce__(self): | ||
| 66 | return self.__class__, tuple(getattr(self, f.name) for f in fields(self)) | ||
| 67 | |||
| 68 | |||
| 69 | -@dataclass(frozen=False) | ||
| 70 | +@dataclass(frozen=True) | ||
| 71 | class DimensionalityError(PintTypeError): | ||
| 72 | """Raised when trying to convert between incompatible units.""" | ||
| 73 | |||
| 74 | @@ -183,7 +183,7 @@ class DimensionalityError(PintTypeError): | ||
| 75 | return self.__class__, tuple(getattr(self, f.name) for f in fields(self)) | ||
| 76 | |||
| 77 | |||
| 78 | -@dataclass(frozen=False) | ||
| 79 | +@dataclass(frozen=True) | ||
| 80 | class OffsetUnitCalculusError(PintTypeError): | ||
| 81 | """Raised on ambiguous operations with offset units.""" | ||
| 82 | |||
| 83 | @@ -208,7 +208,7 @@ class OffsetUnitCalculusError(PintTypeError): | ||
| 84 | return self.__class__, tuple(getattr(self, f.name) for f in fields(self)) | ||
| 85 | |||
| 86 | |||
| 87 | -@dataclass(frozen=False) | ||
| 88 | +@dataclass(frozen=True) | ||
| 89 | class LogarithmicUnitCalculusError(PintTypeError): | ||
| 90 | """Raised on inappropriate operations with logarithmic units.""" | ||
| 91 | |||
| 92 | @@ -233,7 +233,7 @@ class LogarithmicUnitCalculusError(PintTypeError): | ||
| 93 | return self.__class__, tuple(getattr(self, f.name) for f in fields(self)) | ||
| 94 | |||
| 95 | |||
| 96 | -@dataclass(frozen=False) | ||
| 97 | +@dataclass(frozen=True) | ||
| 98 | class UnitStrippedWarning(UserWarning, PintError): | ||
| 99 | msg: str | ||
| 100 | |||
| 101 | @@ -241,13 +241,13 @@ class UnitStrippedWarning(UserWarning, PintError): | ||
| 102 | return self.__class__, tuple(getattr(self, f.name) for f in fields(self)) | ||
| 103 | |||
| 104 | |||
| 105 | -@dataclass(frozen=False) | ||
| 106 | +@dataclass(frozen=True) | ||
| 107 | class UnexpectedScaleInContainer(Exception): | ||
| 108 | def __reduce__(self): | ||
| 109 | return self.__class__, tuple(getattr(self, f.name) for f in fields(self)) | ||
| 110 | |||
| 111 | |||
| 112 | -@dataclass(frozen=False) | ||
| 113 | +@dataclass(frozen=True) | ||
| 114 | class UndefinedBehavior(UserWarning, PintError): | ||
| 115 | msg: str | ||
| 116 | |||
diff --git a/meta-python/recipes-devtools/python/python3-pint_0.24.3.bb b/meta-python/recipes-devtools/python/python3-pint_0.24.4.bb index 337f587202..88efefff58 100644 --- a/meta-python/recipes-devtools/python/python3-pint_0.24.3.bb +++ b/meta-python/recipes-devtools/python/python3-pint_0.24.4.bb | |||
| @@ -8,7 +8,7 @@ LIC_FILES_CHKSUM = "file://LICENSE;md5=bccf824202692270a1e0829a62e3f47b" | |||
| 8 | 8 | ||
| 9 | inherit pypi ptest python_setuptools_build_meta | 9 | inherit pypi ptest python_setuptools_build_meta |
| 10 | 10 | ||
| 11 | SRC_URI[sha256sum] = "d54771093e8b94c4e0a35ac638c2444ddf3ef685652bab7675ffecfa0c5c5cdf" | 11 | SRC_URI[sha256sum] = "35275439b574837a6cd3020a5a4a73645eb125ce4152a73a2f126bf164b91b80" |
| 12 | 12 | ||
| 13 | DEPENDS += "python3-setuptools-scm-native" | 13 | DEPENDS += "python3-setuptools-scm-native" |
| 14 | 14 | ||
| @@ -16,12 +16,12 @@ BBCLASSEXTEND = "native nativesdk" | |||
| 16 | 16 | ||
| 17 | SRC_URI += " \ | 17 | SRC_URI += " \ |
| 18 | file://run-ptest \ | 18 | file://run-ptest \ |
| 19 | file://0001-dataclass-frozen-True-for-Python-3.13-compatibility.patch \ | ||
| 20 | " | 19 | " |
| 21 | 20 | ||
| 22 | RDEPENDS:${PN} += " \ | 21 | RDEPENDS:${PN} += " \ |
| 23 | python3-setuptools \ | 22 | python3-setuptools \ |
| 24 | python3-packaging \ | 23 | python3-packaging \ |
| 24 | python3-platformdirs \ | ||
| 25 | " | 25 | " |
| 26 | # python3-misc for timeit.py | 26 | # python3-misc for timeit.py |
| 27 | RDEPENDS:${PN}-ptest += " \ | 27 | RDEPENDS:${PN}-ptest += " \ |
