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

Migrate entirely to public coverage interface #420

Closed
TheKevJames opened this issue Apr 26, 2024 · 1 comment
Closed

Migrate entirely to public coverage interface #420

TheKevJames opened this issue Apr 26, 2024 · 1 comment

Comments

@TheKevJames
Copy link
Owner

There are a few places in reporter.py where we reach into the internals of coverage to do what we need to do. It would be great if we could avoid doing this; wherever we can refactor to use the public interface, great. If the public interface needs to change, we can work with upstream to tackle that.

Once this is done, we'll be able to finally avoid getting broken by occasional non-major coverage updates.

@TheKevJames
Copy link
Owner Author

Current usage of coverage package:

  • coverage.coverage(config_file: bool) -> coverage.Coverage
  • coverage.CoverageException is base class of any raised coverage.coverage(..) errors
  • coverage.Coverage has .load() -> None
  • coverage.Coverage has .get_data() -> None
  • coverage.report.get_analysis_to_report(cov: coverage.Coverage, morfs: None) -> tuple[coverage.reporter.FilePlugin, coverage.results.Analysis]
  • coverage.reporter.FilePlugin has .relative_filename() -> str
  • coverage.reporter.FilePlugin has .source_token_lines() -> Iterable[Any]
  • coverage.reporter.FilePlugin has .source() -> str
  • coverage.results.Analysis has .missing -> set[int]
  • coverage.results.Analysis has .statements -> set[int]
  • coverage.results.Analysis has .has_arcs -> bool
  • coverage.results.Analysis has .missing_branch_arcs() -> dict[int, list[int]]
  • coverage.results.Analysis has .executed_branch_arcs() -> dict[int, list[int]]

As of coverage v6.3+, all of the above are non-private methods. Calling this one done!

/cc @nedbat FYI on this, as we've crossed paths on my use of private interfaces before. coveralls should now be strictly following your public interface, so we shouldn't get any unexpected conflicts on minor versions. Please do let me know if any of the above are not meant to be public interfaces, and I'd be happy to look into changing my code!

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

No branches or pull requests

1 participant