Commit ecb15c89 authored by Godefroid Chapelle's avatar Godefroid Chapelle Committed by GitHub

Merge pull request #378 from buildout/annotate_verbose

verbose mode and select sections for annotate command
parents d6fba392 35ffe41f
.installed.cfg .installed.cfg
bin/ bin/
build/ build/
include/
develop-eggs/ develop-eggs/
eggs/ eggs/
parts/ parts/
......
...@@ -4,7 +4,9 @@ Change History ...@@ -4,7 +4,9 @@ Change History
2.9.3 (unreleased) 2.9.3 (unreleased)
================== ==================
- Nothing changed yet. - Add more verbosity to ``annotate`` results with ``-v``
- Select one or more sections with arguments after ``buildout annotate``.
2.9.2 (2017-03-06) 2.9.2 (2017-03-06)
......
...@@ -117,6 +117,19 @@ where they came from. Try it! ...@@ -117,6 +117,19 @@ where they came from. Try it!
.. _bootstrap-command: .. _bootstrap-command:
.. code-block:: console
buildout -v annotate
Increase the verbosity of the output to display all steps that compute the final values used by buildout.
.. code-block:: console
buildout annotate versions
You can pass one or more section names as arguments to display annotation only for the given sections.
bootstrap bootstrap
_________ _________
......
This diff is collapsed.
...@@ -809,7 +809,7 @@ the origin of the value (file name or ``COMPUTED_VALUE``, ``DEFAULT_VALUE``, ...@@ -809,7 +809,7 @@ the origin of the value (file name or ``COMPUTED_VALUE``, ``DEFAULT_VALUE``,
bin-directory= bin bin-directory= bin
DEFAULT_VALUE DEFAULT_VALUE
develop= recipes develop= recipes
/sample-buildout/buildout.cfg buildout.cfg
develop-eggs-directory= develop-eggs develop-eggs-directory= develop-eggs
DEFAULT_VALUE DEFAULT_VALUE
directory= /sample-buildout directory= /sample-buildout
...@@ -833,7 +833,7 @@ the origin of the value (file name or ``COMPUTED_VALUE``, ``DEFAULT_VALUE``, ...@@ -833,7 +833,7 @@ the origin of the value (file name or ``COMPUTED_VALUE``, ``DEFAULT_VALUE``,
offline= false offline= false
DEFAULT_VALUE DEFAULT_VALUE
parts= data-dir parts= data-dir
/sample-buildout/buildout.cfg buildout.cfg
parts-directory= parts parts-directory= parts
DEFAULT_VALUE DEFAULT_VALUE
prefer-final= true prefer-final= true
...@@ -853,9 +853,178 @@ the origin of the value (file name or ``COMPUTED_VALUE``, ``DEFAULT_VALUE``, ...@@ -853,9 +853,178 @@ the origin of the value (file name or ``COMPUTED_VALUE``, ``DEFAULT_VALUE``,
<BLANKLINE> <BLANKLINE>
[data-dir] [data-dir]
path= foo bins path= foo bins
/sample-buildout/buildout.cfg buildout.cfg
recipe= recipes:mkdir recipe= recipes:mkdir
/sample-buildout/buildout.cfg buildout.cfg
<BLANKLINE>
[versions]
zc.buildout = >=1.99
DEFAULT_VALUE
zc.recipe.egg = >=1.99
DEFAULT_VALUE
<BLANKLINE>
The ``annotate`` command is sensitive to the verbosity flag.
You get more information about the way values are computed::
>>> print_(system(buildout+ ' -v annotate'), end='')
... # doctest: +ELLIPSIS +NORMALIZE_WHITESPACE
<BLANKLINE>
Annotated sections
==================
<BLANKLINE>
[buildout]
allow-hosts= *
<BLANKLINE>
AS DEFAULT_VALUE
SET VALUE = *
<BLANKLINE>
allow-picked-versions= true
<BLANKLINE>
AS DEFAULT_VALUE
SET VALUE = true
<BLANKLINE>
bin-directory= bin
<BLANKLINE>
AS DEFAULT_VALUE
SET VALUE = bin
<BLANKLINE>
develop= recipes
<BLANKLINE>
IN buildout.cfg
SET VALUE = recipes
<BLANKLINE>
develop-eggs-directory= develop-eggs
<BLANKLINE>
AS DEFAULT_VALUE
SET VALUE = develop-eggs
<BLANKLINE>
directory= /sample-buildout
<BLANKLINE>
AS COMPUTED_VALUE
SET VALUE = /sample-buildout
<BLANKLINE>
eggs-directory= /sample-buildout/eggs
<BLANKLINE>
AS DEFAULT_VALUE
DIRECTORY VALUE = /sample-buildout/eggs
AS DEFAULT_VALUE
SET VALUE = eggs
<BLANKLINE>
executable= ...
<BLANKLINE>
AS DEFAULT_VALUE
SET VALUE = ...
<BLANKLINE>
find-links=
<BLANKLINE>
AS DEFAULT_VALUE
SET VALUE =
<BLANKLINE>
install-from-cache= false
<BLANKLINE>
AS DEFAULT_VALUE
SET VALUE = false
<BLANKLINE>
installed= .installed.cfg
<BLANKLINE>
AS DEFAULT_VALUE
SET VALUE = .installed.cfg
<BLANKLINE>
log-format=
<BLANKLINE>
AS DEFAULT_VALUE
SET VALUE =
<BLANKLINE>
log-level= INFO
<BLANKLINE>
AS DEFAULT_VALUE
SET VALUE = INFO
<BLANKLINE>
newest= true
<BLANKLINE>
AS DEFAULT_VALUE
SET VALUE = true
<BLANKLINE>
offline= false
<BLANKLINE>
AS DEFAULT_VALUE
SET VALUE = false
<BLANKLINE>
parts= data-dir
<BLANKLINE>
IN buildout.cfg
SET VALUE = data-dir
<BLANKLINE>
parts-directory= parts
<BLANKLINE>
AS DEFAULT_VALUE
SET VALUE = parts
<BLANKLINE>
prefer-final= true
<BLANKLINE>
AS DEFAULT_VALUE
SET VALUE = true
<BLANKLINE>
python= buildout
<BLANKLINE>
AS DEFAULT_VALUE
SET VALUE = buildout
<BLANKLINE>
show-picked-versions= false
<BLANKLINE>
AS DEFAULT_VALUE
SET VALUE = false
<BLANKLINE>
socket-timeout=
<BLANKLINE>
AS DEFAULT_VALUE
SET VALUE =
<BLANKLINE>
update-versions-file=
<BLANKLINE>
AS DEFAULT_VALUE
SET VALUE =
<BLANKLINE>
use-dependency-links= true
<BLANKLINE>
AS DEFAULT_VALUE
SET VALUE = true
<BLANKLINE>
verbosity= 10
<BLANKLINE>
AS COMMAND_LINE_VALUE
SET VALUE = 10
<BLANKLINE>
versions= versions
<BLANKLINE>
AS DEFAULT_VALUE
SET VALUE = versions
<BLANKLINE>
<BLANKLINE>
[data-dir]
path= foo bins
<BLANKLINE>
IN buildout.cfg
SET VALUE = foo bins
<BLANKLINE>
recipe= recipes:mkdir
<BLANKLINE>
IN buildout.cfg
SET VALUE = recipes:mkdir
<BLANKLINE>
<BLANKLINE>
[versions]
...
The output of the ``annotate`` command can be very long.
You can restrict the output to some sections by passing section names as arguments::
>>> print_(system(buildout+ ' annotate versions'), end='')
... # doctest: +ELLIPSIS +NORMALIZE_WHITESPACE
<BLANKLINE>
Annotated sections
==================
<BLANKLINE> <BLANKLINE>
[versions] [versions]
zc.buildout= >=1.99 zc.buildout= >=1.99
...@@ -1384,42 +1553,42 @@ operations:: ...@@ -1384,42 +1553,42 @@ operations::
option= a1 a2 option= a1 a2
a3 a4 a3 a4
a5 a5
/sample-buildout/base.cfg base.cfg
+= /sample-buildout/extension1.cfg += extension1.cfg
+= /sample-buildout/extension2.cfg += extension2.cfg
recipe= recipe=
/sample-buildout/base.cfg base.cfg
<BLANKLINE> <BLANKLINE>
[part2] [part2]
option= b1 b2 b3 b4 option= b1 b2 b3 b4
/sample-buildout/base.cfg base.cfg
-= /sample-buildout/extension1.cfg -= extension1.cfg
-= /sample-buildout/extension2.cfg -= extension2.cfg
recipe= recipe=
/sample-buildout/base.cfg base.cfg
<BLANKLINE> <BLANKLINE>
[part3] [part3]
option= c1 c2 option= c1 c2
c3 c4 c5 c3 c4 c5
/sample-buildout/base.cfg base.cfg
+= /sample-buildout/extension1.cfg += extension1.cfg
recipe= recipe=
/sample-buildout/base.cfg base.cfg
<BLANKLINE> <BLANKLINE>
[part4] [part4]
option= d2 option= d2
d3 d3
d1 d1
d4 d4
/sample-buildout/base.cfg base.cfg
+= /sample-buildout/extension1.cfg += extension1.cfg
-= /sample-buildout/extension1.cfg -= extension1.cfg
recipe= recipe=
/sample-buildout/base.cfg base.cfg
<BLANKLINE> <BLANKLINE>
[part5] [part5]
option= h1 h2 option= h1 h2
/sample-buildout/extension1.cfg extension1.cfg
[versions] [versions]
zc.buildout= >=1.99 zc.buildout= >=1.99
DEFAULT_VALUE DEFAULT_VALUE
...@@ -1427,6 +1596,77 @@ operations:: ...@@ -1427,6 +1596,77 @@ operations::
DEFAULT_VALUE DEFAULT_VALUE
<BLANKLINE> <BLANKLINE>
With more verbosity::
>>> print_(system(os.path.join('bin', 'buildout') + ' -v annotate'), end='')
... # doctest: +ELLIPSIS +NORMALIZE_WHITESPACE
<BLANKLINE>
Annotated sections
==================
...
[part1]
option= a1 a2
a3 a4
a5
<BLANKLINE>
IN extension2.cfg
ADD VALUE = a5
IN extension1.cfg
ADD VALUE = a3 a4
IN base.cfg
SET VALUE = a1 a2
<BLANKLINE>
...
[part2]
option= b1 b2 b3 b4
<BLANKLINE>
IN extension2.cfg
REMOVE VALUE = b1 b2 b3
IN extension1.cfg
REMOVE VALUE = b1 b2
IN base.cfg
SET VALUE = b1 b2 b3 b4
<BLANKLINE>
...
[part3]
option=
c1 c2
c3 c4 c5
<BLANKLINE>
IN extension1.cfg
ADD VALUE = c3 c4 c5
IN base.cfg
SET VALUE = c1 c2
<BLANKLINE>
...
[part4]
option=
d2
d3
d1
d4
<BLANKLINE>
IN extension1.cfg
REMOVE VALUE = d5
IN extension1.cfg
ADD VALUE =
d1
d4
IN base.cfg
SET VALUE =
d2
d3
d5
<BLANKLINE>
...
[part5]
option= h1 h2
<BLANKLINE>
IN extension1.cfg
SET VALUE = h1 h2
<BLANKLINE>
...
Cleanup:: Cleanup::
>>> os.remove(os.path.join(sample_buildout, 'base.cfg')) >>> os.remove(os.path.join(sample_buildout, 'base.cfg'))
......
...@@ -3539,7 +3539,7 @@ def test_suite(): ...@@ -3539,7 +3539,7 @@ def test_suite():
(re.compile('setuptools'), 'setuptools'), (re.compile('setuptools'), 'setuptools'),
(re.compile('Got zc.recipe.egg \S+'), 'Got zc.recipe.egg'), (re.compile('Got zc.recipe.egg \S+'), 'Got zc.recipe.egg'),
(re.compile(r'zc\.(buildout|recipe\.egg)\s*= >=\S+'), (re.compile(r'zc\.(buildout|recipe\.egg)\s*= >=\S+'),
'zc.\1 = >=1.99'), 'zc.\\1 = >=1.99'),
]) ])
) + manuel.capture.Manuel(), ) + manuel.capture.Manuel(),
'buildout.txt', 'buildout.txt',
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment