Target types
Run ./pants target-types. For more information on a particular target, run ./pants target-types --details=python_library, for example.
See Resources for information on the files, resources, and archive target types.
python_library
A library of non-test Python code.
Fields:
namesources(default:['*.py', '!*_test.py', '!test_*.py', '!conftest.py'])dependenciescompatibility: A string for Python interpreter constraints on this target. This should be written in Requirement-style format, e.g.CPython==2.7.*orCPython>=3.6,<4. As a shortcut, you can leave offCPython, e.g.>=2.7will be expanded toCPython>=2.7. If this is left off, it will default to--python-setup-interpreter-constraints.
pex_binary
An entry point to a Python executable runnable through Pex files.
Fields:
namesources: the one file containing the executable. This may be left off if you include the source files asdependenciesand explicitly configure theentry_point.dependenciescompatibility: A string for Python interpreter constraints on this target. This should be written in Requirement-style format, e.g.CPython==2.7.*orCPython>=3.6,<4. As a shortcut, you can leave offCPython, e.g.>=2.7will be expanded toCPython>=2.7. If this is left off, it will default to--python-setup-interpreter-constraints.entry_point: The entry point for the executable. Of the form"foo.bar:main", wherefoo.baris the module name andmainis a no-arg function. If the function name is omitted, the module itself is executed directly.platforms: An optional list of platform strings, such aslinux_x86_64-cp-27-cp27muormacosx_10.12_x86_64-cp-36-cp36m. This will cause the PEX to be compatible with the requested platforms.shebang: For the generated Pex, use this shebang.zip_safe: Whether or not this binary is safe to run in compacted (zip-file) form.
python_tests
Python test code.
Fields:
namesources(default:['*_test.py', 'test_*.py', 'conftest.py'])dependenciescompatibility: A string for Python interpreter constraints on this target. This should be written in Requirement-style format, e.g.CPython==2.7.*orCPython>=3.6,<4. As a shortcut, you can leave offCPython, e.g.>=2.7will be expanded toCPython>=2.7. If this is left off, it will default to--python-setup-interpreter-constraints.timeout: A timeout (in seconds) which covers the total runtime of all tests in this target. This only applies if the option--pytest-timeoutsis set to True.
python_distribution
A Python setuptools distribution that can be uploaded to a package repo like PyPI.
Fields:
namedependenciesprovides: The package metadata to pass to the setuptoolssetup()method.
See setup-py for details.