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
e67e8a57
Commit
e67e8a57
authored
Apr 30, 2024
by
Xavier Thompson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[wkrd] Warn when bootstrap finds .{dist|egg}-info
And avoid creating a .egg-link pointing to their location.
parent
b2607926
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
12 deletions
+26
-12
src/zc/buildout/buildout.py
src/zc/buildout/buildout.py
+16
-12
src/zc/buildout/easy_install.py
src/zc/buildout/easy_install.py
+10
-0
No files found.
src/zc/buildout/buildout.py
View file @
e67e8a57
...
@@ -764,13 +764,7 @@ class Buildout(DictMixin):
...
@@ -764,13 +764,7 @@ class Buildout(DictMixin):
# XXX Note: except if the current modules are not eggs. In particular,
# XXX Note: except if the current modules are not eggs. In particular,
# this concerns .dist-info packages installed by pip in site-packages
# this concerns .dist-info packages installed by pip in site-packages
# or elsewhere: setuptools does not distinguish dists installed by pip
# or elsewhere.
# from actual develop dists. This may lead to the creation of .egg-link
# files in ./develop-eggs linking to the original location.
# A special-case exception is made when the location is site-packages
# to avoid putting links to site-packages in ./develop-eggs. This is
# merely a mitigation and does not preclude other shared locations
# being linked in ./develop-eggs.
# Sort the working set to keep entries with single dists first.
# Sort the working set to keep entries with single dists first.
options
=
self
[
'buildout'
]
options
=
self
[
'buildout'
]
...
@@ -787,6 +781,9 @@ class Buildout(DictMixin):
...
@@ -787,6 +781,9 @@ class Buildout(DictMixin):
# Now copy buildout and setuptools eggs, and record destination eggs.
# Now copy buildout and setuptools eggs, and record destination eggs.
# XXX Note: dists using .dist-info format - e.g. packages installed by
# XXX Note: dists using .dist-info format - e.g. packages installed by
# pip in site-packages - will be seen as develop dists and not copied.
# pip in site-packages - will be seen as develop dists and not copied.
# Instead of linking them in ./develop-eggs like actual develop dists,
# a warning is emitted to avoid linking a directory that can contain
# multiple dists, with unintended and unexpected results later.
egg_entries
=
[]
egg_entries
=
[]
develop_dists
=
[]
develop_dists
=
[]
for
dist
in
ws
:
for
dist
in
ws
:
...
@@ -800,12 +797,19 @@ class Buildout(DictMixin):
...
@@ -800,12 +797,19 @@ class Buildout(DictMixin):
"Consider using 'buildout:extra-paths=' to install it "
"Consider using 'buildout:extra-paths=' to install it "
"from scratch in isolation directly in eggs-directory."
"from scratch in isolation directly in eggs-directory."
%
(
dist
,
dist
.
location
))
%
(
dist
,
dist
.
location
))
# XXX: TODO: Ideally we should be able to distinguish
# .dist-info dists from develop dists, and support bundling
# .dist-info packages into individual '.dist' bundles that
# could be put in ./eggs, with support in buildout for
# using such distribution.
continue
continue
elif
zc
.
buildout
.
easy_install
.
is_externally_managed_dist
(
dist
):
# Exception for .dist-info and .egg-info
self
.
_logger
.
warning
(
"Distribution %s (%s) is a .dist-info or a .egg-info. "
"Avoiding creating a link in develop-eggs-directory.
\
n
"
"Consider using 'buildout:extra-paths=' to install it "
"from scratch in isolation directly in eggs-directory."
%
(
dist
,
dist
.
location
))
continue
# XXX: Maybe support bundling <project>.dist-info and <project>
# into a containing <project>.dist directory and copying it in
# ./eggs when the dist found is a .dist-info.
dest
=
os
.
path
.
join
(
self
[
'buildout'
][
'develop-eggs-directory'
],
dest
=
os
.
path
.
join
(
self
[
'buildout'
][
'develop-eggs-directory'
],
dist
.
key
+
'.egg-link'
)
dist
.
key
+
'.egg-link'
)
with
open
(
dest
,
'w'
)
as
fh
:
with
open
(
dest
,
'w'
)
as
fh
:
...
...
src/zc/buildout/easy_install.py
View file @
e67e8a57
...
@@ -1910,6 +1910,16 @@ UNPACKERS = {
...
@@ -1910,6 +1910,16 @@ UNPACKERS = {
}
}
def
is_dist_info
(
dist
):
return
isinstance
(
dist
,
pkg_resources
.
DistInfoDistribution
)
def
is_egg_info
(
dist
):
return
isinstance
(
dist
,
pkg_resources
.
EggInfoDistribution
)
def
is_externally_managed_dist
(
dist
):
return
is_dist_info
(
dist
)
or
is_egg_info
(
dist
)
def
_get_matching_dist_in_location
(
dist
,
location
):
def
_get_matching_dist_in_location
(
dist
,
location
):
"""
"""
Check if `locations` contain only the one intended dist.
Check if `locations` contain only the one intended dist.
...
...
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