Hash is now stable across python runtimes

This commit is contained in:
Patrick Kidger
2023-08-17 16:23:33 +01:00
parent 13e6870fb8
commit 0bb8b760a5
2 changed files with 5 additions and 2 deletions
+4 -1
View File
@@ -51,6 +51,7 @@
import ast
import functools as ft
import hashlib
import sys
from collections.abc import Sequence
from importlib.abc import MetaPathFinder
@@ -165,7 +166,9 @@ class _JaxtypingLoader(SourceFileLoader):
def __init__(self, *args, typechecker, **kwargs):
super().__init__(*args, **kwargs)
self._typechecker = typechecker
self._typechecker_hash = str(abs(hash(self._typechecker)))
self._typechecker_hash = hashlib.md5(
self._typechecker.encode("utf-8")
).hexdigest()
def source_to_code(self, data, path, *, _optimize=-1):
source = decode_source(data)
+1 -1
View File
@@ -1,6 +1,6 @@
[project]
name = "jaxtyping"
version = "0.2.20"
version = "0.2.21"
description = "Type annotations and runtime checking for shape and dtype of JAX arrays, and PyTrees."
readme = "README.md"
requires-python ="~=3.9"