Skip to content

Type hints, test building docs - #210

Draft
gdubicki wants to merge 16 commits into
voxpupuli:masterfrom
gdubicki:type_hints
Draft

gdubicki wants to merge 16 commits into
voxpupuli:masterfrom
gdubicki:type_hints

Conversation

@gdubicki

Copy link
Copy Markdown
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

coveralls commented Apr 17, 2021 •

Copy link
Copy Markdown

Coverage Status

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

Comment thread .github/workflows/docs.yml Outdated
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

codecov Bot commented Nov 22, 2021 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 96.66667% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 85.03%. Comparing base (3a247ae) to head (2eee541).
⚠️ Report is 245 commits behind head on master.

Files with missing lines Patch % Lines
pypuppetdb/types.py 96.00% 1 Missing ⚠️
Additional details and impacted files
@@            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     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@gdubicki

gdubicki commented Jan 7, 2022

Copy link
Copy Markdown
Contributor Author

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