xoscar 0.5.0__cp312-cp312-win_amd64.whl → 0.6.1__cp312-cp312-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.4
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.cp312-win_amd64.pyd,sha256=8NyU8l1Ry0wrL6uyQ6uz7S1RfweShrkMT49OhTObEpE,115200
2
+ xoscar/_utils.cp312-win_amd64.pyd,sha256=F5HgysVkOq002rjMABZIcD_e327__tfFMNJ_BTOXqkQ,115200
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.cp312-win_amd64.pyd,sha256=7U2dwV4lu5i5fOojm6rtofVuWqM9ZmmrM5IaivJ0PO0,159232
10
+ xoscar/context.cp312-win_amd64.pyd,sha256=POAloHOGLuW5ex3miMqfXXb6AN5my6rEPVZyaYg4AjA,159232
11
11
  xoscar/context.pxd,sha256=6n6IAbmArSRq8EjcsbS6npW8xP1jI0qOoS1fF0oyj-o,746
12
12
  xoscar/context.pyx,sha256=FOJVerGOvxe2USryXEQA0rpaFX_ScxISH6QWKUcahY8,11310
13
- xoscar/core.cp312-win_amd64.pyd,sha256=05EoUF9RdrSAZb9iUpbbEYXJ9HlBaa15yWo8s83jvTQ,332800
13
+ xoscar/core.cp312-win_amd64.pyd,sha256=yPV6xg3GctgMWwFr4fmqFyBgngGjf3Snnzhek7ZwUyg,332800
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,10 +30,10 @@ 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.cp312-win_amd64.pyd,sha256=iupkNtr-0T_ortk8l7AYmURaMqCxCe9O7S68sMSu0yE,284160
33
+ xoscar/backends/message.cp312-win_amd64.pyd,sha256=dc4Cpoycp1weUWmSkC_AOS0P05oDz9J7oWah_2pF6aY,284160
34
34
  xoscar/backends/message.pyi,sha256=m1PrSLvj-IbrHuVfQGoPDs6prI-GJV1vQJqZ5WdQcY4,6798
35
35
  xoscar/backends/message.pyx,sha256=lBEjMJv4VyxmeO9lHXJJazOajbFnTLak4PSBcLoPZvU,20331
36
- xoscar/backends/pool.py,sha256=lAYfLUqwhEvYOQWrP35dgYJf9aiT-14Leb4ohhwFrOs,62526
36
+ xoscar/backends/pool.py,sha256=XFij5l9FCbMC1isXp4tpr6YsZVxf4GfpIRfwn-nhCGE,62638
37
37
  xoscar/backends/router.py,sha256=EjfNpQUrhFU15eYe1kRPueziHgI2gfDViUzm7ruvXDE,10817
38
38
  xoscar/backends/communication/__init__.py,sha256=i0RWfN_no-xwlzLUl8Av8zZqVWxfgBaT2qbUvOLt37s,1093
39
39
  xoscar/backends/communication/base.py,sha256=wmWTeE4lcB_ohqyJJ6MdzMGcrOqy2RSKRp8y-NDuFdY,7736
@@ -55,8 +55,8 @@ xoscar/collective/common.py,sha256=9c7xq3IOUvfA0I9GnpalUqXZOzmF6IEILv4zL64BYVE,3
55
55
  xoscar/collective/core.py,sha256=191aPxbUgWpjzrqyozndImDAQhZFmqoQdBkHFLDfXN0,24239
56
56
  xoscar/collective/process_group.py,sha256=kTPbrLMJSGhqbiWvTIiz-X3W0rZWd_CFn_zUIlXbOlM,23286
57
57
  xoscar/collective/utils.py,sha256=p3WEVtXvnVhkuO5mRgQBhBRFr1dKHcDKMjrbMyuiyfg,1219
58
- xoscar/collective/uv.dll,sha256=RWUm0NFbO7BAcX99bSdoos6O6TTVbQH8fyJUVMXoyTI,620544
59
- xoscar/collective/xoscar_pygloo.cp312-win_amd64.pyd,sha256=HDrGERwlrkhRTj31RSORfh1X5dc6z6MwkFJ1rAd6umE,838656
58
+ xoscar/collective/uv.dll,sha256=orvjry-kfe2ATrhPoL7n5MZ9yOOIUj-1NOJZtcqiSfg,620544
59
+ xoscar/collective/xoscar_pygloo.cp312-win_amd64.pyd,sha256=5ABt2tu3sNzuQQUI0Slshj7n2KiAonJiCn1OsWTapfg,838656
60
60
  xoscar/collective/xoscar_pygloo.pyi,sha256=6KRzElgNBBKWh-VivUw1b5Dolp17MgwA91hQo33EysU,7616
