New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

list tasks in subdir causes exception #226

Closed
michikuehne opened this Issue Oct 28, 2015 · 4 comments

Comments

Projects
None yet
4 participants
@michikuehne

michikuehne commented Oct 28, 2015

Hi,

If executing "pyb -t" or "pyb --list-tasks" in a subdir from the dir, where the build.py is located, causes the following exception:

Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/2.7/bin/pyb", line 25, in <module>
    sys.exit(pybuilder.cli.main(*sys.argv[1:]))
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pybuilder/cli.py", line 326, in main
    project_directory=options.project_directory)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pybuilder/reactor.py", line 102, in prepare_build
    project_directory, project_descriptor)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pybuilder/reactor.py", line 294, in verify_project_directory
    project_descriptor_full_path)
pybuilder.errors.PyBuilderException: Project directory does not contain descriptor file: /Users/michi/git/immobilienscout24/afp-cli/src/build.py

I excepted the task list or a helpful error message.

Best,
Michael

@esc

This comment has been minimized.

Show comment
Hide comment
@esc

esc Oct 28, 2015

Member

pyb only works in the top-level directory at the moment.

Member

esc commented Oct 28, 2015

pyb only works in the top-level directory at the moment.

@arcivanov

This comment has been minimized.

Show comment
Hide comment
@arcivanov

arcivanov Oct 28, 2015

Contributor

@michikuehne, @esc is correct, not a bug

Contributor

arcivanov commented Oct 28, 2015

@michikuehne, @esc is correct, not a bug

@arcivanov arcivanov closed this Oct 28, 2015

@mriehl

This comment has been minimized.

Show comment
Hide comment
@mriehl

mriehl Oct 29, 2015

Member

On a side note, the exception handling could be a bit better - if you just run pyb we show a helpful error message:

2015-10-29 14:13:01 (venv) mriehl@isdeblnnl084 /tmp 
» pyb
PyBuilder version 0.11.3.dev20151027182948
Build started at 2015-10-29 14:13:02
------------------------------------------------------------
------------------------------------------------------------
BUILD FAILED - Project directory does not contain descriptor file: /tmp/build.py
------------------------------------------------------------
Build finished at 2015-10-29 14:13:02
Build took 0 seconds (0 ms)

but if you run pyb -t we show a stack trace (which is not user friendly):

» pyb -t
Traceback (most recent call last):
  File "/tmp/venv/bin/pyb", line 25, in <module>
    sys.exit(pybuilder.cli.main(*sys.argv[1:]))
  File "/tmp/venv/local/lib/python2.7/site-packages/pybuilder/cli.py", line 326, in main
    project_directory=options.project_directory)
  File "/tmp/venv/local/lib/python2.7/site-packages/pybuilder/reactor.py", line 102, in prepare_build
    project_directory, project_descriptor)
  File "/tmp/venv/local/lib/python2.7/site-packages/pybuilder/reactor.py", line 294, in verify_project_directory
    project_descriptor_full_path)
pybuilder.errors.PyBuilderException: Project directory does not contain descriptor file: /tmp/build.py
Member

mriehl commented Oct 29, 2015

On a side note, the exception handling could be a bit better - if you just run pyb we show a helpful error message:

2015-10-29 14:13:01 (venv) mriehl@isdeblnnl084 /tmp 
» pyb
PyBuilder version 0.11.3.dev20151027182948
Build started at 2015-10-29 14:13:02
------------------------------------------------------------
------------------------------------------------------------
BUILD FAILED - Project directory does not contain descriptor file: /tmp/build.py
------------------------------------------------------------
Build finished at 2015-10-29 14:13:02
Build took 0 seconds (0 ms)

but if you run pyb -t we show a stack trace (which is not user friendly):

» pyb -t
Traceback (most recent call last):
  File "/tmp/venv/bin/pyb", line 25, in <module>
    sys.exit(pybuilder.cli.main(*sys.argv[1:]))
  File "/tmp/venv/local/lib/python2.7/site-packages/pybuilder/cli.py", line 326, in main
    project_directory=options.project_directory)
  File "/tmp/venv/local/lib/python2.7/site-packages/pybuilder/reactor.py", line 102, in prepare_build
    project_directory, project_descriptor)
  File "/tmp/venv/local/lib/python2.7/site-packages/pybuilder/reactor.py", line 294, in verify_project_directory
    project_descriptor_full_path)
pybuilder.errors.PyBuilderException: Project directory does not contain descriptor file: /tmp/build.py

mriehl added a commit that referenced this issue Oct 29, 2015

deal with expected exceptions when listing tasks
This resolves the usability part from #226
@mriehl

This comment has been minimized.

Show comment
Hide comment
@mriehl

mriehl Oct 29, 2015

Member

@michikuehne latest dev release should produce a helpful error message

Member

mriehl commented Oct 29, 2015

@michikuehne latest dev release should produce a helpful error message

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment