modal 1.0.3.dev14__py3-none-any.whl → 1.0.3.dev15__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- modal/client.pyi +2 -2
- modal/mount.py +106 -0
- modal/mount.pyi +10 -0
- {modal-1.0.3.dev14.dist-info → modal-1.0.3.dev15.dist-info}/METADATA +1 -1
- {modal-1.0.3.dev14.dist-info → modal-1.0.3.dev15.dist-info}/RECORD +10 -10
- modal_version/__init__.py +1 -1
- {modal-1.0.3.dev14.dist-info → modal-1.0.3.dev15.dist-info}/WHEEL +0 -0
- {modal-1.0.3.dev14.dist-info → modal-1.0.3.dev15.dist-info}/entry_points.txt +0 -0
- {modal-1.0.3.dev14.dist-info → modal-1.0.3.dev15.dist-info}/licenses/LICENSE +0 -0
- {modal-1.0.3.dev14.dist-info → modal-1.0.3.dev15.dist-info}/top_level.txt +0 -0
modal/client.pyi
CHANGED
@@ -31,7 +31,7 @@ class _Client:
|
|
31
31
|
server_url: str,
|
32
32
|
client_type: int,
|
33
33
|
credentials: typing.Optional[tuple[str, str]],
|
34
|
-
version: str = "1.0.3.
|
34
|
+
version: str = "1.0.3.dev15",
|
35
35
|
): ...
|
36
36
|
def is_closed(self) -> bool: ...
|
37
37
|
@property
|
@@ -94,7 +94,7 @@ class Client:
|
|
94
94
|
server_url: str,
|
95
95
|
client_type: int,
|
96
96
|
credentials: typing.Optional[tuple[str, str]],
|
97
|
-
version: str = "1.0.3.
|
97
|
+
version: str = "1.0.3.dev15",
|
98
98
|
): ...
|
99
99
|
def is_closed(self) -> bool: ...
|
100
100
|
@property
|
modal/mount.py
CHANGED
@@ -810,3 +810,109 @@ def _is_modal_path(remote_path: PurePosixPath):
|
|
810
810
|
if is_modal_path:
|
811
811
|
return True
|
812
812
|
return False
|
813
|
+
|
814
|
+
REMOTE_PACKAGES_PATH = "/__modal/deps"
|
815
|
+
REMOTE_SITECUSTOMIZE_PATH = "/pkg/sitecustomize.py"
|
816
|
+
|
817
|
+
SITECUSTOMIZE_CONTENT = f"""
|
818
|
+
# This file is automatically generated by Modal.
|
819
|
+
# It ensures that Modal's python dependencies are available in the Python PATH,
|
820
|
+
# while prioritizing user-installed packages.
|
821
|
+
import sys; sys.path.append('{REMOTE_PACKAGES_PATH}')
|
822
|
+
""".strip()
|
823
|
+
|
824
|
+
async def _create_single_mount(
|
825
|
+
client: _Client,
|
826
|
+
builder_version: str,
|
827
|
+
python_version: str,
|
828
|
+
platform: str,
|
829
|
+
arch: str,
|
830
|
+
uv_python_platform: str = None,
|
831
|
+
check_if_exists: bool = True,
|
832
|
+
):
|
833
|
+
import subprocess
|
834
|
+
import tempfile
|
835
|
+
|
836
|
+
profile_environment = config.get("environment")
|
837
|
+
abi_tag = "cp" + python_version.replace(".", "")
|
838
|
+
mount_name = f"{builder_version}-{abi_tag}-{platform}-{arch}"
|
839
|
+
uv_python_platform = uv_python_platform or f"{arch}-{platform}"
|
840
|
+
|
841
|
+
if check_if_exists:
|
842
|
+
try:
|
843
|
+
await Mount.from_name(mount_name, namespace=api_pb2.DEPLOYMENT_NAMESPACE_GLOBAL).hydrate.aio(client)
|
844
|
+
print(f"✅ Found existing mount {mount_name} in global namespace.")
|
845
|
+
return
|
846
|
+
except modal.exception.NotFoundError:
|
847
|
+
pass
|
848
|
+
|
849
|
+
with tempfile.TemporaryDirectory() as tmpd:
|
850
|
+
print(f"📦 Building {mount_name}.")
|
851
|
+
requirements = os.path.join(os.path.dirname(__file__), f"requirements/{builder_version}.txt")
|
852
|
+
subprocess.run(
|
853
|
+
[
|
854
|
+
"uv",
|
855
|
+
"pip",
|
856
|
+
"install",
|
857
|
+
"--strict",
|
858
|
+
"--no-deps",
|
859
|
+
"--no-cache",
|
860
|
+
"-r",
|
861
|
+
requirements,
|
862
|
+
"--compile-bytecode",
|
863
|
+
"--target",
|
864
|
+
tmpd,
|
865
|
+
"--python-platform",
|
866
|
+
uv_python_platform,
|
867
|
+
"--python-version",
|
868
|
+
python_version,
|
869
|
+
],
|
870
|
+
check=True,
|
871
|
+
capture_output=True,
|
872
|
+
)
|
873
|
+
|
874
|
+
print(f"🌐 Downloaded and unpacked packages to {tmpd}.")
|
875
|
+
|
876
|
+
python_mount = Mount._from_local_dir(tmpd, remote_path=REMOTE_PACKAGES_PATH)
|
877
|
+
|
878
|
+
with tempfile.NamedTemporaryFile() as sitecustomize:
|
879
|
+
sitecustomize.write(
|
880
|
+
SITECUSTOMIZE_CONTENT.encode("utf-8"),
|
881
|
+
)
|
882
|
+
sitecustomize.flush()
|
883
|
+
|
884
|
+
python_mount = python_mount.add_local_file(
|
885
|
+
sitecustomize.name,
|
886
|
+
remote_path=REMOTE_SITECUSTOMIZE_PATH,
|
887
|
+
)
|
888
|
+
|
889
|
+
await python_mount._deploy.aio(
|
890
|
+
mount_name,
|
891
|
+
api_pb2.DEPLOYMENT_NAMESPACE_GLOBAL,
|
892
|
+
environment_name=profile_environment,
|
893
|
+
client=client,
|
894
|
+
)
|
895
|
+
print(f"✅ Deployed mount {mount_name} to global namespace.")
|
896
|
+
|
897
|
+
|
898
|
+
async def _create_client_dependency_mounts(client=None, check_if_exists=True):
|
899
|
+
for python_version in PYTHON_STANDALONE_VERSIONS:
|
900
|
+
# glibc >= 2.17
|
901
|
+
await _create_single_mount(
|
902
|
+
client,
|
903
|
+
"PREVIEW",
|
904
|
+
python_version,
|
905
|
+
"manylinux_2_17",
|
906
|
+
"x86_64",
|
907
|
+
check_if_exists=check_if_exists,
|
908
|
+
)
|
909
|
+
# musl >= 1.2
|
910
|
+
await _create_single_mount(
|
911
|
+
client,
|
912
|
+
"PREVIEW",
|
913
|
+
python_version,
|
914
|
+
"musllinux_1_2",
|
915
|
+
"x86_64",
|
916
|
+
uv_python_platform="x86_64-unknown-linux-musl",
|
917
|
+
check_if_exists=check_if_exists,
|
918
|
+
)
|
modal/mount.pyi
CHANGED
@@ -308,6 +308,16 @@ def _create_client_mount(): ...
|
|
308
308
|
def create_client_mount(): ...
|
309
309
|
def _get_client_mount(): ...
|
310
310
|
def _is_modal_path(remote_path: pathlib.PurePosixPath): ...
|
311
|
+
async def _create_single_mount(
|
312
|
+
client: modal.client._Client,
|
313
|
+
builder_version: str,
|
314
|
+
python_version: str,
|
315
|
+
platform: str,
|
316
|
+
arch: str,
|
317
|
+
uv_python_platform: str = None,
|
318
|
+
check_if_exists: bool = True,
|
319
|
+
): ...
|
320
|
+
async def _create_client_dependency_mounts(client=None, check_if_exists=True): ...
|
311
321
|
|
312
322
|
ROOT_DIR: pathlib.PurePosixPath
|
313
323
|
|
@@ -22,7 +22,7 @@ modal/app.py,sha256=NZ_rJ9TuMfiNiLg8-gOFgufD5flGtXWPHOZI0gdD3hE,46585
|
|
22
22
|
modal/app.pyi,sha256=4-b_vbe3lNAqQPcMRpQCEDsE1zsVkQRJGUql9B7HvbM,22659
|
23
23
|
modal/call_graph.py,sha256=1g2DGcMIJvRy-xKicuf63IVE98gJSnQsr8R_NVMptNc,2581
|
24
24
|
modal/client.py,sha256=OwISJvkgMb-rHm9Gc4i-7YcDgGiZgwJ7F_PzwZH7a6Q,16847
|
25
|
-
modal/client.pyi,sha256=
|
25
|
+
modal/client.pyi,sha256=QUoGEwaoBSTwuYOm5lxkoy6levWmuNd9RhqaWMcn2Ks,8459
|
26
26
|
modal/cloud_bucket_mount.py,sha256=YOe9nnvSr4ZbeCn587d7_VhE9IioZYRvF9VYQTQux08,5914
|
27
27
|
modal/cloud_bucket_mount.pyi,sha256=30T3K1a89l6wzmEJ_J9iWv9SknoGqaZDx59Xs-ZQcmk,1607
|
28
28
|
modal/cls.py,sha256=dBbeARwOWftlKd1cwtM0cHFtQWSWkwVXwVmOV4w0SyI,37907
|
@@ -45,8 +45,8 @@ modal/image.py,sha256=yrI9DCw7GAck3d788GCHJom-_yU55zNu7reNapBhlgE,93284
|
|
45
45
|
modal/image.pyi,sha256=2xjB6XOZDtm_chDdd90UoIj8pnDt5hCg6bOmu5fNaA4,25625
|
46
46
|
modal/io_streams.py,sha256=YDZVQSDv05DeXg5TwcucC9Rj5hQBx2GXdluan9rIUpw,15467
|
47
47
|
modal/io_streams.pyi,sha256=1UK6kWLREASQfq-wL9wSp5iqjLU0egRZPDn4LXs1PZY,5136
|
48
|
-
modal/mount.py,sha256=
|
49
|
-
modal/mount.pyi,sha256=
|
48
|
+
modal/mount.py,sha256=09D3DZZ_kcvUHGflYZLhEza-216esnY0J_je8dG9Z9U,34136
|
49
|
+
modal/mount.pyi,sha256=WXWU-qhOvHzX2sfoToO0l0RR3k3PtfQkk5at8tBbg1g,12839
|
50
50
|
modal/network_file_system.py,sha256=lgtmHYjzA5gDMx0tysH0-WJB2Ao9JD2W15NyYK2A7_w,14612
|
51
51
|
modal/network_file_system.pyi,sha256=58DiUqHGlARmI3cz-Yo7IFObKKFIiGh5UIU5JxGNFfc,8333
|
52
52
|
modal/object.py,sha256=bTeskuY8JFrESjU4_UL_nTwYlBQdOLmVaOX3X6EMxsg,164
|
@@ -147,7 +147,7 @@ modal/requirements/2024.10.txt,sha256=qD-5cVIVM9wXesJ6JC89Ew-3m2KjEElUz3jaw_MddR
|
|
147
147
|
modal/requirements/PREVIEW.txt,sha256=qD-5cVIVM9wXesJ6JC89Ew-3m2KjEElUz3jaw_MddRo,296
|
148
148
|
modal/requirements/README.md,sha256=9tK76KP0Uph7O0M5oUgsSwEZDj5y-dcUPsnpR0Sc-Ik,854
|
149
149
|
modal/requirements/base-images.json,sha256=57vMSqzMbLBxw5tFWSaMiIkkVEps4JfX5PAtXGnkS4U,740
|
150
|
-
modal-1.0.3.
|
150
|
+
modal-1.0.3.dev15.dist-info/licenses/LICENSE,sha256=psuoW8kuDP96RQsdhzwOqi6fyWv0ct8CR6Jr7He_P_k,10173
|
151
151
|
modal_docs/__init__.py,sha256=svYKtV8HDwDCN86zbdWqyq5T8sMdGDj0PVlzc2tIxDM,28
|
152
152
|
modal_docs/gen_cli_docs.py,sha256=c1yfBS_x--gL5bs0N4ihMwqwX8l3IBWSkBAKNNIi6bQ,3801
|
153
153
|
modal_docs/gen_reference_docs.py,sha256=d_CQUGQ0rfw28u75I2mov9AlS773z9rG40-yq5o7g2U,6359
|
@@ -170,10 +170,10 @@ modal_proto/options_pb2.pyi,sha256=l7DBrbLO7q3Ir-XDkWsajm0d0TQqqrfuX54i4BMpdQg,1
|
|
170
170
|
modal_proto/options_pb2_grpc.py,sha256=1oboBPFxaTEXt9Aw7EAj8gXHDCNMhZD2VXqocC9l_gk,159
|
171
171
|
modal_proto/options_pb2_grpc.pyi,sha256=CImmhxHsYnF09iENPoe8S4J-n93jtgUYD2JPAc0yJSI,247
|
172
172
|
modal_proto/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
173
|
-
modal_version/__init__.py,sha256=
|
173
|
+
modal_version/__init__.py,sha256=nhZQzIRo7pNOYSOk9Ai6sukHfeD8MkEVXeJzDWXrCA8,121
|
174
174
|
modal_version/__main__.py,sha256=2FO0yYQQwDTh6udt1h-cBnGd1c4ZyHnHSI4BksxzVac,105
|
175
|
-
modal-1.0.3.
|
176
|
-
modal-1.0.3.
|
177
|
-
modal-1.0.3.
|
178
|
-
modal-1.0.3.
|
179
|
-
modal-1.0.3.
|
175
|
+
modal-1.0.3.dev15.dist-info/METADATA,sha256=PaclYqvtjjtq1HCPVgwr33rVoub1OXTvuupC3yxxIdk,2455
|
176
|
+
modal-1.0.3.dev15.dist-info/WHEEL,sha256=1tXe9gY0PYatrMPMDd6jXqjfpz_B-Wqm32CPfRC58XU,91
|
177
|
+
modal-1.0.3.dev15.dist-info/entry_points.txt,sha256=An-wYgeEUnm6xzrAP9_NTSTSciYvvEWsMZILtYrvpAI,46
|
178
|
+
modal-1.0.3.dev15.dist-info/top_level.txt,sha256=4BWzoKYREKUZ5iyPzZpjqx4G8uB5TWxXPDwibLcVa7k,43
|
179
|
+
modal-1.0.3.dev15.dist-info/RECORD,,
|
modal_version/__init__.py
CHANGED
File without changes
|
File without changes
|
File without changes
|
File without changes
|