xoscar 0.5.0__cp39-cp39-macosx_10_9_x86_64.whl → 0.6.1__cp39-cp39-macosx_10_9_x86_64.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
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
 
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,7 +1,7 @@
1
- xoscar-0.5.0.dist-info/RECORD,,
2
- xoscar-0.5.0.dist-info/WHEEL,sha256=FoxzhRRMXcm8mSmqIxEPOmfhajsNIlMLdYtHdyz-ZKQ,109
3
- xoscar-0.5.0.dist-info/top_level.txt,sha256=vYlqqY4Nys8Thm1hePIuUv8eQePdULVWMmt7lXtX_ZA,21
4
- xoscar-0.5.0.dist-info/METADATA,sha256=O_aAm6bQaZF9HvTXJsquvDrePWla--QdgpuPPnlqFds,9042
1
+ xoscar-0.6.1.dist-info/RECORD,,
2
+ xoscar-0.6.1.dist-info/WHEEL,sha256=FoxzhRRMXcm8mSmqIxEPOmfhajsNIlMLdYtHdyz-ZKQ,109
3
+ xoscar-0.6.1.dist-info/top_level.txt,sha256=vYlqqY4Nys8Thm1hePIuUv8eQePdULVWMmt7lXtX_ZA,21
4
+ xoscar-0.6.1.dist-info/METADATA,sha256=G1ypXuZl-ZjV48coc-vldRpkEeOq43k5BXIBowvxmo0,9076
5
5
  xoscar/_utils.pyx,sha256=6iqO4eTwEI-n9i39n_TKz7MWqbytMRnVNubdJ5egL6o,7279
6
6
  xoscar/backend.py,sha256=is436OPkZfSpQXaoqTRVta5eoye_pp45RFgCstAk2hU,1850
7
7
  xoscar/core.pxd,sha256=I_C2ka7XryyGnnAVXUVm8xfS1gtIrCs6X-9rswgOcUU,1317
@@ -12,18 +12,18 @@ xoscar/nvutils.py,sha256=qmW4mKLU0WB2yCs198ccQOgLL02zB7Fsa-AotO3NOmg,20412
12
12
  xoscar/constants.py,sha256=QHHSREw6uWBBjQDCFqlNfTvBZgniJPGy42KSIsR8Fqw,787
13
13
  xoscar/__init__.py,sha256=0zX8kKaio3ZIrlzB79WybcravMJw1OxPWjDspTgJFyQ,1608
14
14
  xoscar/api.py,sha256=3hztPoOxg8A_mlhWyWgVP7FMXG0PATA1TP4Rbaj7A-g,13327
15
- xoscar/core.cpython-39-darwin.so,sha256=INsThHiTYThtL2sNVg7reDo-i0x4Kryxz6t6KIkZBDU,448640
15
+ xoscar/core.cpython-39-darwin.so,sha256=VocFQ0Q-nZoKXOqrA_f2szSe2AUYkInd3TVRLZwXYos,448640
16
16
  xoscar/utils.py,sha256=jUw6OICZUPBbmS1b3GE4vLctJf6fCKXrYtLtBuK-Oqc,16483
17
17
  xoscar/debug.py,sha256=9Z8SgE2WaKYQcyDo-5-DxEJQ533v7kWjrvCd28pSx3E,5069
18
18
  xoscar/libcpp.pxd,sha256=DJqBxLFOKL4iRr9Kale5UH3rbvPRD1x5bTSOPHFpz9I,1147
19
19
  xoscar/context.pyx,sha256=8CdgPnWcE9eOp3N600WgDQ03MCi8P73eUOGcfV7Zksg,10942
20
20
  xoscar/errors.py,sha256=wBlQOKsXf0Fc4skN39tDie0YZT-VIAuLNRgoDl2pZcA,1241
21
- xoscar/_utils.cpython-39-darwin.so,sha256=Hbzr7kqgG9qv_mzPChsKy_w-lErCREJD8O0GYsLAxo0,160888
21
+ xoscar/_utils.cpython-39-darwin.so,sha256=n2MQVT9wHWvub1jwlSe9RvjnqV6a8AsogpB9OzcLWAs,160888
22
22
  xoscar/core.pyx,sha256=phN-yYV0A0QI8WFi2jCu0nc4CnShTepfDi0V7ZrLYPY,22092
23
23
  xoscar/driver.py,sha256=498fowtJr6b3FE8FIOA_Tc1Vwx88nfZw7p0FxrML0h4,1372
24
24
  xoscar/profiling.py,sha256=BC5OF0HzSaXv8V7w-y-B8r5gV5DgxHFoTEIF6jCMioQ,8015
25
25
  xoscar/_utils.pxd,sha256=5KYAL3jfPdejsHnrGGT2s--ZUX5SXznQWpHVSno429k,1157
26
- xoscar/context.cpython-39-darwin.so,sha256=Im1NDWguFiho6g2k8vtBdbzAxxfNldzLSDKzyDxycPI,200448
26
+ xoscar/context.cpython-39-darwin.so,sha256=OHAPnNPvsMLEKG7W2rd2yuVX59CcQJTvQdkIYbYZUvI,200448
27
27
  xoscar/metrics/__init__.py,sha256=9Badi7rxYikGm2dQiNCrj9GgMRBxwuR3JaEKcFZmfak,705
28
28
  xoscar/metrics/api.py,sha256=BBlMIFvVAGVfrtpeJ1YlH9Tqhy9OzGavwvGyeHcQ0Tk,8856
29
29
  xoscar/metrics/backends/__init__.py,sha256=h_JgzSqV5lP6vQ6XX_17kE4IY4BRnvKta_7VLQAL1ms,581
