xoscar 0.7.5__cp39-cp39-macosx_10_9_x86_64.whl → 0.7.6__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.
- xoscar/_utils.cpython-39-darwin.so +0 -0
- xoscar/backends/message.cpython-39-darwin.so +0 -0
- xoscar/context.cpython-39-darwin.so +0 -0
- xoscar/core.cpython-39-darwin.so +0 -0
- xoscar/serialization/core.cpython-39-darwin.so +0 -0
- xoscar/virtualenv/utils.py +84 -0
- xoscar/virtualenv/uv.py +17 -3
- {xoscar-0.7.5.dist-info → xoscar-0.7.6.dist-info}/METADATA +1 -1
- {xoscar-0.7.5.dist-info → xoscar-0.7.6.dist-info}/RECORD +11 -10
- {xoscar-0.7.5.dist-info → xoscar-0.7.6.dist-info}/WHEEL +0 -0
- {xoscar-0.7.5.dist-info → xoscar-0.7.6.dist-info}/top_level.txt +0 -0
|
Binary file
|
|
Binary file
|
|
Binary file
|
xoscar/core.cpython-39-darwin.so
CHANGED
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,84 @@
|
|
|
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
|
+
import logging
|
|
16
|
+
import re
|
|
17
|
+
import subprocess
|
|
18
|
+
import sys
|
|
19
|
+
import threading
|
|
20
|
+
from contextlib import contextmanager
|
|
21
|
+
from typing import BinaryIO, Callable, Iterator, List, Optional, TextIO, Union
|
|
22
|
+
|
|
23
|
+
logger = logging.getLogger(__name__)
|
|
24
|
+
|
|
25
|
+
ansi_escape = re.compile(r"\x1B\[[0-?]*[ -/]*[@-~]")
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
def clean_ansi(text: str) -> str:
|
|
29
|
+
"""Remove ANSI escape sequences from text."""
|
|
30
|
+
return ansi_escape.sub("", text)
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
def stream_reader(
|
|
34
|
+
stream: BinaryIO, log_func: Callable[[str], None], output_stream: TextIO
|
|
35
|
+
) -> None:
|
|
36
|
+
"""
|
|
37
|
+
Read from the stream, write to logger, and also write to the terminal.
|
|
38
|
+
"""
|
|
39
|
+
for line in iter(stream.readline, b""):
|
|
40
|
+
decoded = line.decode(errors="replace")
|
|
41
|
+
output_stream.write(decoded)
|
|
42
|
+
output_stream.flush()
|
|
43
|
+
log_func(clean_ansi(decoded.rstrip("\n")))
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
@contextmanager
|
|
47
|
+
def run_subprocess_with_logger(
|
|
48
|
+
cmd: Union[str, List[str]], cwd: Optional[str] = None, env: Optional[dict] = None
|
|
49
|
+
) -> Iterator[subprocess.Popen]:
|
|
50
|
+
"""
|
|
51
|
+
Run a subprocess, redirect stdout to logger.info and stderr to logger.error.
|
|
52
|
+
Returns the Popen object as a context manager.
|
|
53
|
+
|
|
54
|
+
:param cmd: Command to execute
|
|
55
|
+
:param kwargs: Additional arguments passed to subprocess.Popen
|
|
56
|
+
:yield: The subprocess.Popen object
|
|
57
|
+
"""
|
|
58
|
+
|
|
59
|
+
process = subprocess.Popen(
|
|
60
|
+
cmd,
|
|
61
|
+
stdout=subprocess.PIPE,
|
|
62
|
+
stderr=subprocess.PIPE,
|
|
63
|
+
cwd=cwd,
|
|
64
|
+
env=env,
|
|
65
|
+
bufsize=1,
|
|
66
|
+
)
|
|
67
|
+
|
|
68
|
+
threads = [
|
|
69
|
+
threading.Thread(
|
|
70
|
+
target=stream_reader, args=(process.stdout, logger.info, sys.stdout)
|
|
71
|
+
),
|
|
72
|
+
threading.Thread(
|
|
73
|
+
target=stream_reader, args=(process.stderr, logger.error, sys.stderr)
|
|
74
|
+
),
|
|
75
|
+
]
|
|
76
|
+
for t in threads:
|
|
77
|
+
t.start()
|
|
78
|
+
|
|
79
|
+
try:
|
|
80
|
+
yield process
|
|
81
|
+
finally:
|
|
82
|
+
process.wait()
|
|
83
|
+
for t in threads:
|
|
84
|
+
t.join()
|
xoscar/virtualenv/uv.py
CHANGED
|
@@ -24,6 +24,7 @@ from pathlib import Path
|
|
|
24
24
|
from typing import Optional
|
|
25
25
|
|
|
26
26
|
from .core import VirtualEnvManager
|
|
27
|
+
from .utils import run_subprocess_with_logger
|
|
27
28
|
|
|
28
29
|
UV_PATH = os.getenv("XOSCAR_UV_PATH")
|
|
29
30
|
logger = logging.getLogger(__name__)
|
|
@@ -70,9 +71,17 @@ class UVVirtualEnvManager(VirtualEnvManager):
|
|
|
70
71
|
# extend the ability of pip
|
|
71
72
|
# maybe replace #system_torch# to the real version
|
|
72
73
|
packages = self.process_packages(packages)
|
|
74
|
+
log = kwargs.pop("log", False)
|
|
73
75
|
|
|
74
76
|
uv_path = UV_PATH or "uv"
|
|
75
|
-
cmd = [
|
|
77
|
+
cmd = [
|
|
78
|
+
uv_path,
|
|
79
|
+
"pip",
|
|
80
|
+
"install",
|
|
81
|
+
"-p",
|
|
82
|
+
str(self.env_path),
|
|
83
|
+
"--color=always",
|
|
84
|
+
] + packages
|
|
76
85
|
|
|
77
86
|
# Handle known pip-related kwargs
|
|
78
87
|
if "index_url" in kwargs and kwargs["index_url"]:
|
|
@@ -92,8 +101,13 @@ class UVVirtualEnvManager(VirtualEnvManager):
|
|
|
92
101
|
cmd += [option, param_value]
|
|
93
102
|
|
|
94
103
|
logger.info("Installing packages via command: %s", cmd)
|
|
95
|
-
|
|
96
|
-
|
|
104
|
+
if not log:
|
|
105
|
+
self._install_process = process = subprocess.Popen(cmd)
|
|
106
|
+
returncode = process.wait()
|
|
107
|
+
else:
|
|
108
|
+
with run_subprocess_with_logger(cmd) as process:
|
|
109
|
+
self._install_process = process
|
|
110
|
+
returncode = process.returncode
|
|
97
111
|
|
|
98
112
|
self._install_process = None # install finished, clear reference
|
|
99
113
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
xoscar-0.7.
|
|
2
|
-
xoscar-0.7.
|
|
3
|
-
xoscar-0.7.
|
|
4
|
-
xoscar-0.7.
|
|
1
|
+
xoscar-0.7.6.dist-info/RECORD,,
|
|
2
|
+
xoscar-0.7.6.dist-info/WHEEL,sha256=3Qygrk1hDgANQwZ2WnY8NvFNuTorj1Zw9KuT8tN2L7s,136
|
|
3
|
+
xoscar-0.7.6.dist-info/top_level.txt,sha256=vYlqqY4Nys8Thm1hePIuUv8eQePdULVWMmt7lXtX_ZA,21
|
|
4
|
+
xoscar-0.7.6.dist-info/METADATA,sha256=yFaPaVus0ZE31vkzMxminezb084hGtdOpHiTsFVELgI,9134
|
|
5
5
|
xoscar/_utils.pyx,sha256=frgVQ5xGp92jBKc4PsPmjOlVsXlKeHWtTOAMfHmBaII,7380
|
|
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=sy7Wtn2EuQZI0I4Az_MfsBVZm4G0DRj46qRyExgmnJk,1622
|
|
14
14
|
xoscar/api.py,sha256=zxNqOjGiTIKuAip9WJ0LOoM7yevD6P5rb-sLynpZ2Zo,14648
|
|
15
|
-
xoscar/core.cpython-39-darwin.so,sha256=
|
|
15
|
+
xoscar/core.cpython-39-darwin.so,sha256=s8ULACehIZ3kGZrcJkJXwSibZujdU8Ugjrq1h6YIGRA,413352
|
|
16
16
|
xoscar/utils.py,sha256=MaKiW4Vphwhh8c0yoqN8G8hbJr1zXgpf49EdvmGc1ZU,16500
|
|
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=
|
|
21
|
+
xoscar/_utils.cpython-39-darwin.so,sha256=3ZRBRIORqeteVVULrGNoMAs3jXENNbEDlJTVpfY6dMs,161800
|
|
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=
|
|
26
|
+
xoscar/context.cpython-39-darwin.so,sha256=9lDW0HL6G1kcy029LgX_CMzhIJVRbeEb0rjZZdzfD-I,199952
|
|
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=
|
|
46
|
+
xoscar/serialization/core.cpython-39-darwin.so,sha256=yfvGUjkbpvc22OoNmOGiLwzXzCMtBkEx5AOugMmjEq8,391584
|
|
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=
|
|
52
|
+
xoscar/backends/message.cpython-39-darwin.so,sha256=BJbGJt4OhPP-HsVmdzCcwfedev70xXhlkUK2S7NSNQk,355112
|
|
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
|
|
@@ -83,4 +83,5 @@ xoscar/aio/parallelism.py,sha256=VSsjk8wP-Bw7tLeUsTyLVNgp91thjxEfE3pCrw_vF5Q,129
|
|
|
83
83
|
xoscar/aio/base.py,sha256=9j0f1piwfE5R5GIvV212vSD03ixdaeSzSSsO2kxJZVE,2249
|
|
84
84
|
xoscar/virtualenv/__init__.py,sha256=65t9_X1DvbanNjFy366SiiWZrRTpa9SXWMXPmqayE-4,1117
|
|
85
85
|
xoscar/virtualenv/core.py,sha256=dZqwg2IzHsLEERvohZx0rvBINopMRUImqxG3HHGO0q4,2744
|
|
86
|
-
xoscar/virtualenv/
|
|
86
|
+
xoscar/virtualenv/utils.py,sha256=mL_uATHhj82xec0-0IZ6N8yI-laPAB4t8G3alPUGtPA,2439
|
|
87
|
+
xoscar/virtualenv/uv.py,sha256=pwjOlvwz_ZlO1GQg_yqca-G6Ro_0L7H1Uf5dJPB6lQQ,4526
|
|
File without changes
|
|
File without changes
|