Saturday, 22 July 2023

Automating Dependency Installation, Unit Testing, and Coverage Reporting in Python Projects

I'm currently dealing with multiple Python projects from GitHub and my aim is to gather coverage in an automated fashion.

Given any Python project from GitHub, I want to:

  1. Automatically install the project and its dependencies.
  2. Run the project's unit tests.
  3. Gather test coverage data.
  4. Report this coverage information.

I am familiar with tools like pip for dependency management, unittest or pytest for running tests, and coverage.py for coverage analysis.

However, I'm looking for a solution that can automate these tasks for any given Python project on GitHub, ideally without requiring per-project manual configuration.

I am imagining a solution where I could just input a GitHub repository URL, and the tool or script would handle the rest.

Here are some of my specific questions:

  • Are there existing tools or scripts that can perform these tasks, or will I need to write a custom script? If I need to write a custom script, what libraries or APIs might be helpful?

  • How can I handle projects that have unusual or complex dependency installation procedures? Is there a way to "detect" the correct installation procedure from the project's files?

  • For projects that don't include tests, or include tests but don't use a standard testing framework like unittest or pytest, how can I handle these cases?

  • For reporting coverage data, are there good libraries or tools to visualize the data or upload it to a coverage tracking service?



from Automating Dependency Installation, Unit Testing, and Coverage Reporting in Python Projects

No comments:

Post a Comment