pypuppetdb icon indicating copy to clipboard operation
pypuppetdb copied to clipboard

Type hints, test building docs

Open gdubicki opened this issue 3 years ago • 3 comments

Instead of declaring types in the docstrings let's use PEP 484 type hints. Thanks to the sphinx-autodoc-typehints extension they will be added to the docs but also work as static types to add type safety to this library.

Also add a GitHub Action doc building test to avoid getting commits like https://github.com/voxpupuli/pypuppetdb/commit/6c8c3a8bae17b12b1375a15c588dd5d5cc01a035 that are breaking docs building (https://readthedocs.org/projects/pypuppetdb/builds/13531565/) getting into the master branch.

gdubicki avatar Apr 17 '21 10:04 gdubicki

Coverage Status

Coverage increased (+0.05%) to 84.581% when pulling adbf8684c001c8e895f713591a7d645d8c8f954b on gdubicki:type_hints into bc9be84163b10040c5b582294ce049168f1b1e2e on voxpupuli:master.

coveralls avatar Apr 17 '21 10:04 coveralls

Codecov Report

Merging #210 (2eee541) into master (3a247ae) will increase coverage by 0.07%. The diff coverage is 96.66%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #210      +/-   ##
==========================================
+ Coverage   84.96%   85.03%   +0.07%     
==========================================
  Files          14       14              
  Lines         918      929      +11     
==========================================
+ Hits          780      790      +10     
- Misses        138      139       +1     
Impacted Files Coverage Δ
pypuppetdb/types.py 71.01% <96.00%> (+0.71%) :arrow_up:
pypuppetdb/api/query.py 56.09% <100.00%> (+0.54%) :arrow_up:
pypuppetdb/utils.py 95.65% <100.00%> (ø)

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 3a247ae...2eee541. Read the comment docs.

codecov[bot] avatar Nov 22 '21 20:11 codecov[bot]

Partially done in #220.

gdubicki avatar Jan 07 '22 11:01 gdubicki