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

Type hints, test building docs #210

Draft
wants to merge 16 commits into
base: master
Choose a base branch
from
Draft

Conversation

gdubicki
Copy link
Contributor

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 6c8c3a8 that are breaking docs building (https://readthedocs.org/projects/pypuppetdb/builds/13531565/) getting into the master branch.

@coveralls
Copy link

coveralls commented Apr 17, 2021

Coverage Status

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

when building docs by treating warnings
as errors (like readthedocs does).
and remove the :type entries from their docstrings
thanks to the sphinx-autodoc-typehints extension.

Also complete their docstrings for their constructors
and the static creation methods.
"WARNING: more than one target found for cross-reference
'facts': pypuppetdb.api.QueryAPI.facts, pypuppetdb.types.Node.facts"

See https://stackoverflow.com/a/67137409/2693875.
even though it's a RC1 as of now
@codecov
Copy link

codecov bot commented Nov 22, 2021

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%) ⬆️
pypuppetdb/api/query.py 56.09% <100.00%> (+0.54%) ⬆️
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.

@gdubicki
Copy link
Contributor Author

gdubicki commented Jan 7, 2022

Partially done in #220.

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

Successfully merging this pull request may close these issues.

3 participants