Pants v2: The ergonomic build system

Welcome to the Pants v2 documentation hub!

Pants v2 is a fast, scalable, user-friendly build system for growing codebases. It's currently focused on Python, with support for other languages coming soon.

Here you'll find guides to help you get started with Pants v2, comprehensive documentation on how to configure, run and customize Pants v2, and information on how to get help from the Pants community.

Get Started

coverage-py

Configuration for Python test coverage measurement.

Config section: [coverage-py]

Basic options

filter

--coverage-py-filter="['<str>', '<str>', ...]"
PANTS_COVERAGE_PY_FILTER
default: []

A list of Python modules to use in the coverage report, e.g. `['helloworld_test', 'helloworld.util.dirutil'].

The modules are recursive: any submodules will be included.

If you leave this off, the coverage report will include every file in the transitive closure of the address/file arguments; for example, test :: will include every Python file in your project, whereas test project/app_test.py will include app_test.py and any of its transitive dependencies.


report

--coverage-py-report="[<CoverageReportType>, <CoverageReportType>, ...]"
PANTS_COVERAGE_PY_REPORT
one of: console, xml, html, raw, json
default:
[
  "console"
]

Which coverage report type(s) to emit.


Advanced options

version

--coverage-py-version=<str>
PANTS_COVERAGE_PY_VERSION
default: coverage>=5.0.3,<5.1

Requirement string for the tool.


extra_requirements

--coverage-py-extra-requirements="['<str>', '<str>', ...]"
PANTS_COVERAGE_PY_EXTRA_REQUIREMENTS
default: []

Any additional requirement strings to use with the tool. This is useful if the tool allows you to install plugins or if you need to constrain a dependency to a certain version.


interpreter_constraints

--coverage-py-interpreter-constraints="['<str>', '<str>', ...]"
PANTS_COVERAGE_PY_INTERPRETER_CONSTRAINTS
default:
[
  "CPython>=3.6"
]

Python interpreter constraints for this tool.


console_script

--coverage-py-console-script=<str>
PANTS_COVERAGE_PY_CONSOLE_SCRIPT
default: coverage

The console script for the tool. Using this option is generally preferable to (and mutually exclusive with) specifying an --entry-point since console script names have a higher expectation of staying stable across releases of the tool. Usually, you will not want to change this from the default.


entry_point

--coverage-py-entry-point=<str>
PANTS_COVERAGE_PY_ENTRY_POINT
default: None

The entry point for the tool. Generally you only want to use this option if the tool does not offer a --console-script (which this option is mutually exclusive with). Usually, you will not want to change this from the default.


output_dir

--coverage-py-output-dir=<str>
PANTS_COVERAGE_PY_OUTPUT_DIR
default: dist/coverage/python

Path to write the Pytest Coverage report to. Must be relative to build root.


config

--coverage-py-config=<file_option>
PANTS_COVERAGE_PY_CONFIG
default: None

Path to `.coveragerc` or alternative coverage config file


Deprecated options

None

Updated about a month ago


coverage-py


Suggested Edits are limited on API Reference Pages

You can only suggest edits to Markdown body content, but not to the API spec.