Open sunew opened 8 years ago
Is the hook asking for some input? Or is it "just" a matter of the output not being what zest.releaser expects?
It does not ask for input - so probably "just" a matter of the output not being what zest.releaser expects
I have that codeanalysis thingy in one of my own projects, too, but I haven't seen a problem with fullrelease.
You're saying that you see a lot of output from the hook. I fixed the few errors that codeanalysis reported (and quieted down the rest) for that project of mine before releasing it, so I didn't have the problem.
Can you paste the first and last 20 lines of output? Perhaps than we can spot something that throws zest.releaser off guard.
@mauritsvanrees: do you have any clue? You're probably using the codeanalysis recipe more often than I do :-)
My guess is that it could be the amount of output that causes the problem. I had my hook on a bobtemplate project, so a lot of what I consider false negatives (generated bootstrap files etc.).
These I can of course ignore. But for now it is good for debugging the problem...
sune@sune-T440:/work/tools/pythontools/bobtemplates.zitelab (master)$ git commit -a
Flake8..........................[ FAILURE ] in 0.727s
/work/tools/pythontools/bobtemplates.zitelab/tests.py:0:1: C101 Coding magic comment not found
/work/tools/pythontools/bobtemplates.zitelab/tests.py:31:80: E501 line too long (80 > 79 characters)
/work/tools/pythontools/bobtemplates.zitelab/build/lib.linux-x86_64-2.7/bobtemplates/__init__.py:0:1: C101 Coding magic comment not found
/work/tools/pythontools/bobtemplates.zitelab/build/lib.linux-x86_64-2.7/bobtemplates/zitelab/__init__.py:0:1: C101 Coding magic comment not found
/work/tools/pythontools/bobtemplates.zitelab/build/lib.linux-x86_64-2.7/bobtemplates/zitelab/hooks.py:104:1: E302 expected 2 blank lines, found 1
/work/tools/pythontools/bobtemplates.zitelab/build/lib.linux-x86_64-2.7/bobtemplates/zitelab/hooks.py:110:1: E302 expected 2 blank lines, found 1
/work/tools/pythontools/bobtemplates.zitelab/build/lib.linux-x86_64-2.7/bobtemplates/zitelab/hooks.py:250:1: E303 too many blank lines (3)
/work/tools/pythontools/bobtemplates.zitelab/build/lib.linux-x86_64-2.7/bobtemplates/zitelab/zitelab_plone5_buildout/create_virtualenv_bootstrap.py:0:1: C101 Coding magic comment not found
/work/tools/pythontools/bobtemplates.zitelab/build/lib.linux-x86_64-2.7/bobtemplates/zitelab/zitelab_plone5_buildout/create_virtualenv_bootstrap.py:1:18: E401 multiple imports on one line
/work/tools/pythontools/bobtemplates.zitelab/build/lib.linux-x86_64-2.7/bobtemplates/zitelab/zitelab_plone5_buildout/create_virtualenv_bootstrap.py:9:80: E501 line too long (87 > 79 characters)
/work/tools/pythontools/bobtemplates.zitelab/build/lib.linux-x86_64-2.7/bobtemplates/zitelab/zitelab_plone5_buildout/create_virtualenv_bootstrap.py:27:80: E501 line too long (109 > 79 characters)
/work/tools/pythontools/bobtemplates.zitelab/build/lib.linux-x86_64-2.7/bobtemplates/zitelab/zitelab_plone5_buildout/create_virtualenv_bootstrap.py:29:80: E501 line too long (87 > 79 characters)
/work/tools/pythontools/bobtemplates.zitelab/build/lib.linux-x86_64-2.7/bobtemplates/zitelab/zitelab_plone5_buildout/create_virtualenv_bootstrap.py:31:80: E501 line too long (123 > 79 characters)
/work/tools/pythontools/bobtemplates.zitelab/build/lib.linux-x86_64-2.7/bobtemplates/zitelab/zitelab_plone_buildout/create_virtualenv_bootstrap.py:0:1: C101 Coding magic comment not found
/work/tools/pythontools/bobtemplates.zitelab/build/lib.linux-x86_64-2.7/bobtemplates/zitelab/zitelab_plone_buildout/create_virtualenv_bootstrap.py:1:18: E401 multiple imports on one line
/work/tools/pythontools/bobtemplates.zitelab/build/lib.linux-x86_64-2.7/bobtemplates/zitelab/zitelab_plone_buildout/create_virtualenv_bootstrap.py:9:80: E501 line too long (87 > 79 characters)
/work/tools/pythontools/bobtemplates.zitelab/build/lib.linux-x86_64-2.7/bobtemplates/zitelab/zitelab_plone_buildout/create_virtualenv_bootstrap.py:27:80: E501 line too long (109 > 79 characters)
/work/tools/pythontools/bobtemplates.zitelab/build/lib.linux-x86_64-2.7/bobtemplates/zitelab/zitelab_plone_buildout/create_virtualenv_bootstrap.py:29:80: E501 line too long (87 > 79 characters)
/work/tools/pythontools/bobtemplates.zitelab/build/lib.linux-x86_64-2.7/bobtemplates/zitelab/zitelab_plone_buildout/create_virtualenv_bootstrap.py:31:80: E501 line too long (123 > 79 characters)
/work/tools/pythontools/bobtemplates.zitelab/bobtemplates/__init__.py:0:1: C101 Coding magic comment not found
...
/work/tools/pythontools/bobtemplates.zitelab/bobtemplates/zitelab/zitelab_plone_buildout/bootstrap-virtualenv.py:1888:5: E265 block comment should start with '# '
/work/tools/pythontools/bobtemplates.zitelab/bobtemplates/zitelab/zitelab_plone_buildout/bootstrap-virtualenv.py:1891:5: E265 block comment should start with '# '
/work/tools/pythontools/bobtemplates.zitelab/bobtemplates/zitelab/zitelab_plone_buildout/bootstrap-virtualenv.py:1903:25: E128 continuation line under-indented for visual indent
/work/tools/pythontools/bobtemplates.zitelab/bobtemplates/zitelab/zitelab_plone_buildout/bootstrap-virtualenv.py:1904:25: E128 continuation line under-indented for visual indent
/work/tools/pythontools/bobtemplates.zitelab/bobtemplates/zitelab/zitelab_plone_buildout/bootstrap-virtualenv.py:1905:25: E124 closing bracket does not match visual indentation
/work/tools/pythontools/bobtemplates.zitelab/bobtemplates/zitelab/zitelab_plone_buildout/bootstrap-virtualenv.py:1916:1: E302 expected 2 blank lines, found 1
/work/tools/pythontools/bobtemplates.zitelab/bobtemplates/zitelab/zitelab_plone_buildout/bootstrap-virtualenv.py:1924:1: E265 block comment should start with '# '
/work/tools/pythontools/bobtemplates.zitelab/bobtemplates/zitelab/zitelab_plone_buildout/bootstrap-virtualenv.py:2069:1: E265 block comment should start with '# '
/work/tools/pythontools/bobtemplates.zitelab/bobtemplates/zitelab/zitelab_plone_buildout/bootstrap-virtualenv.py:2088:1: E265 block comment should start with '# '
/work/tools/pythontools/bobtemplates.zitelab/bobtemplates/zitelab/zitelab_plone_buildout/bootstrap-virtualenv.py:2108:1: E265 block comment should start with '# '
/work/tools/pythontools/bobtemplates.zitelab/bobtemplates/zitelab/zitelab_plone_buildout/bootstrap-virtualenv.py:2123:1: E265 block comment should start with '# '
/work/tools/pythontools/bobtemplates.zitelab/bobtemplates/zitelab/zitelab_plone_buildout/bootstrap-virtualenv.py:2131:1: E265 block comment should start with '# '
/work/tools/pythontools/bobtemplates.zitelab/bobtemplates/zitelab/zitelab_plone_buildout/bootstrap-virtualenv.py:2138:1: E265 block comment should start with '# '
/work/tools/pythontools/bobtemplates.zitelab/bobtemplates/zitelab/zitelab_plone_buildout/bootstrap-virtualenv.py:2229:1: E265 block comment should start with '# '
/work/tools/pythontools/bobtemplates.zitelab/bobtemplates/zitelab/zitelab_plone_buildout/bootstrap-virtualenv.py:2256:1: E265 block comment should start with '# '
/work/tools/pythontools/bobtemplates.zitelab/bobtemplates/zitelab/zitelab_plone_buildout/bootstrap-virtualenv.py:2263:1: E265 block comment should start with '# '
/work/tools/pythontools/bobtemplates.zitelab/bobtemplates/zitelab/zitelab_plone_buildout/bootstrap-virtualenv.py:2367:80: E501 line too long (92 > 79 characters)
/work/tools/pythontools/bobtemplates.zitelab/bobtemplates/zitelab/zitelab_plone_buildout/bootstrap-virtualenv.py:2401:80: E501 line too long (89 > 79 characters)
/work/tools/pythontools/bobtemplates.zitelab/bobtemplates/zitelab/zitelab_plone_buildout/bootstrap-virtualenv.py:2419:1: E265 block comment should start with '# '
/work/tools/pythontools/bobtemplates.zitelab/bobtemplates/zitelab/zitelab_plone_buildout/bootstrap-virtualenv.py:2420:1: E265 block comment should start with '# '
/work/tools/pythontools/bobtemplates.zitelab/bobtemplates/zitelab/zitelab_plone_buildout/bootstrap-virtualenv.py:2421:1: E265 block comment should start with '# '
/work/tools/pythontools/bobtemplates.zitelab/bobtemplates/zitelab/zitelab_plone_buildout/create_virtualenv_bootstrap.py:0:1: C101 Coding magic comment not found
/work/tools/pythontools/bobtemplates.zitelab/bobtemplates/zitelab/zitelab_plone_buildout/create_virtualenv_bootstrap.py:1:18: E401 multiple imports on one line
/work/tools/pythontools/bobtemplates.zitelab/bobtemplates/zitelab/zitelab_plone_buildout/create_virtualenv_bootstrap.py:12:80: E501 line too long (87 > 79 characters)
/work/tools/pythontools/bobtemplates.zitelab/bobtemplates/zitelab/zitelab_plone_buildout/create_virtualenv_bootstrap.py:17:80: E501 line too long (86 > 79 characters)
[master 1d6f2d6] test
1 file changed, 2 insertions(+)
I was going to say: "I cannot reproduce this." But I can. :-)
I have created a new project with mrbob -O test.template bobtemplates:plone_addon
.
That has this recipe:
[code-analysis]
recipe = plone.recipe.codeanalysis
directory = ${buildout:directory}/src/test
flake8-exclude = bootstrap.py,bootstrap-buildout.py,docs,*.egg.,omelette
flake8-max-complexity = 15
flake8-extensions =
flake8-blind-except
flake8-debugger
flake8-coding
All goes fine then. But then I make a few changes so the script checks the current directory and does not exclude parts/omelette:
[code-analysis]
recipe = plone.recipe.codeanalysis
# directory = ${buildout:directory}/src/test
directory = ${buildout:directory}
# Does not really matter: return-status-codes = True
# flake8-exclude = bootstrap.py,bootstrap-buildout.py,docs,*.egg.,omelette
flake8-max-complexity = 15
flake8-extensions =
flake8-blind-except
flake8-debugger
flake8-coding
Running bin/code-analysis
creates 194 KB of output. Takes about two seconds. Should not really be a problem. A manual git commit works. But when you do the prerelease, zest.releaser hangs reading the stdout of subprocess.Popen. With a pdb in there I see no difference between the stdout of this and other commands: the class is the same and the file is not closed. And reading line by line through the output does not help either: it waits on the first line.
I wonder if code-analysis has somehow eaten up the output. @gforcada: Have you seen this before?
@mauritsvanrees no, first time seeing it... looks weird, I will try to look at it
Is this still a problem? (I'm looking through old issues)
UP ! I'm having the same issue
Brainstorming: does one of the pre-commit hooks "mess" with the stdin/stdout?
@odelaere : do you have more details? Which pre-commit hooks you're using, for instance?
@reinout Nothing mess in the terminal. it just hangs waiting (I suppose) for something to respond. It seems to be the same error as sunew. plone.recipe.codeanalysis screws it and the commit is never performed. But the changes are staged for commit though. I have just one pre-commit hook which is Flake8. Removing the pre-commit is working. Right now i am trying to twist the flake8 config for zest to work.
@reinout It appears zest keep hanging while trying to commit if the pre-commit hook returns a failure. it worked when it returns an OK status
It doesn't hang for me, it just continues without committing, which is very confusing.
plone.recipe.codeanalysis installs a precommit hook running flake8 etc. But the output from the hook causes zest.releaser to hang:
and nothing happens (waited several minutes)
Running the git command manually afterwards works fine - but with a lot of output from the hook.
Removing the hook makes the prerelease proces work. (After reverting and restarting)
The hook output in my case is very long (above 600 lines of text). I'm not sure if smaller amounts of hook output causes any trouble.
Traceback from ctrl-c, if it can help: