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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Xavier Thompson
slapos.buildout
Commits
dc662c5d
Commit
dc662c5d
authored
Dec 14, 2023
by
Xavier Thompson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[tmp] Prevent pip installing build requirements
parent
4147f30b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
6 deletions
+12
-6
src/zc/buildout/easy_install.py
src/zc/buildout/easy_install.py
+12
-6
No files found.
src/zc/buildout/easy_install.py
View file @
dc662c5d
...
...
@@ -450,7 +450,7 @@ class Installer(object):
tmp
=
tempfile
.
mkdtemp
(
dir
=
dest
)
try
:
paths
=
call_pip_install
(
spec
,
tmp
)
paths
=
call_pip_install
(
spec
,
tmp
,
self
)
dists
=
[]
env
=
pkg_resources
.
Environment
(
paths
)
...
...
@@ -482,7 +482,7 @@ class Installer(object):
result
=
[]
for
d
in
dists
:
result
.
append
(
_move_to_eggs_dir_and_compile
(
d
,
dest
))
result
.
append
(
_move_to_eggs_dir_and_compile
(
d
,
dest
,
self
))
return
result
...
...
@@ -668,7 +668,7 @@ class Installer(object):
raise
zc
.
buildout
.
UserError
(
"Couldn't download distribution %s."
%
avail
)
dists
=
[
_move_to_eggs_dir_and_compile
(
dist
,
self
.
_dest
)]
dists
=
[
_move_to_eggs_dir_and_compile
(
dist
,
self
.
_dest
,
self
)]
for
_d
in
dists
:
if
_d
not
in
ws
:
ws
.
add
(
_d
,
replace
=
True
)
...
...
@@ -1815,7 +1815,7 @@ class IncompatibleConstraintError(zc.buildout.UserError):
IncompatibleVersionError
=
IncompatibleConstraintError
# Backward compatibility
def
call_pip_install
(
spec
,
dest
):
def
call_pip_install
(
spec
,
dest
,
options
):
"""
Call `pip install` from a subprocess to install a
distribution specified by `spec` into `dest`.
...
...
@@ -1828,6 +1828,12 @@ def call_pip_install(spec, dest):
else
:
args
.
append
(
'-v'
)
# Try to prevent pip from installing build dependencies implicitly
# and without respecting pinned versions, on the fly
if
not
options
.
_allow_picked_versions
:
args
.
append
(
'--no-index'
)
args
.
append
(
'--no-build-isolation'
)
args
.
append
(
spec
)
try
:
...
...
@@ -2035,7 +2041,7 @@ def _get_matching_dist_in_location(dist, location):
if
dist_infos
==
[(
dist
.
project_name
.
lower
(),
dist
.
parsed_version
)]:
return
dists
.
pop
()
def
_move_to_eggs_dir_and_compile
(
dist
,
dest
):
def
_move_to_eggs_dir_and_compile
(
dist
,
dest
,
options
):
"""Move distribution to the eggs destination directory.
And compile the py files, if we have actually moved the dist.
...
...
@@ -2076,7 +2082,7 @@ def _move_to_eggs_dir_and_compile(dist, dest):
unpacker
(
dist
.
location
,
tmp_dest
)
[
tmp_loc
]
=
glob
.
glob
(
os
.
path
.
join
(
tmp_dest
,
'*'
))
else
:
[
tmp_loc
]
=
call_pip_install
(
dist
.
location
,
tmp_dest
)
[
tmp_loc
]
=
call_pip_install
(
dist
.
location
,
tmp_dest
,
options
)
installed_with_pip
=
True
# We have installed the dist. Now try to rename/move it.
...
...
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