Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
slapos.buildout
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kirill Smelkov
slapos.buildout
Commits
ff826335
Commit
ff826335
authored
Dec 16, 2021
by
Godefroid Chapelle
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Problem: pip is called via internals
Solution: use `python -m pip`
parent
2b6995c6
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
18 deletions
+9
-18
news/569.bugfix
news/569.bugfix
+1
-0
src/zc/buildout/easy_install.py
src/zc/buildout/easy_install.py
+8
-8
src/zc/buildout/pip_support.py
src/zc/buildout/pip_support.py
+0
-10
No files found.
news/569.bugfix
0 → 100644
View file @
ff826335
Call pip via `python -m pip`.
src/zc/buildout/easy_install.py
View file @
ff826335
...
...
@@ -40,7 +40,6 @@ import zc.buildout
import
zc.buildout.rmtree
from
zc.buildout
import
WINDOWS
from
zc.buildout
import
PY3
from
zc.buildout.pip_support
import
pip_install_cmd
as
_pip_install_cmd
import
warnings
import
csv
...
...
@@ -1656,11 +1655,7 @@ def call_pip_install(spec, dest):
distribution specified by `spec` into `dest`.
Returns all the paths inside `dest` created by the above.
"""
path
=
pip_path
args
=
[
sys
.
executable
,
'-c'
,
(
'import sys; sys.path[0:0] = %r; '
%
path
)
+
_pip_install_cmd
,
'install'
,
'--no-deps'
,
'-t'
,
dest
]
args
=
[
sys
.
executable
,
'-m'
,
'pip'
,
'install'
,
'--no-deps'
,
'-t'
,
dest
]
level
=
logger
.
getEffectiveLevel
()
if
level
>=
logging
.
INFO
:
args
.
append
(
'-q'
)
...
...
@@ -1680,13 +1675,18 @@ def call_pip_install(spec, dest):
else
:
args
.
append
(
'--no-python-version-warning'
)
env
=
copy
.
copy
(
os
.
environ
)
python_path
=
copy
.
copy
(
pip_path
)
python_path
.
append
(
env
.
get
(
'PYTHONPATH'
,
''
))
env
[
'PYTHONPATH'
]
=
os
.
pathsep
.
join
(
python_path
)
if
level
<=
logging
.
DEBUG
:
logger
.
debug
(
'Running pip install:
\
n
"%s"
\
n
path=%s
\
n
'
,
'" "'
.
join
(
args
),
path
)
'" "'
.
join
(
args
),
p
ip_p
ath
)
sys
.
stdout
.
flush
()
# We want any pending output first
exit_code
=
subprocess
.
call
(
list
(
args
))
exit_code
=
subprocess
.
call
(
list
(
args
)
,
env
=
env
)
if
exit_code
:
logger
.
error
(
...
...
src/zc/buildout/pip_support.py
deleted
100644 → 0
View file @
2b6995c6
try
:
# support pip>=19.0
from
pip._internal.cli.main
import
main
pip_install_cmd
=
(
'from pip._internal.cli.main import main; sys.exit(main())'
)
except
ImportError
:
# support pip>=10.0
from
pip._internal
import
main
pip_install_cmd
=
'from pip._internal import main; sys.exit(main())'
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