-
Notifications
You must be signed in to change notification settings - Fork 89
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
RST cannot contain header only - cause silent crash #149
Comments
Looked at this a bit, and discovered that a header-only readme_renderer/readme_renderer/rst.py Lines 58 to 59 in 5ad13fd
(overrides docutils default: https://docutils.sourceforge.io/docs/user/config.html#writer-specific-defaults-2 ) It's possible that is intentional - to prevent duplication of the project title inside the body, but it does highlight a difference between the rst and markdown render behaviors. But that's an issue for another time! The bug here, as it appears to me, is that |
Fixes pypa#149 Signed-off-by: Mike Fiedler <[email protected]>
It's intentional! For exactly the reason you highlighted. |
Then the error should be given and possibly explained when it crashes with such an "intention". |
Fixes pypa#149 Signed-off-by: Mike Fiedler <[email protected]>
Fixes pypa#149 Signed-off-by: Mike Fiedler <[email protected]>
* fix: emit a warning when no content is rendered Fixes #149 Signed-off-by: Mike Fiedler <[email protected]> * feat: emit empty warning only if no warnings exist This is a bit more gymnastics than I think is warranted, but wanted to play out the example. Needing to inspect the stream proved more complex than originally expected, as each version confroms to a slightly different interface. - Updated the outpout string to be clearer - Added test for empty RST file Signed-off-by: Mike Fiedler <[email protected]> * refactor: simplify now that distutils is gone Signed-off-by: Mike Fiedler <[email protected]>
If the source README.rst contains header only, e.g.:
Header ======
The
twine check
command claims the markup is invalid for no reason:Without listing any errors. Thats the end of
stdout/stderr
.If I change the
README.rst
by adding just single letter at end, e.g.:Header ====== a
or clear it contents everything is ok:
I debugged it a bit. And got to the line 99 in
site-packages/readme_renderer/rst.py
:rendered = parts.get("docinfo", "") + parts.get("fragment", "")
and the
rendered
string is empty. (bothdocinfo
andfragment
contain empty strings).It corrupts the later
if
:...causing
render
function returnNone
, which is interpreted by twine.check as error, but no warnings/errors are collected by usedstream
.The text was updated successfully, but these errors were encountered: