xoscar 0.5.0__cp310-cp310-win_amd64.whl → 0.6.1__cp310-cp310-win_amd64.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.

Potentially problematic release.


This version of xoscar might be problematic. Click here for more details.

Binary file
Binary file
xoscar/backends/pool.py CHANGED
@@ -22,6 +22,7 @@ import itertools
22
22
  import logging
23
23
  import multiprocessing
24
24
  import os
25
+ import sys
25
26
  import threading
26
27
  import traceback
27
28
  from abc import ABC, ABCMeta, abstractmethod
@@ -824,6 +825,9 @@ class ActorPoolBase(AbstractActorPool, metaclass=ABCMeta):
824
825
  with _disable_log_temporally():
825
826
  TypeDispatcher.reload_all_lazy_handlers()
826
827
 
828
+ if "PYTHONPATH" in os.environ:
829
+ sys.path.insert(0, os.environ["PYTHONPATH"])
830
+
827
831
  def handle_channel(channel):
828
832
  return pool.on_new_channel(channel)
829
833
 
xoscar/collective/uv.dll CHANGED
Binary file
Binary file
Binary file
@@ -0,0 +1,34 @@
1
+ # Copyright 2022-2025 XProbe Inc.
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # http://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+
15
+ from __future__ import annotations
16
+
17
+ from pathlib import Path
18
+
19
+ from .core import VirtualEnvManager
20
+ from .uv import UVVirtualEnvManager
21
+
22
+ _name_to_managers = {"uv": UVVirtualEnvManager}
23
+
24
+
25
+ def get_virtual_env_manager(env_name: str, env_path: str | Path) -> VirtualEnvManager:
26
+ try:
27
+ manager_cls = _name_to_managers[env_name]
28
+ except KeyError:
29
+ raise ValueError(
30
+ f"Unknown virtualenv manager {env_name}, available: {list(_name_to_managers)}"
31
+ )
32
+
33
+ path = Path(env_path)
34
+ return manager_cls(path)
@@ -0,0 +1,48 @@
1
+ # Copyright 2022-2025 XProbe Inc.
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # http://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+
15
+ from __future__ import annotations
16
+
17
+ from abc import ABC, abstractmethod
18
+ from pathlib import Path
19
+
20
+
21
+ class VirtualEnvManager(ABC):
22
+ @classmethod
23
+ @abstractmethod
24
+ def is_available(cls):
25
+ pass
26
+
27
+ def __init__(self, env_path: Path):
28
+ self.env_path = env_path.resolve()
29
+
30
+ @abstractmethod
31
+ def create_env(self, python_path: Path | None = None) -> None:
32
+ pass
33
+
34
+ @abstractmethod
35
+ def install_packages(self, packages: list[str], **kwargs):
36
+ pass
37
+
38
+ @abstractmethod
39
+ def cancel_install(self):
40
+ pass
41
+
42
+ @abstractmethod
43
+ def get_lib_path(self) -> str:
44
+ pass
45
+
46
+ @abstractmethod
47
+ def remove_env(self):
48
+ pass
@@ -0,0 +1,79 @@
1
+ # Copyright 2022-2025 XProbe Inc.
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # http://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+
15
+ from __future__ import annotations
16
+
17
+ import shutil
18
+ import subprocess
19
+ import sysconfig
20
+ from pathlib import Path
21
+ from typing import Optional
22
+
23
+ from .core import VirtualEnvManager
24
+
25
+
26
+ class UVVirtualEnvManager(VirtualEnvManager):
27
+ def __init__(self, env_path: Path):
28
+ super().__init__(env_path)
29
+ self._install_process: Optional[subprocess.Popen] = None
30
+
31
+ @classmethod
32
+ def is_available(cls):
33
+ return shutil.which("uv") is not None
34
+
35
+ def create_env(self, python_path: Path | None = None) -> None:
36
+ cmd = ["uv", "venv", str(self.env_path)]
37
+ if python_path:
38
+ cmd += ["--python", str(python_path)]
39
+ subprocess.run(cmd, check=True)
40
+
41
+ def install_packages(self, packages: list[str], **kwargs):
42
+ """
43
+ Install packages into the virtual environment using uv.
44
+ Supports pip-compatible kwargs: index_url, extra_index_url, find_links.
45
+ """
46
+ if not packages:
47
+ return
48
+
49
+ cmd = ["uv", "pip", "install", "-p", str(self.env_path)] + packages
50
+
51
+ # Handle known pip-related kwargs
52
+ if "index_url" in kwargs and kwargs["index_url"]:
53
+ cmd += ["-i", kwargs["index_url"]]
54
+ if "extra_index_url" in kwargs and kwargs["extra_index_url"]:
55
+ cmd += ["--extra-index-url", kwargs["extra_index_url"]]
56
+ if "find_links" in kwargs and kwargs["find_links"]:
57
+ cmd += ["-f", kwargs["find_links"]]
58
+ if "trusted_host" in kwargs and kwargs["trusted_host"]:
59
+ cmd += ["--trusted-host", kwargs["trusted_host"]]
60
+
61
+ self._install_process = process = subprocess.Popen(cmd)
62
+ returncode = process.wait()
63
+
64
+ self._install_process = None # install finished, clear reference
65
+
66
+ if returncode != 0:
67
+ raise subprocess.CalledProcessError(returncode, cmd)
68
+
69
+ def cancel_install(self):
70
+ if self._install_process and self._install_process.poll() is None:
71
+ self._install_process.terminate()
72
+ self._install_process.wait()
73
+
74
+ def get_lib_path(self) -> str:
75
+ return sysconfig.get_path("purelib", vars={"base": str(self.env_path)})
76
+
77
+ def remove_env(self):
78
+ if self.env_path.exists():
79
+ shutil.rmtree(self.env_path, ignore_errors=True)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: xoscar
3
- Version: 0.5.0
3
+ Version: 0.6.1
4
4
  Summary: Python actor framework for heterogeneous computing.
5
5
  Home-page: http://github.com/xorbitsai/xoscar
6
6
  Author: Qin Xuye
@@ -40,6 +40,7 @@ Requires-Dist: pydata-sphinx-theme>=0.3.0; extra == "dev"
40
40
  Requires-Dist: sphinx-intl>=0.9.9; extra == "dev"
41
41
  Requires-Dist: flake8>=3.8.0; extra == "dev"
42
42
  Requires-Dist: black; extra == "dev"
43
+ Requires-Dist: uv; extra == "dev"
43
44
  Provides-Extra: doc
44
45
  Requires-Dist: ipython>=6.5.0; extra == "doc"
45
46
  Requires-Dist: sphinx; extra == "doc"
@@ -1,5 +1,5 @@
1
1
  xoscar/__init__.py,sha256=dlwtB7dnDp5WME6CZVQY7d9lk1yJ9s___H5UxjGlAd4,1668
2
- xoscar/_utils.cp310-win_amd64.pyd,sha256=MpHLDoMyGnViWMALxdx7IVKW6CDbS7X0Vk0ue2X2-Jc,117248
2
+ xoscar/_utils.cp310-win_amd64.pyd,sha256=Hn4TjHfIu0nDmQfMQQIAV9cQceZG2IJERtSBhFhQ_yg,117248
3
3
  xoscar/_utils.pxd,sha256=rlNbTg5lhXA-jCOLksqF4jhUlNn0xw2jx1HxdLa34pc,1193
4
4
  xoscar/_utils.pyx,sha256=18MUutw6M8Het9FcnrDMjexiJ3zxYljpTNRiYKGD-Jw,7524
5
5
  xoscar/_version.py,sha256=bsfCVAo_o9LkiP3AjPsP4SRRqhjuS0t4D1WGJPzbdls,24412
@@ -7,10 +7,10 @@ xoscar/api.py,sha256=B5oXv4vgMxMteh1YNaBmNFDrUFmYa_dCdzfaWwwZnCo,13820
7
7
  xoscar/backend.py,sha256=8G5JwjoOT6Q2slb11eXNApxgcmvNQUCdQzkoIMDwLcQ,1917
8
8
  xoscar/batch.py,sha256=Jk5BSpvMFAV9DrRy0a9tgPvIo_dt8cbJReZBL0cnOPc,8128
9
9
  xoscar/constants.py,sha256=GJ1KEOxwnqksc9K_GH42TSWpQECeC6ti3KJmE3PUcTw,810
10
- xoscar/context.cp310-win_amd64.pyd,sha256=aTmgglVPNiALXKGEOBluwrz9Wm2kEHUTihWdEIxzKJs,158208
10
+ xoscar/context.cp310-win_amd64.pyd,sha256=rHMkSsL7q4r9aBI7py6tb6IcMIMDZmMM-gLt1ZsZYSQ,158208
11
11
  xoscar/context.pxd,sha256=6n6IAbmArSRq8EjcsbS6npW8xP1jI0qOoS1fF0oyj-o,746
12
12
  xoscar/context.pyx,sha256=FOJVerGOvxe2USryXEQA0rpaFX_ScxISH6QWKUcahY8,11310
13
- xoscar/core.cp310-win_amd64.pyd,sha256=4-94GIBFy-6ICD_5jjjwQGLw-3yGT0lphr5y57TwP5A,336896
13
+ xoscar/core.cp310-win_amd64.pyd,sha256=uiqIXjDDmdhq0tJt36fG9QzJNlnw4LIpQv3E6QhJEIM,336896
14
14
  xoscar/core.pxd,sha256=9IZP7dYGfnF1I-obIls8R8b6forxDOPbiM3v5nVslLk,1368
15
15
  xoscar/core.pyx,sha256=U6jCZN74MQHi7HkQRaVGm_w5q-FMsw0nnE3aU6533_Q,22756
16
16
  xoscar/debug.py,sha256=hrmxIH6zvTKasQo6PUUgXu5mgEsR0g87Fvpw7CoHipg,5257
@@ -30,9 +30,9 @@ xoscar/backends/allocate_strategy.py,sha256=DzvTlixwzTANURI2mDLHm3vcaugSPDxU6UQZ
30
30
  xoscar/backends/config.py,sha256=86j0g_Xrl8ENPzBWi296yWg9QEcljvdKK-yJbfYTvQ0,5532
31
31
  xoscar/backends/context.py,sha256=qWwksx8JxYcKR-LQA3PvXh4ReuuTTEyDaLbjpxGXcTA,16766
32
32
  xoscar/backends/core.py,sha256=fbekAxys_t1Dv7if-1R6uVvC_yAxNkXLeQ1V1ZSAfC0,11161
33
- xoscar/backends/message.cp310-win_amd64.pyd,sha256=kgLdppvvVYJbkkV-22Ccb91HU6-234UmTf_2beQVUcY,283648
33
+ xoscar/backends/message.cp310-win_amd64.pyd,sha256=7lqP7pQYsRr_LmJ1Qww3jhB5W5HAGSzTJ79vFve78T4,283648
34
34
  xoscar/backends/message.pyx,sha256=lBEjMJv4VyxmeO9lHXJJazOajbFnTLak4PSBcLoPZvU,20331
35
- xoscar/backends/pool.py,sha256=lAYfLUqwhEvYOQWrP35dgYJf9aiT-14Leb4ohhwFrOs,62526
35
+ xoscar/backends/pool.py,sha256=XFij5l9FCbMC1isXp4tpr6YsZVxf4GfpIRfwn-nhCGE,62638
36
36
  xoscar/backends/router.py,sha256=EjfNpQUrhFU15eYe1kRPueziHgI2gfDViUzm7ruvXDE,10817
37
37
  xoscar/backends/communication/__init__.py,sha256=i0RWfN_no-xwlzLUl8Av8zZqVWxfgBaT2qbUvOLt37s,1093
38
38
  xoscar/backends/communication/base.py,sha256=wmWTeE4lcB_ohqyJJ6MdzMGcrOqy2RSKRp8y-NDuFdY,7736
@@ -54,8 +54,8 @@ xoscar/collective/common.py,sha256=9c7xq3IOUvfA0I9GnpalUqXZOzmF6IEILv4zL64BYVE,3
54
54
  xoscar/collective/core.py,sha256=191aPxbUgWpjzrqyozndImDAQhZFmqoQdBkHFLDfXN0,24239
55
55
  xoscar/collective/process_group.py,sha256=kTPbrLMJSGhqbiWvTIiz-X3W0rZWd_CFn_zUIlXbOlM,23286
56
56
  xoscar/collective/utils.py,sha256=p3WEVtXvnVhkuO5mRgQBhBRFr1dKHcDKMjrbMyuiyfg,1219
57
- xoscar/collective/uv.dll,sha256=bfXdUaj7IRYtiwsujckGJ7RqX4Kk821-1gi5kzvIOow,620544
58
- xoscar/collective/xoscar_pygloo.cp310-win_amd64.pyd,sha256=T_GqNw0Elpg4DO-YGCl2uhaDMm6vO_Jx0LtrXEwV76c,829952
57
+ xoscar/collective/uv.dll,sha256=nmERAXSPqpgHqnv2_LACxMnA9QTOMUTJSUrHHxlKsdc,620544
58
+ xoscar/collective/xoscar_pygloo.cp310-win_amd64.pyd,sha256=1depBs5XzlR0PH43dvuWLbHBUyFsHyMO4ArjYmIa2Bg,829952
59
59
  xoscar/metrics/__init__.py,sha256=RjXuuYw4I2YYgD8UY2Z5yCZk0Z56xMJ1n40O80Dtxf8,726
60
60
  xoscar/metrics/api.py,sha256=dtJ4QrIqQNXhJedeqOPs4TXKgrRGZFFN50xAd9SCfec,9144
61
61
  xoscar/metrics/backends/__init__.py,sha256=ZHepfhCDRuK9yz4pAM7bjpWDvS3Ijp1YgyynoUFLeuU,594
@@ -66,7 +66,7 @@ xoscar/metrics/backends/prometheus/__init__.py,sha256=ZHepfhCDRuK9yz4pAM7bjpWDvS
66
66
  xoscar/metrics/backends/prometheus/prometheus_metric.py,sha256=65hb8O3tmsEJ7jgOrIwl_suj9SE5Tmqcfjuk0urkLvE,2120
67
67
  xoscar/serialization/__init__.py,sha256=tS8C49yrW_geWNEsbgW3phK1q4YN1ojI6CN-vroIFYM,876
68
68
  xoscar/serialization/aio.py,sha256=7YLXgkWpQ3ANy-TZ1qO8Mt4_J3cZFhFh2FEgUgxMT60,4873
69
- xoscar/serialization/core.cp310-win_amd64.pyd,sha256=F94mNi1CSkX8zvZl4law5jILyUerTRoWi9OkE1MbtEM,299520
69
+ xoscar/serialization/core.cp310-win_amd64.pyd,sha256=ipt32mCdwaecacP0KXGWLOjua9WZtxfjmWMT9eyG1mw,299520
70
70
  xoscar/serialization/core.pxd,sha256=X-47bqBM2Kzw5SkLqICdKD0gU6CpmLsBxC3kfW--wVk,1013
71
71
  xoscar/serialization/core.pyx,sha256=ZKexLRnRwZXXn2045kR7xfM_szcoPNrDuouQCWtpFp8,30570
72
72
  xoscar/serialization/cuda.py,sha256=Fj4Cpr_YmkGceUCo0mQn8fRvmHP_5WcLdRx6epZ3RC0,3869
@@ -75,7 +75,10 @@ xoscar/serialization/mlx.py,sha256=02-GmVptgtnBr9m21BYHu3POlJXZWLqwlI44T_ZBx9o,1
75
75
  xoscar/serialization/numpy.py,sha256=C6WVx-Sdl2OHBAvVY34DFjAKXlekMbpc2ni6bR8wxYo,3001
76
76
  xoscar/serialization/pyfury.py,sha256=3ucal29Hr7PX9_1SfB2x43FE2xw_C0rLkVv3foL7qwM,1200
77
77
  xoscar/serialization/scipy.py,sha256=9ph-yoRoNiwUZTwQrn35U60VPirWlncXNAg6EXvqMR4,2554
78
- xoscar-0.5.0.dist-info/METADATA,sha256=yN7Wis0PRpzNbPOj5w08bAqoOXRyaSQPQ2ndWuOomOY,9265
79
- xoscar-0.5.0.dist-info/WHEEL,sha256=NVXpD7b4Gxps0cd2ds5rr5TG8W4ApEwx_i5J99qMZ5E,102
80
- xoscar-0.5.0.dist-info/top_level.txt,sha256=vYlqqY4Nys8Thm1hePIuUv8eQePdULVWMmt7lXtX_ZA,21
81
- xoscar-0.5.0.dist-info/RECORD,,
78
+ xoscar/virtualenv/__init__.py,sha256=rhJ7I6x7aXjKOCzSqsKLwqFJMh4YC2sqchEIJNEfI58,1151
79
+ xoscar/virtualenv/core.py,sha256=pk6Pcv2Aewk1d-oTau1wyP80p8McIi7DodWL9PcDg1Q,1311
80
+ xoscar/virtualenv/uv.py,sha256=xNNjv8Ywkwx6I1B_yQr8nkEUgJbIFNaseUCzWIo41nY,2921
81
+ xoscar-0.6.1.dist-info/METADATA,sha256=7Qhpj9UNCrGu-3Sgfg2VW9QLaJNr5R_bzZDnlNKkkBE,9300
82
+ xoscar-0.6.1.dist-info/WHEEL,sha256=NVXpD7b4Gxps0cd2ds5rr5TG8W4ApEwx_i5J99qMZ5E,102
83
+ xoscar-0.6.1.dist-info/top_level.txt,sha256=vYlqqY4Nys8Thm1hePIuUv8eQePdULVWMmt7lXtX_ZA,21
84
+ xoscar-0.6.1.dist-info/RECORD,,
File without changes