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

Python c extension documentation #265

merged 2 commits into from Jun 19, 2018


Copy link

@stadelmanma stadelmanma commented Jun 16, 2018

This adds some basic documentation to clarify how a user can use gcovr with Python C extensions. While not terribly difficult the documentation on the web is extremely sparse in this area and some of the semantics of the python extension build process make things tricky. Most notably the fact build_ext will recompile source code files even if they don't need to be when shared across multiple extension modules.

Inside the cookbook document there are additional details on how to collect coverage data as well as two code snippets. The first provides and example of a route to build your modules in a fashion that permits code coverage data generation and the second is a python script that can be used to collect the code coverage data into the standard HTML reporting format. The python script is somewhat unneeded as gcovr managed to collect all of the proper files on it's own but works well if the user only has gcov available and/or wants the *.gcov files to be saved in the same tree structure as the source code.

If desired I can break those two code snippets into separate files stored in examples, that seems to be how the current examples are handled in guide.rst.

related to issue #260

Copy link

@latk latk commented Jun 16, 2018

I'm currently working on your pull request – thank you for sharing your work! However, I'll edit it a bit to keep it more focused. I'll update this PR later so that you can review my changes.

The test failure was not a huge problem, just a small syntax error. I'll fix it. RST directives need an empty line between any .. foo:: directive and the directive body.

Anyway, under which name would you like to be credited in the AUTHORS file?

@latk latk force-pushed the stadelmanma:python-c-extension-documentation branch from d61740e to 40fe55e Jun 16, 2018
Copy link

@codecov codecov bot commented Jun 16, 2018

Codecov Report

Merging #265 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #265   +/-   ##
  Coverage   89.77%   89.77%           
  Files          13       13           
  Lines        1555     1555           
  Branches      271      271           
  Hits         1396     1396           
  Misses        105      105           
  Partials       54       54

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 3a4ed18...40fe55e. Read the comment docs.

Copy link
Contributor Author

@stadelmanma stadelmanma commented Jun 18, 2018

Hi @latk, thanks for cleaning up the RST I haven't written it in awhile and I didn't have time to get a proper dev environment up and running to test everything out. Also, thank you for cleaning up the general flow of content in the section, it reads much more clearly now.

and Matthew Stadelman will work in the AUTHORS file.

@latk latk merged commit 40fe55e into gcovr:master Jun 19, 2018
4 checks passed
4 checks passed
codecov/patch Coverage not affected when comparing 3a4ed18...40fe55e
codecov/project 89.77% remains the same compared to 3a4ed18
continuous-integration/appveyor/pr AppVeyor build succeeded
continuous-integration/travis-ci/pr The Travis CI build passed
latk added a commit that referenced this pull request Jun 19, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants