xoscar 0.7.12__cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl → 0.7.13__cp310-cp310-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
@@ -29,7 +29,13 @@ class VirtualEnvManager(ABC):
29
29
  self.env_path = env_path.resolve()
30
30
 
31
31
  @abstractmethod
32
- def create_env(self, python_path: Path | None = None) -> None:
32
+ def exists_env(self) -> bool:
33
+ pass
34
+
35
+ @abstractmethod
36
+ def create_env(
37
+ self, python_path: Path | None = None, exists: str = "ignore"
38
+ ) -> None:
33
39
  pass
34
40
 
35
41
  @abstractmethod
xoscar/virtualenv/uv.py CHANGED
@@ -65,9 +65,44 @@ class UVVirtualEnvManager(VirtualEnvManager):
65
65
  uv_path = "uv"
66
66
  return uv_path
67
67
 
68
- def create_env(self, python_path: Path | None = None) -> None:
68
+ def exists_env(self) -> bool:
69
+ """Check if virtual environment already exists."""
70
+ return self.env_path.exists() and (self.env_path / "pyvenv.cfg").exists()
71
+
72
+ def create_env(
73
+ self, python_path: Path | None = None, exists: str = "ignore"
74
+ ) -> None:
75
+ """
76
+ Create virtual environment.
77
+
78
+ Args:
79
+ python_path: Path to Python interpreter to use
80
+ exists: How to handle existing environment:
81
+ - "ignore": Skip creation if environment already exists (default)
82
+ - "error": Raise error if environment exists
83
+ - "clear": Remove existing environment and create new one
84
+ """
85
+ if self.exists_env():
86
+ if exists == "error":
87
+ raise FileExistsError(
88
+ f"Virtual environment already exists at {self.env_path}"
89
+ )
90
+ elif exists == "ignore":
91
+ logger.info(
92
+ f"Virtual environment already exists at {self.env_path}, skipping creation"
93
+ )
94
+ return
95
+ elif exists == "clear":
96
+ logger.info(f"Removing existing virtual environment at {self.env_path}")
97
+ self.remove_env()
98
+ else:
99
+ raise ValueError(
100
+ f"Invalid exists option: {exists}. Must be one of: error, clear, ignore"
101
+ )
102
+
69
103
  uv_path = self._get_uv_path()
70
104
  cmd = [uv_path, "venv", str(self.env_path), "--system-site-packages"]
105
+
71
106
  if python_path:
72
107
  cmd += ["--python", str(python_path)]
73
108
  elif _is_in_pyinstaller():
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: xoscar
3
- Version: 0.7.12
3
+ Version: 0.7.13
4
4
  Summary: Python actor framework for heterogeneous computing.
5
5
  Home-page: http://github.com/xorbitsai/xoscar
6
6
  Author: Qin Xuye
@@ -78,10 +78,10 @@ xoscar/serialization/numpy.py,sha256=5Kem87CvpJmzUMp3QHk4WeHU30FoQWTJJP2SwIcaQG0
78
78
  xoscar/serialization/pyfury.py,sha256=sifOnVMYoS82PzZEkzkfxesmMHei23k5UAUUKUyoOYQ,1163
79
79
  xoscar/serialization/scipy.py,sha256=yOEi0NB8cqQ6e2UnCZ1w006RsB7T725tIL-DM_hNcsU,2482
80
80
  xoscar/virtualenv/__init__.py,sha256=65t9_X1DvbanNjFy366SiiWZrRTpa9SXWMXPmqayE-4,1117
81
- xoscar/virtualenv/core.py,sha256=qHKqI6R92SN0_OWVAX1xy9wJiZr-r0VfLHTskZtZE4U,2851
81
+ xoscar/virtualenv/core.py,sha256=MV1lbkixGl45REHS04uaPuqPKxyVbBmVnB_umuR_eWw,2957
82
82
  xoscar/virtualenv/utils.py,sha256=mL_uATHhj82xec0-0IZ6N8yI-laPAB4t8G3alPUGtPA,2439
83
- xoscar/virtualenv/uv.py,sha256=PWq5Ht-uFOrwyKGF0bGZzZiuJUvGmr_OZADzRSfLKfk,9322
84
- xoscar-0.7.12.dist-info/METADATA,sha256=fNJZZhysdC6gdYZ67SfKjoIlNsse08kV5978cNQmnyo,9135
85
- xoscar-0.7.12.dist-info/WHEEL,sha256=Zqf17R98VQuI9JZEwsfDDfsqkexN9tbZpiCgdvPM64U,154
86
- xoscar-0.7.12.dist-info/top_level.txt,sha256=vYlqqY4Nys8Thm1hePIuUv8eQePdULVWMmt7lXtX_ZA,21
87
- xoscar-0.7.12.dist-info/RECORD,,
83
+ xoscar/virtualenv/uv.py,sha256=OjaHgIR2pOySaLbsnFELOYkX4Y5QZLSm2yqyLApPbdo,10668
84
+ xoscar-0.7.13.dist-info/METADATA,sha256=PZcHK2IMvzLoUnkOdtZIsdN1rBpex1nGjiYPx9Qn5-8,9135
85
+ xoscar-0.7.13.dist-info/WHEEL,sha256=Zqf17R98VQuI9JZEwsfDDfsqkexN9tbZpiCgdvPM64U,154
86
+ xoscar-0.7.13.dist-info/top_level.txt,sha256=vYlqqY4Nys8Thm1hePIuUv8eQePdULVWMmt7lXtX_ZA,21
87
+ xoscar-0.7.13.dist-info/RECORD,,