61
61
  xoscar/metrics/__init__.py,sha256=RjXuuYw4I2YYgD8UY2Z5yCZk0Z56xMJ1n40O80Dtxf8,726
62
62
  xoscar/metrics/api.py,sha256=dtJ4QrIqQNXhJedeqOPs4TXKgrRGZFFN50xAd9SCfec,9144
@@ -68,7 +68,7 @@ xoscar/metrics/backends/prometheus/__init__.py,sha256=ZHepfhCDRuK9yz4pAM7bjpWDvS
68
68
  xoscar/metrics/backends/prometheus/prometheus_metric.py,sha256=65hb8O3tmsEJ7jgOrIwl_suj9SE5Tmqcfjuk0urkLvE,2120
69
69
  xoscar/serialization/__init__.py,sha256=tS8C49yrW_geWNEsbgW3phK1q4YN1ojI6CN-vroIFYM,876
70
70
  xoscar/serialization/aio.py,sha256=7YLXgkWpQ3ANy-TZ1qO8Mt4_J3cZFhFh2FEgUgxMT60,4873
71
- xoscar/serialization/core.cp312-win_amd64.pyd,sha256=n8GKDu33-prkCugvG95EreWvrLcFE9hoKZa_xlKY-Nk,292352
71
+ xoscar/serialization/core.cp312-win_amd64.pyd,sha256=NiHAxov2SddScjoplPSzy1eJXac48A2hlWKeiUHz4Fs,292352
72
72
  xoscar/serialization/core.pxd,sha256=X-47bqBM2Kzw5SkLqICdKD0gU6CpmLsBxC3kfW--wVk,1013
73
73
  xoscar/serialization/core.pyi,sha256=Zof9373qy2lmjenSuMznEiTSCNW6WQB7rmSXrRbjUo0,1931
74
74
  xoscar/serialization/core.pyx,sha256=ZKexLRnRwZXXn2045kR7xfM_szcoPNrDuouQCWtpFp8,30570
@@ -78,7 +78,10 @@ xoscar/serialization/mlx.py,sha256=02-GmVptgtnBr9m21BYHu3POlJXZWLqwlI44T_ZBx9o,1
78
78
  xoscar/serialization/numpy.py,sha256=C6WVx-Sdl2OHBAvVY34DFjAKXlekMbpc2ni6bR8wxYo,3001
79
79
  xoscar/serialization/pyfury.py,sha256=3ucal29Hr7PX9_1SfB2x43FE2xw_C0rLkVv3foL7qwM,1200
80
80
  xoscar/serialization/scipy.py,sha256=9ph-yoRoNiwUZTwQrn35U60VPirWlncXNAg6EXvqMR4,2554
81
- xoscar-0.5.0.dist-info/METADATA,sha256=aIzbEwBn0t26gdUWTwFfcYfAHBDz5BK2vTvbcRM4xgw,9322
82
- xoscar-0.5.0.dist-info/WHEEL,sha256=ovhA9_Ei_7ok2fAych90j-feDV4goiAxbO7REePtvw0,101
83
- xoscar-0.5.0.dist-info/top_level.txt,sha256=vYlqqY4Nys8Thm1hePIuUv8eQePdULVWMmt7lXtX_ZA,21
84
- xoscar-0.5.0.dist-info/RECORD,,
81
+ xoscar/virtualenv/__init__.py,sha256=rhJ7I6x7aXjKOCzSqsKLwqFJMh4YC2sqchEIJNEfI58,1151
82
+ xoscar/virtualenv/core.py,sha256=pk6Pcv2Aewk1d-oTau1wyP80p8McIi7DodWL9PcDg1Q,1311
83
+ xoscar/virtualenv/uv.py,sha256=xNNjv8Ywkwx6I1B_yQr8nkEUgJbIFNaseUCzWIo41nY,2921
84
+ xoscar-0.6.1.dist-info/METADATA,sha256=BGSToAYYH4Z9MgyCE8p4eat7ruvLtg5sYAoKwQCInCA,9357
85
+ xoscar-0.6.1.dist-info/WHEEL,sha256=ovhA9_Ei_7ok2fAych90j-feDV4goiAxbO7REePtvw0,101
86
+ xoscar-0.6.1.dist-info/top_level.txt,sha256=vYlqqY4Nys8Thm1hePIuUv8eQePdULVWMmt7lXtX_ZA,21
87
+ xoscar-0.6.1.dist-info/RECORD,,
File without changes