Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
OpenDAS
vllm_cscc
Commits
8af5a5c4
Unverified
Commit
8af5a5c4
authored
Apr 01, 2025
by
yihong
Committed by
GitHub
Apr 01, 2025
Browse files
fix: can not use uv run collect_env close #13888 (#15792)
Signed-off-by:
yihong0618
<
zouzou0208@gmail.com
>
parent
3a5f0afc
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
6 deletions
+18
-6
collect_env.py
collect_env.py
+18
-6
No files found.
collect_env.py
View file @
8af5a5c4
...
@@ -482,16 +482,28 @@ def get_pip_packages(run_lambda, patterns=None):
...
@@ -482,16 +482,28 @@ def get_pip_packages(run_lambda, patterns=None):
if
patterns
is
None
:
if
patterns
is
None
:
patterns
=
DEFAULT_PIP_PATTERNS
patterns
=
DEFAULT_PIP_PATTERNS
# People generally have `pip` as `pip` or `pip3`
def
run_with_pip
():
# But here it is invoked as `python -mpip`
try
:
def
run_with_pip
(
pip
):
import
importlib.util
out
=
run_and_read_all
(
run_lambda
,
pip
+
[
"list"
,
"--format=freeze"
])
pip_spec
=
importlib
.
util
.
find_spec
(
'pip'
)
pip_available
=
pip_spec
is
not
None
except
ImportError
:
pip_available
=
False
if
pip_available
:
cmd
=
[
sys
.
executable
,
'-mpip'
,
'list'
,
'--format=freeze'
]
elif
os
.
environ
.
get
(
"UV"
)
is
not
None
:
print
(
"uv is set"
)
cmd
=
[
"uv"
,
"pip"
,
"list"
,
"--format=freeze"
]
else
:
raise
RuntimeError
(
"Could not collect pip list output (pip or uv module not available)"
)
out
=
run_and_read_all
(
run_lambda
,
cmd
)
return
"
\n
"
.
join
(
line
for
line
in
out
.
splitlines
()
return
"
\n
"
.
join
(
line
for
line
in
out
.
splitlines
()
if
any
(
name
in
line
for
name
in
patterns
))
if
any
(
name
in
line
for
name
in
patterns
))
pip_version
=
'pip3'
if
sys
.
version
[
0
]
==
'3'
else
'pip'
pip_version
=
'pip3'
if
sys
.
version
[
0
]
==
'3'
else
'pip'
out
=
run_with_pip
([
sys
.
executable
,
'-mpip'
])
out
=
run_with_pip
()
return
pip_version
,
out
return
pip_version
,
out
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment