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
5c99921b
Commit
5c99921b
authored
Sep 21, 2023
by
Xavier Thompson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Revert "WIP attempt to do --respect-pinned"
This reverts commit
b0859c20
.
parent
b0859c20
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
42 additions
and
57 deletions
+42
-57
src/zc/buildout/buildout.py
src/zc/buildout/buildout.py
+35
-41
src/zc/buildout/easy_install.py
src/zc/buildout/easy_install.py
+7
-16
No files found.
src/zc/buildout/buildout.py
View file @
5c99921b
...
...
@@ -607,21 +607,18 @@ class Buildout(DictMixin):
def
bootstrap
(
self
,
args
):
__doing__
=
'Bootstrapping.'
options
=
self
[
'buildout'
]
eggs_dir
=
options
[
'eggs-directory'
]
develop_eggs_dir
=
options
[
'develop-eggs-directory'
]
if
os
.
path
.
exists
(
develop_eggs_dir
):
if
os
.
path
.
isdir
(
develop_eggs_dir
):
rmtree
(
develop_eggs_dir
)
self
.
_logger
.
debug
(
"Removed existing develop-eggs directory"
)
if
os
.
path
.
exists
(
self
[
'buildout'
][
'develop-eggs-directory'
]):
if
os
.
path
.
isdir
(
self
[
'buildout'
][
'develop-eggs-directory'
]):
rmtree
(
self
[
'buildout'
][
'develop-eggs-directory'
])
self
.
_logger
.
debug
(
"Removed existing develop-eggs directory"
)
self
.
_setup_directories
()
if
'--
respect-pinned
'
in
args
:
# Now install buildout and dependent eggs
dest
=
eggs_dir
path
=
[
develop_eggs_dir
]
if
'--
all-local
'
in
args
:
# Now install buildout and dependent eggs
, and record destination eggs:
dest
=
self
[
'buildout'
][
'eggs-directory'
]
path
=
[
self
[
'buildout'
][
'develop-eggs-directory'
]
]
if
self
.
offline
:
# Cannot install: just check requirements are already met
path
.
append
(
dest
)
...
...
@@ -630,46 +627,43 @@ class Buildout(DictMixin):
[
'zc.buildout'
],
dest
,
links
=
self
.
_links
,
index
=
options
.
get
(
'index'
),
index
=
self
[
'buildout'
]
.
get
(
'index'
),
path
=
path
,
newest
=
self
.
newest
,
allow_hosts
=
self
.
_allow_hosts
,
)
else
:
ws
=
zc
.
buildout
.
easy_install
.
buildout_and_setuptools_dists
# Now copy buildout and setuptools eggs, and record destination eggs:
entries
=
[]
for
dist
in
ws
.
require
(
'zc.buildout'
):
print
(
dist
)
if
os
.
path
.
dirname
(
dist
.
location
)
in
(
eggs_dir
,
develop_eggs_dir
):
print
(
"ok "
,
dist
.
location
)
entries
.
append
(
dist
.
location
)
elif
dist
.
precedence
==
pkg_resources
.
DEVELOP_DIST
:
dest
=
os
.
path
.
join
(
self
[
'buildout'
][
'develop-eggs-directory'
],
dist
.
key
+
'.egg-link'
)
with
open
(
dest
,
'w'
)
as
fh
:
fh
.
write
(
dist
.
location
)
print
(
"dev"
,
dist
.
location
)
entries
.
append
(
dist
.
location
)
else
:
dest
=
os
.
path
.
join
(
self
[
'buildout'
][
'eggs-directory'
],
os
.
path
.
basename
(
dist
.
location
))
print
(
"cpy"
,
dest
)
entries
.
append
(
dest
)
if
not
os
.
path
.
exists
(
dest
):
if
os
.
path
.
isdir
(
dist
.
location
):
shutil
.
copytree
(
dist
.
location
,
dest
)
else
:
shutil
.
copy2
(
dist
.
location
,
dest
)
# Now copy buildout and setuptools eggs, and record destination eggs:
entries
=
[]
for
dist
in
zc
.
buildout
.
easy_install
.
buildout_and_setuptools_dists
:
if
dist
.
precedence
==
pkg_resources
.
DEVELOP_DIST
:
dest
=
os
.
path
.
join
(
self
[
'buildout'
][
'develop-eggs-directory'
],
dist
.
key
+
'.egg-link'
)
with
open
(
dest
,
'w'
)
as
fh
:
fh
.
write
(
dist
.
location
)
entries
.
append
(
dist
.
location
)
else
:
dest
=
os
.
path
.
join
(
self
[
'buildout'
][
'eggs-directory'
],
os
.
path
.
basename
(
dist
.
location
))
entries
.
append
(
dest
)
if
not
os
.
path
.
exists
(
dest
):
if
os
.
path
.
isdir
(
dist
.
location
):
shutil
.
copytree
(
dist
.
location
,
dest
)
else
:
shutil
.
copy2
(
dist
.
location
,
dest
)
ws
=
pkg_resources
.
WorkingSet
(
entries
)
ws
=
pkg_resources
.
WorkingSet
(
entries
)
# Ensure all the requirements are met
ws
.
require
(
'zc.buildout'
)
# Create buildout script
options
=
self
[
'buildout'
]
eggs_dir
=
options
[
'eggs-directory'
]
develop_eggs_dir
=
options
[
'develop-eggs-directory'
]
ws
=
zc
.
buildout
.
easy_install
.
sort_working_set
(
ws
,
eggs_dir
=
eggs_dir
,
develop_eggs_dir
=
None
develop_eggs_dir
=
develop_eggs_dir
)
zc
.
buildout
.
easy_install
.
scripts
(
[
'zc.buildout'
],
ws
,
sys
.
executable
,
...
...
src/zc/buildout/easy_install.py
View file @
5c99921b
...
...
@@ -69,10 +69,6 @@ default_index_url = os.environ.get(
)
logger
=
logging
.
getLogger
(
'zc.buildout.easy_install'
)
def
info
(
fmt
,
*
args
):
print
(
fmt
%
args
)
logger
.
info
=
info
logger
.
debug
=
info
url_match
=
re
.
compile
(
'[a-z0-9+.-]+://'
).
match
is_source_encoding_line
=
re
.
compile
(
r'coding[:=]\
s*([-
\w.]+)'
).
search
...
...
@@ -1958,20 +1954,15 @@ def _move_to_eggs_dir_and_compile(dist, dest):
return
newdist
def
sort_working_set
(
ws
,
eggs_dir
,
develop_eggs_dir
=
None
):
def
sort_working_set
(
ws
,
eggs_dir
,
develop_eggs_dir
):
develop_paths
=
set
()
pattern
=
os
.
path
.
join
(
develop_eggs_dir
,
'*.egg-link'
)
for
egg_link
in
glob
.
glob
(
pattern
):
with
open
(
egg_link
,
'rt'
)
as
f
:
path
=
f
.
readline
().
strip
()
if
path
:
develop_paths
.
add
(
path
)
if
develop_eggs_dir
:
pattern
=
os
.
path
.
join
(
develop_eggs_dir
,
'*.egg-link'
)
for
egg_link
in
glob
.
glob
(
pattern
):
with
open
(
egg_link
,
'rt'
)
as
f
:
path
=
f
.
readline
().
strip
()
if
path
:
develop_paths
.
add
(
path
)
print
(
develop_paths
)
print
(
ws
.
entries
)
print
([
dist
for
dist
in
ws
])
sorted_paths
=
[]
egg_paths
=
[]
other_paths
=
[]
...
...
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