Skip to main content
Version: 2.13 (deprecated)

vcs_version


Generates a version string from VCS state.

Uses a constrained but useful subset of the full functionality of setuptools_scm (https://github.com/pypa/setuptools_scm). These constraints avoid pitfalls in the interaction of setuptools_scm with Pants's hermetic environments.

In particular, we ignore any existing setuptools_scm config. Instead you must provide a subset of that config in this target's fields.

If you need functionality that is not currently exposed here, please reach out to us at https://www.pantsbuild.org/v2.13/docs/getting-help.

Backend: pants.backend.experimental.python


generate_to

str
required

Generate the version data to this relative path, using the template field.

Note that the generated output will not be written to disk in the source tree, but will be available as a generated dependency to code that depends on this target.

template

str
required

Generate the version data using this format string, which takes a version format kwarg.

E.g., 'version = "{version}"'

description

str | None
default: None

A human-readable description of the target.

Use /home/josh/work/scie-pants/dist/pants list --documented :: to see all targets with descriptions.

python_resolve

str | None
default: None
backend: pants.backend.experimental.python

The resolve from [python].resolves to use.

If not defined, will default to [python].default_resolve.

All dependencies must share the same value for their resolve field.

tag_regex

str | None
default: '^(?:[\w-]+-)?(?P<version>[vV]?\d+(?:\.\d+){0,2}[^\+]*)(?:\+.*)?$'

A Python regex string to extract the version string from a VCS tag.

The regex needs to contain either a single match group, or a group named version, that captures the actual version information.

Note that this is unrelated to the tags field and Pants's own tags concept.

See https://github.com/pypa/setuptools_scm for implementation details.

tags

Iterable[str] | None
default: None

Arbitrary strings to describe a target.

For example, you may tag some test targets with 'integration_test' so that you could run /home/josh/work/scie-pants/dist/pants --tag='integration_test' test :: to only run on targets with that tag.