Skip to content
This repository has been archived by the owner on Jul 8, 2021. It is now read-only.

Hide docstrings in included source code #50

Merged
merged 3 commits into from
Jun 29, 2021

Conversation

SamWilsn
Copy link

What was wrong?

Closes #26, plus assorted other small documentation fixes.

Also, documenting the types of parameters is redundant, so removed all that. Have to still document return types or else it doesn't parse correctly.

How was it fixed?

Created a hacked literalinclude directive that parses and excludes docstrings.

Cute Animal Picture

Dungeon Master Kitty

@codecov-commenter
Copy link

codecov-commenter commented Jun 26, 2021

Codecov Report

Merging #50 (2ef7858) into pyspec (609fdb0) will decrease coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           pyspec      #50      +/-   ##
==========================================
- Coverage   94.90%   94.89%   -0.01%     
==========================================
  Files          13       13              
  Lines         746      745       -1     
==========================================
- Hits          708      707       -1     
  Misses         38       38              
Flag Coverage Δ
unittests 94.89% <100.00%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
src/eth1spec/base_types.py 93.15% <ø> (ø)
src/eth1spec/crypto.py 94.44% <ø> (ø)
src/eth1spec/evm/gas.py 85.71% <ø> (ø)
src/eth1spec/evm/instructions.py 100.00% <ø> (ø)
src/eth1spec/evm/interpreter.py 100.00% <ø> (ø)
src/eth1spec/spec.py 85.52% <ø> (ø)
src/eth1spec/trie.py 98.92% <ø> (ø)
src/eth1spec/evm/stack.py 81.81% <100.00%> (ø)
src/eth1spec/rlp.py 99.01% <100.00%> (-0.01%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 609fdb0...2ef7858. Read the comment docs.

Copy link

@lightclient lightclient left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Generally look good to me. I was having the following error generating the docs though:

eth1.0-specs/doc/autoapi/eth1spec/crypto/index.rst:55:'Str' object has no attribute 'end_lineno'

Should probably figure that out before merging. Nice job on the module though, looks great :)

@SamWilsn
Copy link
Author

Should probably figure that out before merging.

Yeah, I'll fix that and be back!

Since the docstrings are rendered as HTML, there's really no reason to
include them in the code snippets. This commit adds a dependency on
undocliteral, a hacky tool to strip docstrings when using
literalinclude.

This commit also removes the types from parameters in docstrings. The
signatures are annotated and checked with mypy, so including the types
in the docstrings is just duplicated information that can get out of
sync.
@lightclient
Copy link

Awesome! Look great on my end.

@lightclient lightclient merged commit b75b4c9 into quilt:pyspec Jun 29, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Exclude the docstring from source snippets in generated documentation
3 participants