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
9d63021a
Commit
9d63021a
authored
Mar 08, 2021
by
Godefroid Chapelle
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Problem: error message is not explicit
Solution: expand it to sthing more detailed
parent
c7e22a45
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
31 additions
and
4 deletions
+31
-4
news/481.feature
news/481.feature
+1
-0
src/zc/buildout/easy_install.py
src/zc/buildout/easy_install.py
+19
-4
src/zc/buildout/tests/easy_install.txt
src/zc/buildout/tests/easy_install.txt
+10
-0
src/zc/buildout/tests/repeatable.txt
src/zc/buildout/tests/repeatable.txt
+1
-0
No files found.
news/481.feature
0 → 100644
View file @
9d63021a
Improve
error
message
when
a
package version is not pinned and `allow-picked-versions = false`.
src/zc/buildout/easy_install.py
View file @
9d63021a
...
@@ -635,10 +635,11 @@ class Installer(object):
...
@@ -635,10 +635,11 @@ class Installer(object):
self
.
_picked_versions
[
dist
.
project_name
]
=
dist
.
version
self
.
_picked_versions
[
dist
.
project_name
]
=
dist
.
version
if
not
self
.
_allow_picked_versions
:
if
not
self
.
_allow_picked_versions
:
raise
zc
.
buildout
.
UserError
(
msg
=
NOT_PICKED_AND_NOT_ALLOWED
.
format
(
'Picked: %s = %s'
%
(
dist
.
project_name
,
name
=
dist
.
project_name
,
dist
.
version
)
version
=
dist
.
version
)
)
raise
zc
.
buildout
.
UserError
(
msg
)
def
_maybe_add_setuptools
(
self
,
ws
,
dist
):
def
_maybe_add_setuptools
(
self
,
ws
,
dist
):
if
dist_needs_pkg_resources
(
dist
):
if
dist_needs_pkg_resources
(
dist
):
...
@@ -1949,3 +1950,17 @@ def sort_working_set(ws, eggs_dir, develop_eggs_dir):
...
@@ -1949,3 +1950,17 @@ def sort_working_set(ws, eggs_dir, develop_eggs_dir):
sorted_paths
.
extend
(
egg_paths
)
sorted_paths
.
extend
(
egg_paths
)
sorted_paths
.
extend
(
other_paths
)
sorted_paths
.
extend
(
other_paths
)
return
pkg_resources
.
WorkingSet
(
sorted_paths
)
return
pkg_resources
.
WorkingSet
(
sorted_paths
)
NOT_PICKED_AND_NOT_ALLOWED
=
"""
\
Picked: {name} = {version}
The `{name}` egg does not have a version pin and `allow-picked-versions = false`.
To resolve this, add
{name} = {version}
to the [versions] section,
OR set `allow-picked-versions = true`."""
src/zc/buildout/tests/easy_install.txt
View file @
9d63021a
...
@@ -383,6 +383,16 @@ We can request that we get an error if versions are picked:
...
@@ -383,6 +383,16 @@ We can request that we get an error if versions are picked:
Traceback (most recent call last):
Traceback (most recent call last):
...
...
UserError: Picked: demo = 0.3
UserError: Picked: demo = 0.3
<BLANKLINE>
The `demo` egg does not have a version pin and `allow-picked-versions = false`.
<BLANKLINE>
To resolve this, add
<BLANKLINE>
demo = 0.3
<BLANKLINE>
to the [versions] section,
<BLANKLINE>
OR set `allow-picked-versions = true`.
>>> zc.buildout.easy_install.allow_picked_versions(True)
>>> zc.buildout.easy_install.allow_picked_versions(True)
False
False
...
...
src/zc/buildout/tests/repeatable.txt
View file @
9d63021a
...
@@ -209,6 +209,7 @@ versions:
...
@@ -209,6 +209,7 @@ versions:
Installing recipe spam.
Installing recipe spam.
Getting distribution for 'spam'.
Getting distribution for 'spam'.
Error: Picked: spam = 2
Error: Picked: spam = 2
...
We can name a version something else, if we wish, using the versions option:
We can name a version something else, if we wish, using the versions option:
...
...
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