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
Jérome Perrin
slapos.buildout
Commits
c9b5f105
Commit
c9b5f105
authored
Feb 14, 2013
by
Chris Withers
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #72 from reinout/update-versions-file-without-show
Fix for #71 - looks good to me.
parents
488a1c8e
397648f1
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
47 additions
and
16 deletions
+47
-16
CHANGES.rst
CHANGES.rst
+1
-1
src/zc/buildout/buildout.py
src/zc/buildout/buildout.py
+9
-9
src/zc/buildout/easy_install.py
src/zc/buildout/easy_install.py
+5
-5
src/zc/buildout/repeatable.txt
src/zc/buildout/repeatable.txt
+32
-1
No files found.
CHANGES.rst
View file @
c9b5f105
...
@@ -4,7 +4,7 @@ Change History
...
@@ -4,7 +4,7 @@ Change History
2.0.1 (2013-02-14)
2.0.1 (2013-02-14)
==================
==================
- Fix
e
for distutils scripts installation on Python 3, related to
- Fix for distutils scripts installation on Python 3, related to
``__pycache__`` directories.
``__pycache__`` directories.
- Fixed: encoding data in non-entry-point-based scripts was lost.
- Fixed: encoding data in non-entry-point-based scripts was lost.
...
...
src/zc/buildout/buildout.py
View file @
c9b5f105
...
@@ -325,8 +325,8 @@ class Buildout(DictMixin):
...
@@ -325,8 +325,8 @@ class Buildout(DictMixin):
self
.
show_picked_versions
=
bool_option
(
options
,
self
.
show_picked_versions
=
bool_option
(
options
,
'show-picked-versions'
)
'show-picked-versions'
)
self
.
update_versions_file
=
options
[
'update-versions-file'
]
self
.
update_versions_file
=
options
[
'update-versions-file'
]
zc
.
buildout
.
easy_install
.
s
how
_picked_versions
(
zc
.
buildout
.
easy_install
.
s
tore
_picked_versions
(
self
.
show_picked_versions
)
self
.
show_picked_versions
or
self
.
update_versions_file
)
download_cache
=
options
.
get
(
'download-cache'
)
download_cache
=
options
.
get
(
'download-cache'
)
if
download_cache
:
if
download_cache
:
...
@@ -996,8 +996,6 @@ class Buildout(DictMixin):
...
@@ -996,8 +996,6 @@ class Buildout(DictMixin):
def
_print_picked_versions
(
self
):
def
_print_picked_versions
(
self
):
Installer
=
zc
.
buildout
.
easy_install
.
Installer
Installer
=
zc
.
buildout
.
easy_install
.
Installer
if
not
self
.
show_picked_versions
:
return
if
not
Installer
.
_picked_versions
:
if
not
Installer
.
_picked_versions
:
# Don't print empty output.
# Don't print empty output.
return
return
...
@@ -1016,11 +1014,13 @@ class Buildout(DictMixin):
...
@@ -1016,11 +1014,13 @@ class Buildout(DictMixin):
output
.
extend
(
required_output
)
output
.
extend
(
required_output
)
print_
(
"Versions had to be automatically picked."
)
if
self
.
show_picked_versions
:
print_
(
"The following part definition lists the versions picked:"
)
print_
(
"Versions had to be automatically picked."
)
print_
(
'
\
n
'
.
join
(
output
))
print_
(
"The following part definition lists the versions picked:"
)
print_
(
'
\
n
'
.
join
(
output
))
if
self
.
update_versions_file
:
if
self
.
update_versions_file
:
#
Also w
rite to the versions file.
#
W
rite to the versions file.
if
os
.
path
.
exists
(
self
.
update_versions_file
):
if
os
.
path
.
exists
(
self
.
update_versions_file
):
output
[:
1
]
=
[
output
[:
1
]
=
[
''
,
''
,
...
@@ -1030,7 +1030,7 @@ class Buildout(DictMixin):
...
@@ -1030,7 +1030,7 @@ class Buildout(DictMixin):
f
=
open
(
self
.
update_versions_file
,
'a'
)
f
=
open
(
self
.
update_versions_file
,
'a'
)
f
.
write
(
'
\
n
'
.
join
(
output
))
f
.
write
(
'
\
n
'
.
join
(
output
))
f
.
close
()
f
.
close
()
print_
(
"
This information has
been written to "
+
print_
(
"
Picked versions have
been written to "
+
self
.
update_versions_file
)
self
.
update_versions_file
)
def
setup
(
self
,
args
):
def
setup
(
self
,
args
):
...
...
src/zc/buildout/easy_install.py
View file @
c9b5f105
...
@@ -129,7 +129,7 @@ class Installer:
...
@@ -129,7 +129,7 @@ class Installer:
_prefer_final
=
True
_prefer_final
=
True
_use_dependency_links
=
True
_use_dependency_links
=
True
_allow_picked_versions
=
True
_allow_picked_versions
=
True
_s
how
_picked_versions
=
False
_s
tore
_picked_versions
=
False
def
__init__
(
self
,
def
__init__
(
self
,
dest
=
None
,
dest
=
None
,
...
@@ -734,10 +734,10 @@ def allow_picked_versions(setting=None):
...
@@ -734,10 +734,10 @@ def allow_picked_versions(setting=None):
Installer
.
_allow_picked_versions
=
bool
(
setting
)
Installer
.
_allow_picked_versions
=
bool
(
setting
)
return
old
return
old
def
s
how
_picked_versions
(
setting
=
None
):
def
s
tore
_picked_versions
(
setting
=
None
):
old
=
Installer
.
_s
how
_picked_versions
old
=
Installer
.
_s
tore
_picked_versions
if
setting
is
not
None
:
if
setting
is
not
None
:
Installer
.
_s
how
_picked_versions
=
bool
(
setting
)
Installer
.
_s
tore
_picked_versions
=
bool
(
setting
)
return
old
return
old
...
@@ -1260,7 +1260,7 @@ class MissingDistribution(zc.buildout.UserError):
...
@@ -1260,7 +1260,7 @@ class MissingDistribution(zc.buildout.UserError):
def
_log_requirement
(
ws
,
req
):
def
_log_requirement
(
ws
,
req
):
if
(
not
logger
.
isEnabledFor
(
logging
.
DEBUG
)
and
if
(
not
logger
.
isEnabledFor
(
logging
.
DEBUG
)
and
not
Installer
.
_s
how
_picked_versions
):
not
Installer
.
_s
tore
_picked_versions
):
# Sorting the working set and iterating over it's requirements
# Sorting the working set and iterating over it's requirements
# is expensive, so short circuit the work if it won't even be
# is expensive, so short circuit the work if it won't even be
# logged. When profiling a simple buildout with 10 parts with
# logged. When profiling a simple buildout with 10 parts with
...
...
src/zc/buildout/repeatable.txt
View file @
c9b5f105
...
@@ -357,7 +357,7 @@ at the end.
...
@@ -357,7 +357,7 @@ at the end.
The following part definition lists the versions picked:
The following part definition lists the versions picked:
[versions]
[versions]
spam = 2
spam = 2
This information has
been written to my_versions.cfg
Picked versions have
been written to my_versions.cfg
The versions file now contains the extra pin:
The versions file now contains the extra pin:
...
@@ -370,6 +370,37 @@ And re-running buildout doesn't report any picked versions anymore:
...
@@ -370,6 +370,37 @@ And re-running buildout doesn't report any picked versions anymore:
Updating foo.
Updating foo.
recipe v2
recipe v2
If you've enabled ``update-versions-file`` but not ``show-picked-versions``,
buildout will append the versions to your versions file anyway (without
printing them to the console):
>>> write('my_versions.cfg',
... '''
... [versions]
... distribute = 0.6.34
... ''')
>>> write('buildout.cfg',
... '''
... [buildout]
... parts = foo
... extends = my_versions.cfg
... update-versions-file = my_versions.cfg
... find-links = %s
... show-picked-versions = false
...
... [foo]
... recipe = spam
... ''' % join('recipe', 'dist'))
>>> print_(system(buildout), end='') # doctest: +ELLIPSIS
Updating foo.
recipe v2
Picked versions have been written to my_versions.cfg
The versions file contains the extra pin:
>>> 'spam = 2' in open('my_versions.cfg').read()
True
Because buildout now includes buildout-versions' (and the older
Because buildout now includes buildout-versions' (and the older
buildout.dumppickedversions') functionality, it warns if these extensions are
buildout.dumppickedversions') functionality, it warns if these extensions are
configured.
configured.
...
...
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