python-outcome: update to 1.3.0
authorAlexandru Ardelean <redacted>
Thu, 9 Apr 2026 05:35:37 +0000 (08:35 +0300)
committerAlexandru Ardelean <redacted>
Thu, 16 Apr 2026 04:08:59 +0000 (07:08 +0300)
Update package to 1.3.0.

Changes since 1.2.0:

1.3.0:
- Added full type hints; Value and Outcome are now generic classes
- Added Maybe type alias as a union of Value[T] and Error
- Added typed __all__ exports and marked __version__ as a public constant
- Functions that do not return are now captured as Error
- Added pyright --verifytypes to CI; strict mypy mode enabled

Signed-off-by: Alexandru Ardelean <redacted>
lang/python/python-outcome/Makefile
lang/python/python-outcome/test.sh [new file with mode: 0755]

index d377acd1706e78d99f0be5a4e90a1fa5d1efb116..d49685669d2db85ed8f8fca2985b31003cd6f95d 100644 (file)
@@ -8,11 +8,11 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=python-outcome
-PKG_VERSION:=1.2.0
-PKG_RELEASE:=2
+PKG_VERSION:=1.3.0
+PKG_RELEASE:=1
 
 PYPI_NAME:=outcome
-PKG_HASH:=6f82bd3de45da303cf1f771ecafa1633750a358436a8bb60e06a1ceb745d2672
+PKG_HASH:=588ef4dc10b64e8df160d8d1310c44e1927129a66d6d2ef86845cef512c5f24c
 
 PKG_LICENSE:=Apache-2.0 MIT
 PKG_LICENSE_FILES:=LICENSE.APACHE2 LICENSE.MIT
diff --git a/lang/python/python-outcome/test.sh b/lang/python/python-outcome/test.sh
new file mode 100755 (executable)
index 0000000..5f983ec
--- /dev/null
@@ -0,0 +1,33 @@
+#!/bin/sh
+
+[ "$1" = python3-outcome ] || exit 0
+
+python3 - << 'EOF'
+from outcome import Value, Error, capture, acapture
+
+# Value outcome
+v = Value(42)
+assert v.value == 42
+assert v.unwrap() == 42
+
+# Error outcome
+e = Error(ValueError("oops"))
+assert isinstance(e.error, ValueError)
+try:
+    e.unwrap()
+    assert False, "Should have raised"
+except ValueError as exc:
+    assert str(exc) == "oops"
+
+# capture()
+result = capture(lambda: 1 + 1)
+assert isinstance(result, Value)
+assert result.value == 2
+
+result2 = capture(lambda: 1 / 0)
+assert isinstance(result2, Error)
+assert isinstance(result2.error, ZeroDivisionError)
+
+# acapture is present and callable (async test omitted: python3-asyncio not a dependency)
+assert callable(acapture)
+EOF
git clone https://git.99rst.org/PROJECT