Skip to content

Commit c9565ad

Browse files
authored
Merge pull request #5365 from cloudflare/dominik/shapely-test
Implements shapely vendored test for Python Workers
2 parents a473263 + 65aba2a commit c9565ad

File tree

4 files changed

+35
-0
lines changed

4 files changed

+35
-0
lines changed

build/python_metadata.bzl

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,11 @@ BUNDLE_VERSION_INFO = _make_bundle_version_info([
186186
# "abi": "3.13",
187187
# "sha256": "4f1b6fc179bd5c6d3de68abc4aa9fca2aaecd09c5c8d357c2ecfedce7d621f3d",
188188
# },
189+
{
190+
"name": "shapely",
191+
"abi": "3.13",
192+
"sha256": "2e5c462cb32ee8697b3647dfc9d5c88dcdfd0702da34a2d7dc6b07b8090dd321",
193+
},
189194
],
190195
},
191196
{

src/workerd/server/tests/python/vendor_pkg_tests/BUILD

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,11 @@ vendored_py_wd_test(
1212
)
1313

1414
# vendored_py_wd_test("scipy")
15+
16+
vendored_py_wd_test(
17+
"shapely",
18+
feature_flags = ["python_dedicated_snapshot"],
19+
make_snapshot = True,
20+
python_flags = ["0.28.2"],
21+
use_snapshot = "baseline",
22+
)
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
import shapely
2+
3+
4+
async def test():
5+
assert shapely.__version__
6+
print("shapely imported successfully!")
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
using Workerd = import "/workerd/workerd.capnp";
2+
3+
const unitTests :Workerd.Config = (
4+
services = [
5+
( name = "shapely-vendor-test",
6+
worker = (
7+
modules = [
8+
(name = "main.py", pythonModule = embed "shapely.py"),
9+
%PYTHON_VENDORED_MODULES%
10+
],
11+
compatibilityDate = "2024-01-15",
12+
compatibilityFlags = [%PYTHON_FEATURE_FLAGS],
13+
)
14+
),
15+
],
16+
);

0 commit comments

Comments
 (0)