Skip to content
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

Pdoc exits with 0 although documentation generation partially failed #407

Closed
lovetheguitar opened this issue Jun 15, 2022 · 2 comments
Closed
Labels

Comments

@lovetheguitar
Copy link

Problem Description

When documenting a package and a module fails to be documented because of a missing/broken import, pdoc exits with 0.
IMHO pdoc should exit != 0, although partial documentation is generated.

Steps to reproduce the behavior:

Setup

pdoc_poc/
├── __init__.py
├── pdoc_fail.py
└── pdoc_success.py

__init__.py (empty)

pdoc_fail.py

"""This aint gonna work..."""

import non_existant_module

pdoc_success.py

"""
Thanks for developing pdoc... its really cool!
"""
  1. call pdoc pdoc_poc -o poc_html
  2. check error code echo $LASTEXITCODE -> 0

System Information

pdoc: 12.0.1
Python: 3.8.10
Platform: Windows-10-10.0.19042-SP0

@mhils
Copy link
Member

mhils commented Jul 3, 2022

Thanks for raising this and sorry for the slow reply! :)

I think I agree that silently swallowing an error isn't good here, we should get this fixed. In the meantime, you can specify PYTHONWARNINGS as a workaround:

PYTHONWARNINGS=error pdoc pdoc_poc -o poc_html

Hope this helps! :)

@mhils mhils closed this as completed in cdce38f Aug 11, 2022
@mhils
Copy link
Member

mhils commented Aug 11, 2022

This has been fixed in cdce38f. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants