Schemas¶
The following sections represent the schemas used in validate-pyproject
.
They were automatically rendered via sphinx-jsonschema for quick reference.
In case of doubts or confusion, you can also have a look on the raw JSON files
in JSON Schemas.
Data structure for pyproject.toml
files¶
File format containing build-time configurations for the Python ecosystem.
PEP 517 initially defined a build-system independent format for source trees
which was complemented by PEP 518 to provide a way of specifying dependencies
for building Python projects.
Please notice the project
table (as initially defined in PEP 621) is not included
in this schema and should be considered separately.
https://packaging.python.org/en/latest/specifications/declaring-build-dependencies/ |
||||
type |
object |
|||
properties |
||||
|
Table used to store build-related data |
|||
type |
object |
|||
properties |
||||
|
List of dependencies in the PEP 508 format required to execute the build system. Please notice that the resulting dependency graph MUST NOT contain cycles |
|||
type |
array |
|||
items |
type |
string |
||
|
Python object that will be used to perform the build according to PEP 517 |
|||
type |
string |
|||
format |
pep517-backend-reference |
|||
|
List of directories to be prepended to |
|||
type |
array |
|||
items |
type |
string |
||
additionalProperties |
False |
|||
|
https://packaging.python.org/en/latest/specifications/pyproject-toml/ |
|||
|
type |
object |
||
additionalProperties |
False |
Package metadata stored in the project
table¶
Data structure for the project table inside pyproject.toml
(as initially defined in PEP 621)
https://packaging.python.org/en/latest/specifications/pyproject-toml/ |
||||||
type |
object |
|||||
properties |
||||||
|
The name (primary identifier) of the project. MUST be statically defined. |
|||||
type |
string |
|||||
format |
pep508-identifier |
|||||
|
The version of the project as supported by PEP 440. |
|||||
type |
string |
|||||
format |
pep440 |
|||||
|
||||||
type |
string |
|||||
|
Full/detailed description of the project in the form of a README with meaning similar to the one defined in core metadata’s Description |
|||||
oneOf |
Relative path to a text file (UTF-8) containing the full description
of the project. If the file path ends in case-insensitive |
|||||
type |
string |
|||||
type |
object |
|||||
allOf |
anyOf |
properties |
||||
|
Relative path to a text file containing the full description of the project. |
|||||
type |
string |
|||||
properties |
||||||
|
Full text describing the project. |
|||||
type |
string |
|||||
properties |
||||||
|
Content-type (RFC 1341) of the full description
(e.g. |
|||||
type |
string |
|||||
|
||||||
type |
string |
|||||
format |
pep508-versionspec |
|||||
|
||||||
oneOf |
properties |
|||||
|
Relative path to the file (UTF-8) which contains the license for the project. |
|||||
type |
string |
|||||
properties |
||||||
|
The license of the project whose meaning is that of the License field from the core metadata. |
|||||
type |
string |
|||||
|
The people or organizations considered to be the ‘authors’ of the project. The exact meaning is open to interpretation (e.g. original or primary authors, current maintainers, or owners of the package). |
|||||
type |
array |
|||||
items |
||||||
|
The people or organizations considered to be the ‘maintainers’ of the project.
Similarly to |
|||||
type |
array |
|||||
items |
||||||
|
List of keywords to assist searching for the distribution in a larger catalog. |
|||||
type |
array |
|||||
items |
type |
string |
||||
|
Trove classifiers which apply to the project. |
|||||
type |
array |
|||||
items |
||||||
type |
string |
|||||
format |
trove-classifier |
|||||
|
URLs associated with the project in the form |
|||||
type |
object |
|||||
patternProperties |
||||||
|
type |
string |
||||
format |
url |
|||||
additionalProperties |
False |
|||||
|
Instruct the installer to create command-line wrappers for the given entry points. |
|||||
|
Instruct the installer to create GUI wrappers for the given
entry points.
The difference between |
|||||
|
Instruct the installer to expose the given modules/functions via
|
|||||
patternProperties |
||||||
|
||||||
additionalProperties |
False |
|||||
|
Project (mandatory) dependencies. |
|||||
type |
array |
|||||
items |
||||||
|
Optional dependency for the project |
|||||
type |
object |
|||||
patternProperties |
||||||
|
type |
array |
||||
items |
||||||
additionalProperties |
False |
|||||
|
Specifies which fields are intentionally unspecified and expected to be dynamically provided by build tools |
|||||
type |
array |
|||||
items |
enum |
version, description, readme, requires-python, license, authors, maintainers, keywords, classifiers, urls, scripts, gui-scripts, entry-points, dependencies, optional-dependencies |
||||
additionalProperties |
False |
|||||
if |
not |
properties |
||||
|
version is listed in |
|||||
then |
version should be statically defined in the |
Entry-points¶
Entry-points are grouped together to indicate what sort of capabilities they provide. See the packaging guides and setuptools docs for more information.
#/definitions/entry-point-group |
||
type |
object |
|
patternProperties |
||
|
Reference to a Python object. It is either in the form
|
|
type |
string |
|
format |
python-entrypoint-reference |
|
additionalProperties |
False |
Dependency¶
Project dependency specification according to PEP 508
#/definitions/dependency |
|
type |
string |
format |
pep508 |
tool
table¶
According to PEP 518, tools can define their own configuration inside
pyproject.toml
by using custom subtables under tool
.
In validate-pyproject
, schemas for these subtables can be specified
via Plugins. The following subtables are defined by built-in plugins
(i.e. plugins that are included in the default distribution of
validate-pyproject
):
tool.setuptools
table¶
setuptools
-specific configurations that can be set by users that require
customization.
These configurations are completely optional and probably can be skipped when
creating simple packages. They are equivalent to some of the Keywords
used by the setup.py
file, and can be set via the tool.setuptools
table.
It considers only setuptools
parameters
that are not covered by PEP 621; and intentionally excludes dependency_links
and setup_requires
(incompatible with modern workflows/standards).
https://setuptools.pypa.io/en/latest/userguide/pyproject_config.html |
|||||
type |
object |
||||
properties |
|||||
|
type |
array |
|||
items |
type |
string |
|||
|
Package and virtual package names contained within this package (not supported by pip) |
||||
type |
array |
||||
items |
type |
string |
|||
format |
pep508-identifier |
||||
|
Packages which this package renders obsolete (not supported by pip) |
||||
type |
array |
||||
items |
type |
string |
|||
format |
pep508-identifier |
||||
|
Whether the project can be safely installed and run from a zip file.
OBSOLETE: only relevant for |
||||
type |
boolean |
||||
|
Legacy way of defining scripts (entry-points are preferred).
Equivalent to the |
||||
type |
array |
||||
items |
type |
string |
|||
|
Resources that should be extracted together, if any of them is needed,
or if any C extensions included in the project are imported.
OBSOLETE: only relevant for |
||||
type |
array |
||||
items |
type |
string |
|||
|
Packages that should be included in the distribution.
It can be given either as a list of package identifiers
or as a |
||||
oneOf |
Array of Python package identifiers |
||||
type |
array |
||||
items |
|||||
|
|
||||
type |
object |
||||
patternProperties |
|||||
|
type |
string |
|||
additionalProperties |
False |
||||
|
Mapping from package names to lists of glob patterns.
Usually this option is not needed when using |
||||
type |
object |
||||
patternProperties |
|||||
|
type |
array |
|||
items |
type |
string |
|||
additionalProperties |
False |
||||
|
Automatically include any data files inside the package directories
that are specified by |
||||
type |
boolean |
||||
|
Mapping from package names to lists of glob patterns that should be excluded
For more information on how to include data files, check |
||||
type |
object |
||||
patternProperties |
|||||
|
type |
array |
|||
items |
type |
string |
|||
additionalProperties |
False |
||||
|
DEPRECATED: use implicit namespaces instead (PEP 420). |
||||
type |
array |
||||
items |
type |
string |
|||
format |
python-module-name |
||||
|
Modules that setuptools will manipulate |
||||
type |
array |
||||
items |
type |
string |
|||
format |
python-module-name |
||||
|
|
||||
type |
object |
||||
patternProperties |
|||||
|
type |
array |
|||
items |
type |
string |
|||
|
Mapping of distutils-style command names to cmdclass = {mycmd = "pkg.subpkg.module.CommandClass"}
The command class should be a directly defined at the top-level of the containing module (no class nesting). |
||||
type |
object |
||||
patternProperties |
|||||
|
type |
string |
|||
format |
python-qualified-identifier |
||||
|
PROVISIONAL: list of glob patterns for all license files being distributed.
(likely to become standard with PEP 639).
By default: |
||||
type |
array |
||||
items |
type |
string |
|||
|
Instructions for loading PEP 621-related metadata dynamically |
||||
type |
object |
||||
properties |
|||||
|
A version dynamically loaded via either the |
||||
oneOf |
|||||
|
|||||
|
|||||
|
|||||
|
|||||
|
type |
object |
|||
patternProperties |
|||||
|
|||||
additionalProperties |
False |
||||
|
type |
object |
|||
anyOf |
|||||
type |
object |
||||
properties |
|||||
|
type |
string |
|||
|
#/definitions/file-directive/properties/file |
||||
additionalProperties |
False |
||||
additionalProperties |
False |
||||
additionalProperties |
False |
Valid package name¶
Valid package name (importable or PEP 561).
#/definitions/package-name |
||
type |
string |
|
anyOf |
type |
string |
format |
python-module-name |
|
type |
string |
|
format |
pep561-stub-name |
‘file:’ directive¶
Value is read from a file (or list of files and then concatenated)
#/definitions/file-directive |
||||
type |
object |
|||
properties |
||||
|
oneOf |
type |
string |
|
type |
array |
|||
items |
type |
string |
||
additionalProperties |
False |
‘file:’ directive for dependencies¶
allOf |
BETA: subset of the |
‘attr:’ directive¶
Value is read from a module attribute. Supports callables and iterables;
unsupported types are cast via str()
#/definitions/attr-directive |
||
type |
object |
|
properties |
||
|
type |
string |
format |
python-qualified-identifier |
|
additionalProperties |
False |
‘find:’ directive¶
#/definitions/find-directive |
||||
type |
object |
|||
properties |
||||
|
Dynamic package discovery. |
|||
type |
object |
|||
properties |
||||
|
Directories to be searched for packages (Unix-style relative path) |
|||
type |
array |
|||
items |
type |
string |
||
|
Exclude packages that match the values listed in this field.
Can container shell-style wildcards (e.g. |
|||
type |
array |
|||
items |
type |
string |
||
|
Restrict the found packages to just the ones listed in this field.
Can container shell-style wildcards (e.g. |
|||
type |
array |
|||
items |
type |
string |
||
|
When |
|||
type |
boolean |
|||
additionalProperties |
False |
|||
additionalProperties |
False |