xoscar 0.7.1__cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl → 0.7.2__cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.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.

xoscar/virtualenv/core.py CHANGED
@@ -14,6 +14,7 @@
14
14
 
15
15
  from __future__ import annotations
16
16
 
17
+ import importlib
17
18
  from abc import ABC, abstractmethod
18
19
  from pathlib import Path
19
20
 
@@ -35,6 +36,43 @@ class VirtualEnvManager(ABC):
35
36
  def install_packages(self, packages: list[str], **kwargs):
36
37
  pass
37
38
 
39
+ @staticmethod
40
+ def process_packages(packages: list[str]) -> list[str]:
41
+ """
42
+ Process a list of package names, replacing placeholders like #system_<package>#
43
+ with the installed version of the corresponding package from the system environment.
44
+
45
+ Example:
46
+ "#system_torch#" -> "torch==2.1.0" (if torch 2.1.0 is installed)
47
+
48
+ Args:
49
+ packages (list[str]): A list of package names, which may include placeholders.
50
+
51
+ Returns:
52
+ list[str]: A new list with resolved package names and versions.
53
+
54
+ Raises:
55
+ RuntimeError: If a specified system package is not found in the environment.
56
+ """
57
+ processed = []
58
+
59
+ for pkg in packages:
60
+ if pkg.startswith("#system_") and pkg.endswith("#"):
61
+ real_pkg = pkg[
62
+ len("#system_") : -1
63
+ ] # Extract actual package name, e.g., "torch"
64
+ try:
65
+ version = importlib.metadata.version(real_pkg)
66
+ except importlib.metadata.PackageNotFoundError:
67
+ raise RuntimeError(
68
+ f"System package '{real_pkg}' not found. Cannot resolve '{pkg}'."
69
+ )
70
+ processed.append(f"{real_pkg}=={version}")
71
+ else:
72
+ processed.append(pkg)
73
+
74
+ return processed
75
+
38
76
  @abstractmethod
39
77
  def cancel_install(self):
40
78
  pass
xoscar/virtualenv/uv.py CHANGED
@@ -46,6 +46,10 @@ class UVVirtualEnvManager(VirtualEnvManager):
46
46
  if not packages:
47
47
  return
48
48
 
49
+ # extend the ability of pip
50
+ # maybe replace #system_torch# to the real version
51
+ packages = self.process_packages(packages)
52
+
49
53
  cmd = ["uv", "pip", "install", "-p", str(self.env_path)] + packages
50
54
 
51
55
  # Handle known pip-related kwargs
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: xoscar
3
- Version: 0.7.1
3
+ Version: 0.7.2
4
4
  Summary: Python actor framework for heterogeneous computing.
5
5
  Home-page: http://github.com/xorbitsai/xoscar
6
6
  Author: Qin Xuye
@@ -81,9 +81,9 @@ xoscar/serialization/numpy.py,sha256=5Kem87CvpJmzUMp3QHk4WeHU30FoQWTJJP2SwIcaQG0
81
81
  xoscar/serialization/pyfury.py,sha256=sifOnVMYoS82PzZEkzkfxesmMHei23k5UAUUKUyoOYQ,1163
82
82
  xoscar/serialization/scipy.py,sha256=yOEi0NB8cqQ6e2UnCZ1w006RsB7T725tIL-DM_hNcsU,2482
83
83
  xoscar/virtualenv/__init__.py,sha256=65t9_X1DvbanNjFy366SiiWZrRTpa9SXWMXPmqayE-4,1117
84
- xoscar/virtualenv/core.py,sha256=Ld5bSkKp8ywekGuUq61uyms5I8Hm1WdbkbLxmCw-ML0,1342
85
- xoscar/virtualenv/uv.py,sha256=rVurn1PKlvR22Bm_F1uouIb1eMkB_wr-_29dBvMl7bo,3182
86
- xoscar-0.7.1.dist-info/METADATA,sha256=5R1jB3gMn9EcgS3E9H23PxbZQ2T1cSsdczaXBKXbD3k,9189
87
- xoscar-0.7.1.dist-info/WHEEL,sha256=FDXJ-RcfxAULCvJM3u0UV7PBL-oTwDB75rMM--ile6g,153
88
- xoscar-0.7.1.dist-info/top_level.txt,sha256=vYlqqY4Nys8Thm1hePIuUv8eQePdULVWMmt7lXtX_ZA,21
89
- xoscar-0.7.1.dist-info/RECORD,,
84
+ xoscar/virtualenv/core.py,sha256=dZqwg2IzHsLEERvohZx0rvBINopMRUImqxG3HHGO0q4,2744
85
+ xoscar/virtualenv/uv.py,sha256=_A32kMVtTolw8wb0rFQONbw_pAFJgNVMJo1s1WkqFrc,3329
86
+ xoscar-0.7.2.dist-info/METADATA,sha256=J3Fg6FWOvEvCxd3b9t_vL_2KHQmFDpJKkQpIwdmGPqM,9189
87
+ xoscar-0.7.2.dist-info/WHEEL,sha256=Vkuh_Vi1FttYFXtLH6qwGLcw112M0PuneGTL2j9trrw,153
88
+ xoscar-0.7.2.dist-info/top_level.txt,sha256=vYlqqY4Nys8Thm1hePIuUv8eQePdULVWMmt7lXtX_ZA,21
89
+ xoscar-0.7.2.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (80.4.0)
2
+ Generator: setuptools (80.7.1)
3
3
  Root-Is-Purelib: false
4
4
  Tag: cp312-cp312-manylinux_2_17_aarch64
5
5
  Tag: cp312-cp312-manylinux2014_aarch64