From f0bca5e34e378b67cddcef58d5a2955bb9642e60 Mon Sep 17 00:00:00 2001 From: Romain Hardy Date: Wed, 7 Feb 2024 09:48:20 +0100 Subject: [PATCH] Upgrade starlark-go (20240311180835-efac67204ba7) Upgrade the Go starlark package to latest one. This involves a rewrite of the test_configure.py since the starlark resolver configuration is evaluated part of the exec. This is because using global config vars is deprecated now. This is not replacing the usage of it yet as it would involve breaking change of the API. --- go.mod | 2 +- go.sum | 4 ++++ tests/test_configure.py | 3 ++- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/go.mod b/go.mod index 1cff0ad..664fcb7 100644 --- a/go.mod +++ b/go.mod @@ -2,6 +2,6 @@ module github.com/caketop/python-starlark-go go 1.20 -require go.starlark.net v0.0.0-20230302034142-4b1e35fe2254 +require go.starlark.net v0.0.0-20240311180835-efac67204ba7 require golang.org/x/sys v0.6.0 // indirect diff --git a/go.sum b/go.sum index 18f86b5..250669e 100644 --- a/go.sum +++ b/go.sum @@ -32,6 +32,10 @@ go.starlark.net v0.0.0-20230128213706-3f75dec8e403 h1:jPeC7Exc+m8OBJUlWbBLh0O5UZ go.starlark.net v0.0.0-20230128213706-3f75dec8e403/go.mod h1:jxU+3+j+71eXOW14274+SmmuW82qJzl6iZSeqEtTGds= go.starlark.net v0.0.0-20230302034142-4b1e35fe2254 h1:Ss6D3hLXTM0KobyBYEAygXzFfGcjnmfEJOBgSbemCtg= go.starlark.net v0.0.0-20230302034142-4b1e35fe2254/go.mod h1:jxU+3+j+71eXOW14274+SmmuW82qJzl6iZSeqEtTGds= +go.starlark.net v0.0.0-20240123142251-f86470692795 h1:LmbG8Pq7KDGkglKVn8VpZOZj6vb9b8nKEGcg9l03epM= +go.starlark.net v0.0.0-20240123142251-f86470692795/go.mod h1:LcLNIzVOMp4oV+uusnpk+VU+SzXaJakUuBjoCSWH5dM= +go.starlark.net v0.0.0-20240311180835-efac67204ba7 h1:xH7OJPtjgdj/xXykge/wGPAAqik97FbEVJR55lEY0tQ= +go.starlark.net v0.0.0-20240311180835-efac67204ba7/go.mod h1:MrdO7XaMF3dE3MzuP6mrG0EB3NC7rLWSiEcu9Ii50g8= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= diff --git a/tests/test_configure.py b/tests/test_configure.py index 91e34c7..46dffcc 100644 --- a/tests/test_configure.py +++ b/tests/test_configure.py @@ -19,13 +19,14 @@ def fibonacci(n): def test_recursion(): s = Starlark() - s.exec(RFIB) configure_starlark(allow_recursion=False) + s.exec(RFIB) with pytest.raises(EvalError): s.eval("fibonacci(5)") configure_starlark(allow_recursion=True) + s.exec(RFIB) assert s.eval("fibonacci(5)") == [0, 1, 1, 2, 3] assert s.eval("fibonacci(10)") == [0, 1, 1, 2, 3, 5, 8, 13, 21, 34]