xoscar 0.7.12__cp310-cp310-win_amd64.whl → 0.7.14__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/collective/uv.dll CHANGED
Binary file
Binary file
Binary file
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():
@@ -115,16 +150,25 @@ class UVVirtualEnvManager(VirtualEnvManager):
115
150
  @staticmethod
116
151
  def _split_specs(
117
152
  specs: list[str], installed: dict[str, str]
118
- ) -> tuple[list[str], dict[str, str]]:
153
+ ) -> tuple[list[str], list[str], dict[str, str]]:
119
154
  """
120
155
  Split the given requirement specs into:
156
+ - keep: specs that need to be kept, e.g. git+github://xxx
121
157
  - to_resolve: specs that need to be passed to the resolver (unsatisfied ones)
122
158
  - pinned: already satisfied specs, used for constraint to lock their versions
123
159
  """
160
+ keep: list[str] = []
124
161
  to_resolve: list[str] = []
125
162
  pinned: dict[str, str] = {}
126
163
 
127
164
  for spec_str in specs:
165
+ # skip git+xxx
166
+ if spec_str.startswith(
167
+ ("git+", "http://", "https://", "svn+", "hg+", "bzr+")
168
+ ):
169
+ keep.append(spec_str)
170
+ continue
171
+
128
172
  req = Requirement(spec_str)
129
173
  name = req.name.lower()
130
174
  cur_ver = installed.get(name)
@@ -150,7 +194,7 @@ class UVVirtualEnvManager(VirtualEnvManager):
150
194
  # Parsing error, be conservative and resolve it
151
195
  to_resolve.append(spec_str)
152
196
 
153
- return to_resolve, pinned
197
+ return keep, to_resolve, pinned
154
198
 
155
199
  def _filter_packages_not_installed(self, packages: list[str]) -> list[str]:
156
200
  """
@@ -165,18 +209,21 @@ class UVVirtualEnvManager(VirtualEnvManager):
165
209
  }
166
210
 
167
211
  # exclude those packages that satisfied in system site packages
168
- to_resolve, pinned = self._split_specs(packages, installed)
169
- if not to_resolve:
212
+ keep, to_resolve, pinned = self._split_specs(packages, installed)
213
+ if not keep and not to_resolve:
170
214
  logger.debug("All requirement specifiers satisfied by system packages.")
171
215
  return []
172
216
 
173
- resolved = self._resolve_install_plan(to_resolve, pinned)
174
- logger.debug(f"Resolved install list: {resolved}")
175
- if not resolved:
176
- # no packages to install
177
- return []
217
+ if to_resolve:
218
+ resolved = self._resolve_install_plan(to_resolve, pinned)
219
+ logger.debug(f"Resolved install list: {resolved}")
220
+ if not keep and not resolved:
221
+ # no packages to install
222
+ return []
223
+ else:
224
+ resolved = []
178
225
 
179
- final = []
226
+ final = keep.copy()
180
227
  for item in resolved:
181
228
  name, version = item.split("==")
182
229
  key = name.lower()
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: xoscar
3
- Version: 0.7.12
3
+ Version: 0.7.14
4
4
  Summary: Python actor framework for heterogeneous computing.
5
5
  Home-page: http://github.com/xorbitsai/xoscar
6
6
  Author: Qin Xuye
@@ -1,5 +1,5 @@
1
1
  xoscar/__init__.py,sha256=lzCXUmkuIjcjkiNQFekysdJR_ZhlbjcfR5ka1bZZNQg,1683
2
- xoscar/_utils.cp310-win_amd64.pyd,sha256=d7UIr4jKg2iTu5ZblsH_qyEzWXafWbhK6ZOJ2Kc0qQU,115200
2
+ xoscar/_utils.cp310-win_amd64.pyd,sha256=RwbRVpJTpxPYhAdvJsFbpyKUv_LBF9COT3whHmt1hkw,114688
3
3
  xoscar/_utils.pxd,sha256=rlNbTg5lhXA-jCOLksqF4jhUlNn0xw2jx1HxdLa34pc,1193
4
4
  xoscar/_utils.pyx,sha256=TWScgqmJGYzjbWBOShBLkq07ldfYEQ5fw6V4OytX_IA,7626
5
5
  xoscar/_version.py,sha256=bsfCVAo_o9LkiP3AjPsP4SRRqhjuS0t4D1WGJPzbdls,24412
@@ -7,10 +7,10 @@ xoscar/api.py,sha256=QQDHn-_FiDExmOxEk8BUnq4Qrx13VX3shSlEEqPQJo0,15175
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=MNf9GK5k8dJps2CEG86KE65VgDT649ksE8wmji4KGL8,163328
10
+ xoscar/context.cp310-win_amd64.pyd,sha256=gQ976beTOCWFka1XSyei7tZs3uNCMBtRg9UQf_ZSXSg,163328
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=j49wJCaddWn1zhsMSPXwR35nfw0eul5EYvLUx_FJx-o,322560
13
+ xoscar/core.cp310-win_amd64.pyd,sha256=VDTYo9rlm4ebGFi-yDf8P_wDKJoiWK0vVUHSofpnU9Q,322560
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,7 +30,7 @@ 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=G-vzc0XIF7OeonvzpqUW9EIxFTsaP5gPxb1Z21DAzzQ,244224
33
+ xoscar/backends/message.cp310-win_amd64.pyd,sha256=0Tp6NDS1B5dD06FZE2T5W7X1473Ut3lc-lIPZrHPiIs,244224
34
34
  xoscar/backends/message.pyx,sha256=lBEjMJv4VyxmeO9lHXJJazOajbFnTLak4PSBcLoPZvU,20331
35
35
  xoscar/backends/pool.py,sha256=bS_m8XBkfQQsCOaLEzM6HkV5e78dPPp1bCH6yjvPEss,62153
36
36
  xoscar/backends/router.py,sha256=EjfNpQUrhFU15eYe1kRPueziHgI2gfDViUzm7ruvXDE,10817
@@ -57,8 +57,8 @@ xoscar/collective/common.py,sha256=9c7xq3IOUvfA0I9GnpalUqXZOzmF6IEILv4zL64BYVE,3
57
57
  xoscar/collective/core.py,sha256=191aPxbUgWpjzrqyozndImDAQhZFmqoQdBkHFLDfXN0,24239
58
58
  xoscar/collective/process_group.py,sha256=kTPbrLMJSGhqbiWvTIiz-X3W0rZWd_CFn_zUIlXbOlM,23286
59
59
  xoscar/collective/utils.py,sha256=p3WEVtXvnVhkuO5mRgQBhBRFr1dKHcDKMjrbMyuiyfg,1219
60
- xoscar/collective/uv.dll,sha256=_EuF-Y_j58tSedxGvwRRRV5XL2j-HO0-gNNOb_KeDHc,620544
61
- xoscar/collective/xoscar_pygloo.cp310-win_amd64.pyd,sha256=_U6fgmW-DGSLiSyv_92-5pN5Gw26NPAE66FMs-Y85iY,779264
60
+ xoscar/collective/uv.dll,sha256=D00nv5CKQbwUv_SvWwSwQXMxT9rRI8K8NeqH3pRxCyw,620544
61
+ xoscar/collective/xoscar_pygloo.cp310-win_amd64.pyd,sha256=cpMQd37XZ9i79FuewZZhqxy2F15QPwni8u8nX1_OmHo,779264
62
62
  xoscar/metrics/__init__.py,sha256=RjXuuYw4I2YYgD8UY2Z5yCZk0Z56xMJ1n40O80Dtxf8,726
63
63
  xoscar/metrics/api.py,sha256=dtJ4QrIqQNXhJedeqOPs4TXKgrRGZFFN50xAd9SCfec,9144
64
64
  xoscar/metrics/backends/__init__.py,sha256=ZHepfhCDRuK9yz4pAM7bjpWDvS3Ijp1YgyynoUFLeuU,594
@@ -69,7 +69,7 @@ xoscar/metrics/backends/prometheus/__init__.py,sha256=ZHepfhCDRuK9yz4pAM7bjpWDvS
69
69
  xoscar/metrics/backends/prometheus/prometheus_metric.py,sha256=65hb8O3tmsEJ7jgOrIwl_suj9SE5Tmqcfjuk0urkLvE,2120
70
70
  xoscar/serialization/__init__.py,sha256=tS8C49yrW_geWNEsbgW3phK1q4YN1ojI6CN-vroIFYM,876
71
71
  xoscar/serialization/aio.py,sha256=7YLXgkWpQ3ANy-TZ1qO8Mt4_J3cZFhFh2FEgUgxMT60,4873
72
- xoscar/serialization/core.cp310-win_amd64.pyd,sha256=f-VvqYQxSc5Eu2Mig3u5J1UvEZGZ6SxRLQrpexMclzw,266752
72
+ xoscar/serialization/core.cp310-win_amd64.pyd,sha256=LXJhBKzDLxVrjMOl7uEY2TRFe09PpdxfSiobI5aIsLY,266752
73
73
  xoscar/serialization/core.pxd,sha256=X-47bqBM2Kzw5SkLqICdKD0gU6CpmLsBxC3kfW--wVk,1013
74
74
  xoscar/serialization/core.pyx,sha256=ZKexLRnRwZXXn2045kR7xfM_szcoPNrDuouQCWtpFp8,30570
75
75
  xoscar/serialization/cuda.py,sha256=Fj4Cpr_YmkGceUCo0mQn8fRvmHP_5WcLdRx6epZ3RC0,3869
@@ -79,10 +79,10 @@ xoscar/serialization/numpy.py,sha256=C6WVx-Sdl2OHBAvVY34DFjAKXlekMbpc2ni6bR8wxYo
79
79
  xoscar/serialization/pyfury.py,sha256=3ucal29Hr7PX9_1SfB2x43FE2xw_C0rLkVv3foL7qwM,1200
80
80
  xoscar/serialization/scipy.py,sha256=9ph-yoRoNiwUZTwQrn35U60VPirWlncXNAg6EXvqMR4,2554
81
81
  xoscar/virtualenv/__init__.py,sha256=rhJ7I6x7aXjKOCzSqsKLwqFJMh4YC2sqchEIJNEfI58,1151
82
- xoscar/virtualenv/core.py,sha256=6u7zcMiAZVOKSBUXBlJOC5pvwbmycn6svJApYMSJDIY,2943
82
+ xoscar/virtualenv/core.py,sha256=5w1UDnzLHKyrFFwqAJFXVxkpXrd5ux8OlxSR3971bMo,3055
83
83
  xoscar/virtualenv/utils.py,sha256=tZYB1kAEym5e8WK9SxhW7VgZzXk6fJMm6MoBA7pY4gM,2523
84
- xoscar/virtualenv/uv.py,sha256=auRTs098SkcunEDtwLE0XV7X2shryhqPELVXTA4Vzxs,9595
85
- xoscar-0.7.12.dist-info/METADATA,sha256=F-Ipd2rKJIlwDI2v2kQud1slFVTjOJq3B--vJRsEjPM,9361
86
- xoscar-0.7.12.dist-info/WHEEL,sha256=NVXpD7b4Gxps0cd2ds5rr5TG8W4ApEwx_i5J99qMZ5E,102
87
- xoscar-0.7.12.dist-info/top_level.txt,sha256=vYlqqY4Nys8Thm1hePIuUv8eQePdULVWMmt7lXtX_ZA,21
88
- xoscar-0.7.12.dist-info/RECORD,,
84
+ xoscar/virtualenv/uv.py,sha256=irejdyLJRMZbojo_DZqzbK0xGiB5yG7mGNGOIen2I1s,11439
85
+ xoscar-0.7.14.dist-info/METADATA,sha256=UB6XB-DxqpCla7HZ3TS5BGaSlKcMM0henr6CgIiJVyw,9361
86
+ xoscar-0.7.14.dist-info/WHEEL,sha256=NVXpD7b4Gxps0cd2ds5rr5TG8W4ApEwx_i5J99qMZ5E,102
87
+ xoscar-0.7.14.dist-info/top_level.txt,sha256=vYlqqY4Nys8Thm1hePIuUv8eQePdULVWMmt7lXtX_ZA,21
88
+ xoscar-0.7.14.dist-info/RECORD,,