xoscar 0.7.12__cp311-cp311-macosx_11_0_arm64.whl → 0.7.14__cp311-cp311-macosx_11_0_arm64.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/_utils.cpython-311-darwin.so +0 -0
- xoscar/backends/message.cpython-311-darwin.so +0 -0
- xoscar/context.cpython-311-darwin.so +0 -0
- xoscar/core.cpython-311-darwin.so +0 -0
- xoscar/serialization/core.cpython-311-darwin.so +0 -0
- xoscar/virtualenv/core.py +7 -1
- xoscar/virtualenv/uv.py +58 -11
- {xoscar-0.7.12.dist-info → xoscar-0.7.14.dist-info}/METADATA +1 -1
- {xoscar-0.7.12.dist-info → xoscar-0.7.14.dist-info}/RECORD +11 -11
- {xoscar-0.7.12.dist-info → xoscar-0.7.14.dist-info}/WHEEL +0 -0
- {xoscar-0.7.12.dist-info → xoscar-0.7.14.dist-info}/top_level.txt +0 -0
|
Binary file
|
|
Binary file
|
|
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
|
|
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
|
|
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
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
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,9 +1,9 @@
|
|
|
1
|
-
xoscar-0.7.
|
|
2
|
-
xoscar-0.7.
|
|
3
|
-
xoscar-0.7.
|
|
4
|
-
xoscar-0.7.
|
|
1
|
+
xoscar-0.7.14.dist-info/RECORD,,
|
|
2
|
+
xoscar-0.7.14.dist-info/WHEEL,sha256=1Yl4xfCXx_BC0nXnlbd5xfzR2RyoNx_gSIEdv2OLRuM,137
|
|
3
|
+
xoscar-0.7.14.dist-info/top_level.txt,sha256=vYlqqY4Nys8Thm1hePIuUv8eQePdULVWMmt7lXtX_ZA,21
|
|
4
|
+
xoscar-0.7.14.dist-info/METADATA,sha256=bTouvWumRWQDRY1ApYh9XVZ7HthHSUa8ctv-___IW6U,9135
|
|
5
5
|
xoscar/_utils.pyx,sha256=frgVQ5xGp92jBKc4PsPmjOlVsXlKeHWtTOAMfHmBaII,7380
|
|
6
|
-
xoscar/_utils.cpython-311-darwin.so,sha256=
|
|
6
|
+
xoscar/_utils.cpython-311-darwin.so,sha256=mzogu4PszYUJVN0pmHWwA8edry_UgBNTYZtCk66Lm1Q,170672
|
|
7
7
|
xoscar/backend.py,sha256=is436OPkZfSpQXaoqTRVta5eoye_pp45RFgCstAk2hU,1850
|
|
8
8
|
xoscar/core.pxd,sha256=I_C2ka7XryyGnnAVXUVm8xfS1gtIrCs6X-9rswgOcUU,1317
|
|
9
9
|
xoscar/_version.py,sha256=ClSPrUjgGRGHIkVMQV9XQnkQ-n0akJMnq_rh819nqFE,23719
|
|
@@ -14,11 +14,11 @@ xoscar/constants.py,sha256=QHHSREw6uWBBjQDCFqlNfTvBZgniJPGy42KSIsR8Fqw,787
|
|
|
14
14
|
xoscar/__init__.py,sha256=sy7Wtn2EuQZI0I4Az_MfsBVZm4G0DRj46qRyExgmnJk,1622
|
|
15
15
|
xoscar/api.py,sha256=zxNqOjGiTIKuAip9WJ0LOoM7yevD6P5rb-sLynpZ2Zo,14648
|
|
16
16
|
xoscar/utils.py,sha256=MaKiW4Vphwhh8c0yoqN8G8hbJr1zXgpf49EdvmGc1ZU,16500
|
|
17
|
-
xoscar/context.cpython-311-darwin.so,sha256=
|
|
17
|
+
xoscar/context.cpython-311-darwin.so,sha256=IDR4WaKy6ZPjIyVg09z7SndlfJ1X5yD5O1PCW942Wh8,213456
|
|
18
18
|
xoscar/debug.py,sha256=9Z8SgE2WaKYQcyDo-5-DxEJQ533v7kWjrvCd28pSx3E,5069
|
|
19
19
|
xoscar/libcpp.pxd,sha256=DJqBxLFOKL4iRr9Kale5UH3rbvPRD1x5bTSOPHFpz9I,1147
|
|
20
20
|
xoscar/context.pyx,sha256=8CdgPnWcE9eOp3N600WgDQ03MCi8P73eUOGcfV7Zksg,10942
|
|
21
|
-
xoscar/core.cpython-311-darwin.so,sha256=
|
|
21
|
+
xoscar/core.cpython-311-darwin.so,sha256=iiKY9I0_jIITZSkI7eSVMDhgStxmtoWKCFxhoeRb17o,413112
|
|
22
22
|
xoscar/errors.py,sha256=wBlQOKsXf0Fc4skN39tDie0YZT-VIAuLNRgoDl2pZcA,1241
|
|
23
23
|
xoscar/core.pyx,sha256=phN-yYV0A0QI8WFi2jCu0nc4CnShTepfDi0V7ZrLYPY,22092
|
|
24
24
|
xoscar/driver.py,sha256=498fowtJr6b3FE8FIOA_Tc1Vwx88nfZw7p0FxrML0h4,1372
|
|
@@ -46,10 +46,10 @@ xoscar/serialization/numpy.py,sha256=5Kem87CvpJmzUMp3QHk4WeHU30FoQWTJJP2SwIcaQG0
|
|
|
46
46
|
xoscar/serialization/cuda.py,sha256=iFUEnN4SiquBIhyieyOrfw3TnKnW-tU_vYgqOxO_DrA,3758
|
|
47
47
|
xoscar/serialization/scipy.py,sha256=yOEi0NB8cqQ6e2UnCZ1w006RsB7T725tIL-DM_hNcsU,2482
|
|
48
48
|
xoscar/serialization/aio.py,sha256=5DySPgDxU43ec7_5Ct44-Oqt7YNSJBfuf8VdQgQlChA,4731
|
|
49
|
-
xoscar/serialization/core.cpython-311-darwin.so,sha256=
|
|
49
|
+
xoscar/serialization/core.cpython-311-darwin.so,sha256=H46eO9FUckraHIU4z_Sb-5KL-g6KLswvlTGKl-gJB88,382808
|
|
50
50
|
xoscar/serialization/core.pyx,sha256=bjR-zXGm9qersk7kYPzpjpMIxDl_Auur4BCubRfKmfA,29626
|
|
51
51
|
xoscar/serialization/mlx.py,sha256=tRu_7o6RizdRhbr88EasHrZtShimAsLy3pIEO-by29o,2118
|
|
52
|
-
xoscar/backends/message.cpython-311-darwin.so,sha256=
|
|
52
|
+
xoscar/backends/message.cpython-311-darwin.so,sha256=cyjoC0tIqDRIqYdBAdiA8U_tsjgqQyPENtatKUfLHBM,368656
|
|
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
|
|
@@ -82,6 +82,6 @@ xoscar/aio/lru.py,sha256=rpXCqSLtPV5xnWtd6uDwQQFGgIPEgvmWEQDkPNUx9cM,6311
|
|
|
82
82
|
xoscar/aio/parallelism.py,sha256=VSsjk8wP-Bw7tLeUsTyLVNgp91thjxEfE3pCrw_vF5Q,1293
|
|
83
83
|
xoscar/aio/base.py,sha256=9j0f1piwfE5R5GIvV212vSD03ixdaeSzSSsO2kxJZVE,2249
|
|
84
84
|
xoscar/virtualenv/__init__.py,sha256=65t9_X1DvbanNjFy366SiiWZrRTpa9SXWMXPmqayE-4,1117
|
|
85
|
-
xoscar/virtualenv/core.py,sha256=
|
|
85
|
+
xoscar/virtualenv/core.py,sha256=MV1lbkixGl45REHS04uaPuqPKxyVbBmVnB_umuR_eWw,2957
|
|
86
86
|
xoscar/virtualenv/utils.py,sha256=mL_uATHhj82xec0-0IZ6N8yI-laPAB4t8G3alPUGtPA,2439
|
|
87
|
-
xoscar/virtualenv/uv.py,sha256=
|
|
87
|
+
xoscar/virtualenv/uv.py,sha256=8fsZtUfMfSI1FZL7eLMfF-znG7fGVwshdERiHqSvems,11119
|
|
File without changes
|
|
File without changes
|