@@ -43,13 +43,13 @@ xoscar/serialization/pyfury.py,sha256=sifOnVMYoS82PzZEkzkfxesmMHei23k5UAUUKUyoOY
43
43
  xoscar/serialization/core.pxd,sha256=k4RoJgX5E5LGs4jdCQ7vvcn26MabXbrWoWhkO49X6YI,985
44
44
  xoscar/serialization/__init__.py,sha256=v76XC2OQLp-Yk4_U3_IVguEylMeyRw1UrkU_DPDMh0U,856
45
45
  xoscar/serialization/numpy.py,sha256=5Kem87CvpJmzUMp3QHk4WeHU30FoQWTJJP2SwIcaQG0,2919
46
- xoscar/serialization/core.cpython-39-darwin.so,sha256=dSqxLhQF6E78lAhVrePrbtib1AJ84R7V84UCivvupDg,408080
46
+ xoscar/serialization/core.cpython-39-darwin.so,sha256=muKF3dj1U5WdUtTrkv8DGka1q9-SpB3e2iIMZzWTWd8,408080
47
47
  xoscar/serialization/cuda.py,sha256=iFUEnN4SiquBIhyieyOrfw3TnKnW-tU_vYgqOxO_DrA,3758
48
48
  xoscar/serialization/scipy.py,sha256=yOEi0NB8cqQ6e2UnCZ1w006RsB7T725tIL-DM_hNcsU,2482
49
49
  xoscar/serialization/aio.py,sha256=5DySPgDxU43ec7_5Ct44-Oqt7YNSJBfuf8VdQgQlChA,4731
50
50
  xoscar/serialization/core.pyx,sha256=bjR-zXGm9qersk7kYPzpjpMIxDl_Auur4BCubRfKmfA,29626
51
51
  xoscar/serialization/mlx.py,sha256=N_cvbTUBKc14XWYsPIMz4kDstyRN1DNhb4BVRgnQm8Y,1872
52
- xoscar/backends/message.cpython-39-darwin.so,sha256=53f9prXDEmkuxNlKA97zPe9tlgGs_az0gKHKQtmRlJo,387584
52
+ xoscar/backends/message.cpython-39-darwin.so,sha256=MkYBPjlV95GvnvSLCO_Yl3H5HO8kTscdJ2ssk048k9Y,387584
53
53
  xoscar/backends/config.py,sha256=4tZMiXAMMS8qQ4SX_LjONLtSQVfZTx3m-IK3EqbkYdk,5375
54
54
  xoscar/backends/allocate_strategy.py,sha256=tC1Nbq2tJohahUwd-zoRYHEDX65wyuX8tmeY45uWj_w,4845
55
55
  xoscar/backends/__init__.py,sha256=VHEBQcUWM5bj027W8EUf9PiJUAP7JoMrRw3Tsvy5ySw,643
@@ -57,7 +57,7 @@ xoscar/backends/core.py,sha256=EH-fHlV9x3bnruEHaUtGYO7osKLfLJ4AQHtuzA_mr2g,10857
57
57
  xoscar/backends/context.py,sha256=XfDPG2eDhAhE6hWBEkEsHTnyyOYN9R3houlMjAL7BFw,16329
58
58
  xoscar/backends/router.py,sha256=MVl5naz-FYf-Wla7XRn3kRxOpWV0SjKDsKNluifVA8M,10532
59
59
  xoscar/backends/message.pyx,sha256=krGVtZ1YDaZX8yWhaNHwZiudQooLvcGlw6x3Sq7jxjE,19685
60
- xoscar/backends/pool.py,sha256=omYqaPyv1WW1YrU3OSZhk3kr0JyfI7MYhBtTemVJKZA,60895
60
+ xoscar/backends/pool.py,sha256=OezOhvvXAV3TpODhLHmJVgqCfowb3aA_fWZKPodm8bE,61003
61
61
  xoscar/backends/indigen/backend.py,sha256=znl_fZzWGEtLH8hZ9j9Kkf0fva25jEem2_KO7I1RVvc,1612
62
62
  xoscar/backends/indigen/__init__.py,sha256=tKHP5ClzedBRBpZsLRVErR3EUNbbDm4CY4u0rCFJr44,685
63
63
  xoscar/backends/indigen/driver.py,sha256=VGzkacYKykegW5qhCuhx01gdgBZEKJjNIyfNCnA6Nm8,952
@@ -78,3 +78,6 @@ xoscar/aio/file.py,sha256=PBtkLp-Q7XtYl-zk00s18TtgIrkNr60J3Itf66ctO1o,1486
78
78
  xoscar/aio/lru.py,sha256=rpXCqSLtPV5xnWtd6uDwQQFGgIPEgvmWEQDkPNUx9cM,6311
79
79
  xoscar/aio/parallelism.py,sha256=VSsjk8wP-Bw7tLeUsTyLVNgp91thjxEfE3pCrw_vF5Q,1293
80
80
  xoscar/aio/base.py,sha256=9j0f1piwfE5R5GIvV212vSD03ixdaeSzSSsO2kxJZVE,2249
81
+ xoscar/virtualenv/__init__.py,sha256=65t9_X1DvbanNjFy366SiiWZrRTpa9SXWMXPmqayE-4,1117
82
+ xoscar/virtualenv/core.py,sha256=YMN6yHoNeEc8ecbJMbZkKeWKUABK1mUZ_OYOjcbRqWs,1263
83
+ xoscar/virtualenv/uv.py,sha256=l9w5JxETbW2wN8vfZR7k7aKTz4cWV4MvH06MoogBOVc,2842
File without changes