HomeDocs
DocsCommunityTestimonialsUsersGitHubTwitterBlogJobsTermsPrivacyCookies
TermsPrivacyCookies

Enabling Python support

How to enable Pants's bundled Python backend package.

📘

Example Python repository

See here for examples of Pants's Python functionality.

Most Python functionality is provided by the pants.backend.python backend. This backend is bundled in the core Pants distribution, so you don't need to specify a plugin for it.

Enable the Python backend like this:

[GLOBAL]
...
backend_packages2 = [
  'pants.backend.python'
]

You should now see some new goals available:

$ ./pants goals
Goals
-----

Use `./pants help $goal` to get help for a particular goal.


binary        Create a runnable binary.

cloc          Print counts of lines of code.

filedeps      List all source and BUILD files a target depends on.

list          Lists all targets matching the target specs.

repl          Opens a REPL.

roots         List the repo's registered source roots.

run           Runs a runnable target.

setup-py      Run setup.py commands.

target-types  List all the registered target types, including custom plugin
              types.

test          Runs tests.