From 99e37de1d8978975ce05943ca6841d79aee8b683 Mon Sep 17 00:00:00 2001 From: Oliver Date: Thu, 29 Aug 2024 12:37:38 +1000 Subject: [PATCH] Update pint library to latest version (#8028) * Update pint library to latest version * Fix hash * Handle AssertionError --- src/backend/InvenTree/InvenTree/validators.py | 4 +--- src/backend/requirements.in | 2 +- src/backend/requirements.txt | 19 +++++++++++++++++-- 3 files changed, 19 insertions(+), 6 deletions(-) diff --git a/src/backend/InvenTree/InvenTree/validators.py b/src/backend/InvenTree/InvenTree/validators.py index 8c4cb9c2ad..c42248e390 100644 --- a/src/backend/InvenTree/InvenTree/validators.py +++ b/src/backend/InvenTree/InvenTree/validators.py @@ -28,9 +28,7 @@ def validate_physical_units(unit): try: ureg(unit) - except AttributeError: - raise ValidationError(_('Invalid physical unit')) - except pint.errors.UndefinedUnitError: + except (AssertionError, AttributeError, pint.errors.UndefinedUnitError): raise ValidationError(_('Invalid physical unit')) diff --git a/src/backend/requirements.in b/src/backend/requirements.in index 6c65f19a18..82bf2194f6 100644 --- a/src/backend/requirements.in +++ b/src/backend/requirements.in @@ -40,7 +40,7 @@ feedparser # RSS newsfeed parser gunicorn # Gunicorn web server pdf2image # PDF to image conversion pillow # Image manipulation -pint==0.21 # Unit conversion # FIXED 2023-05-30 breaks tests https://github.com/matmair/InvenTree/actions/runs/5095665936/jobs/9160852560 +pint # Unit conversion pip-licenses # License information for installed packages python-barcode[images] # Barcode generator python-dotenv # Environment variable management diff --git a/src/backend/requirements.txt b/src/backend/requirements.txt index ab3edf91dc..3d047e724f 100644 --- a/src/backend/requirements.txt +++ b/src/backend/requirements.txt @@ -1,5 +1,9 @@ # This file was autogenerated by uv via the following command: # uv pip compile src/backend/requirements.in -o src/backend/requirements.txt --no-strip-extras --generate-hashes +appdirs==1.4.4 \ + --hash=sha256:7d5d0167b2b1ba821647616af46a749d1c653740dd0d2415100fe26e27afdf41 \ + --hash=sha256:a841dacd6b99318a741b166adb07e19ee71a274450e68237b4650ca1055ab128 + # via pint asgiref==3.8.1 \ --hash=sha256:3e1e3ecc849832fe52ccf2cb6686b7a55f82bb1d6aee72a58826471390335e47 \ --hash=sha256:c343bd80a0bec947a9860adb4c432ffa7db769836c64238fc34bdc3fec84d590 @@ -572,6 +576,14 @@ feedparser==6.0.11 \ --hash=sha256:0be7ee7b395572b19ebeb1d6aafb0028dee11169f1c934e0ed67d54992f4ad45 \ --hash=sha256:c9d0407b64c6f2a065d0ebb292c2b35c01050cc0dc33757461aaabdc4c4184d5 # via -r src/backend/requirements.in +flexcache==0.3 \ + --hash=sha256:18743bd5a0621bfe2cf8d519e4c3bfdf57a269c15d1ced3fb4b64e0ff4600656 \ + --hash=sha256:d43c9fea82336af6e0115e308d9d33a185390b8346a017564611f1466dcd2e32 + # via pint +flexparser==0.3.1 \ + --hash=sha256:2e3e2936bec1f9277f777ef77297522087d96adb09624d4fe4240fd56885c013 \ + --hash=sha256:36f795d82e50f5c9ae2fde1c33f21f88922fdd67b7629550a3cc4d0b40a66856 + # via pint fonttools[woff]==4.53.1 \ --hash=sha256:02569e9a810f9d11f4ae82c391ebc6fb5730d95a0657d24d754ed7763fb2d122 \ --hash=sha256:0679a30b59d74b6242909945429dbddb08496935b82f91ea9bf6ad240ec23397 \ @@ -1119,8 +1131,8 @@ pillow==10.4.0 \ # python-barcode # qrcode # weasyprint -pint==0.21 \ - --hash=sha256:3e98bdf01f4dcf840cc0207c0b6f7510d4e0c6288efc1bf470626e875c831172 \ +pint==0.24.3 \ + --hash=sha256:d98667e46fd03a1b94694fbfa104ec30858684d8ab26952e2a348b48059089bb \ --hash=sha256:998b695e84a34d11702da4a8b9457a39bb5c7ab5ec68db90e948e30878e421f1 # via -r src/backend/requirements.in pip-licenses==5.0.0 \ @@ -1637,7 +1649,10 @@ typing-extensions==4.12.2 \ # via # asgiref # drf-spectacular + # flexcache + # flexparser # opentelemetry-sdk + # pint # py-moneyed # qrcode uritemplate==4.1.1 \