{
  "$comment": "there are multiple resources describing pyproject.toml. The canonical reference is at https://packaging.python.org/en/latest/specifications/declaring-project-metadata/, which refers to multiple proposals such as PEP 517, PEP 518 and PEP 621",
  "$id": "https://json.schemastore.org/pyproject.json",
  "$schema": "http://json-schema.org/draft-07/schema#",
  "additionalProperties": false,
  "definitions": {
    "projectAuthor": {
      "type": "object",
      "additionalProperties": false,
      "anyOf": [
        {
          "required": ["name"],
          "properties": {
            "name": true
          }
        },
        {
          "required": ["email"],
          "properties": {
            "email": true
          }
        }
      ],
      "properties": {
        "name": {
          "title": "Author name",
          "type": "string"
        },
        "email": {
          "title": "Author email",
          "type": "string",
          "format": "email"
        }
      }
    },
    "BuildSystem": {
      "title": "Project build system configuration",
      "$comment": "see PEP 517 (https://peps.python.org/pep-0517/) and PEP 518 (https://peps.python.org/pep-0518/)",
      "type": "object",
      "x-taplo": {
        "links": {
          "key": "https://www.python.org/dev/peps/pep-0518/#build-system-table"
        }
      },
      "description": "Build-related data.\n",
      "additionalProperties": false,
      "required": ["requires"],
      "properties": {
        "requires": {
          "title": "Build system dependencies",
          "description": "A list of strings representing [PEP 508](https://www.python.org/dev/peps/pep-0508) dependencies required to execute the build system.\n",
          "type": "array",
          "items": {
            "type": "string"
          },
          "x-taplo": {
            "links": {
              "key": "https://www.python.org/dev/peps/pep-0518/#build-system-table"
            }
          },
          "examples": ["setuptools >= 64.0"]
        },
        "build-backend": {
          "title": "Build backend",
          "description": "Python path to project's build backend",
          "type": "string",
          "x-taplo": {
            "links": {
              "key": "https://www.python.org/dev/peps/pep-0517/"
            }
          },
          "examples": ["setuptools.build_meta", "my_build_backend:backend"]
        },
        "backend-path": {
          "title": "Build backend directories",
          "description": "paths to prepend to 'sys.path' when loading the build backend, relative to project root",
          "type": "array",
          "items": {
            "type": "string"
          }
        }
      }
    }
  },
  "properties": {
    "build-system": {
      "$ref": "#/definitions/BuildSystem"
    },
    "tool": {
      "title": "Tool-specific configuration",
      "type": "object",
      "description": "A table for tool configurations.\n\nEvery tool that is used by the project can have its own sub-table for its configuration.\n",
      "additionalProperties": {
        "type": "object"
      },
      "x-taplo": {
        "links": {
          "key": "https://www.python.org/dev/peps/pep-0518/#id28"
        }
      },
      "properties": {
        "cibuildwheel": {
          "$ref": "https://json.schemastore.org/cibuildwheel.json#/properties/tool/properties/cibuildwheel"
        },
        "ruff": {
          "$ref": "https://json.schemastore.org/ruff.json"
        },
        "hatch": {
          "$ref": "https://json.schemastore.org/hatch.json"
        },
        "scikit-build": {
          "$ref": "https://json.schemastore.org/scikit-build.json"
        },
        "setuptools": {
          "$ref": "https://json.schemastore.org/setuptools.json"
        },
        "poetry": {
          "$ref": "https://json.schemastore.org/poetry.json"
        }
      },
      "examples": [
        {
          "tool": {
            "isort": {
              "profile": "black"
            }
          }
        }
      ]
    },
    "project": {
      "title": "Project metadata",
      "$comment": "see PEP 621 (https://peps.python.org/pep-0621/)",
      "type": "object",
      "additionalProperties": false,
      "required": ["name"],
      "properties": {
        "name": {
          "title": "Project name",
          "type": "string",
          "pattern": "^([a-zA-Z\\d]|[a-zA-Z\\d][\\w.-]*[a-zA-Z\\d])$"
        },
        "version": {
          "title": "Project version",
          "type": "string",
          "pattern": "^v?((([0-9]+)!)?([0-9]+(\\.[0-9]+)*)([-_\\.]?(alpha|a|beta|b|preview|pre|c|rc)[-_\\.]?([0-9]+)?)?((-([0-9]+))|([-_\\.]?(post|rev|r)[-_\\.]?([0-9]+)?))?([-_\\.]?(dev)[-_\\.]?([0-9]+)?)?)(\\+([a-z0-9]+([-_\\.][a-z0-9]+)*))?$",
          "examples": ["42.0.1", "0.3.9rc7.post0.dev5"]
        },
        "description": {
          "title": "Project summary description",
          "type": "string"
        },
        "readme": {
          "title": "Project full description",
          "description": "AKA the README",
          "oneOf": [
            {
              "title": "README file path",
              "type": "string"
            },
            {
              "type": "object",
              "required": ["content-type"],
              "properties": {
                "content-type": {
                  "title": "README text content-type",
                  "description": "RFC 1341 compliant content-type (with optional charset, defaulting to UTF-8)",
                  "type": "string"
                }
              },
              "oneOf": [
                {
                  "additionalProperties": false,
                  "required": ["file"],
                  "properties": {
                    "content-type": true,
                    "file": {
                      "title": "README file path",
                      "type": "string"
                    }
                  }
                },
                {
                  "additionalProperties": false,
                  "required": ["text"],
                  "properties": {
                    "content-type": true,
                    "text": {
                      "title": "README text",
                      "type": "string"
                    }
                  }
                }
              ]
            }
          ],
          "examples": [
            "README.md",
            {
              "file": "README.txt",
              "content-type": "text/plain"
            },
            {
              "text": "# Example project\n\nAn example project",
              "content-type": "text/markdown"
            }
          ]
        },
        "requires-python": {
          "title": "Python version compatibility",
          "type": "string",
          "examples": [">= 3.7"]
        },
        "license": {
          "title": "Project license",
          "oneOf": [
            {
              "type": "object",
              "additionalProperties": false,
              "required": ["file"],
              "properties": {
                "file": {
                  "title": "License file path",
                  "type": "string"
                }
              }
            },
            {
              "type": "object",
              "additionalProperties": false,
              "required": ["text"],
              "properties": {
                "text": {
                  "title": "License text",
                  "type": "string"
                }
              }
            },
            {
              "type": "string",
              "description": "A SPDX license identifier"
            }
          ],
          "examples": [
            {
              "text": "MIT"
            },
            {
              "file": "LICENSE"
            },
            "MIT",
            "LicenseRef-Proprietary"
          ]
        },
        "authors": {
          "title": "Project authors",
          "type": "array",
          "items": {
            "$ref": "#/definitions/projectAuthor"
          }
        },
        "maintainers": {
          "title": "Project maintainers",
          "type": "array",
          "items": {
            "$ref": "#/definitions/projectAuthor"
          }
        },
        "keywords": {
          "title": "Project keywords",
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "classifiers": {
          "title": "Applicable Trove classifiers",
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "urls": {
          "title": "Project URLs",
          "type": "object",
          "additionalProperties": {
            "type": "string",
            "format": "uri"
          },
          "examples": [
            {
              "homepage": "https://example.com/example-project"
            }
          ]
        },
        "scripts": {
          "title": "Console scripts",
          "type": "object",
          "additionalProperties": {
            "type": "string"
          },
          "examples": [
            {
              "mycmd": "package.module:object.function"
            }
          ]
        },
        "gui-scripts": {
          "title": "GUI scripts",
          "type": "object",
          "additionalProperties": {
            "type": "string"
          },
          "examples": [
            {
              "mycmd": "package.module:object.function"
            }
          ]
        },
        "entry-points": {
          "title": "Other entry-point groups",
          "type": "object",
          "additionalProperties": false,
          "patternProperties": {
            "^\\w+(\\.\\w+)*$": {
              "type": "object",
              "additionalProperties": {
                "type": "string"
              }
            }
          },
          "propertyNames": {
            "not": {
              "anyOf": [
                {
                  "const": "console_scripts"
                },
                {
                  "const": "gui_scripts"
                }
              ]
            }
          },
          "examples": [
            {
              "pygments.styles": {
                "monokai": "package.module:object.attribute"
              }
            }
          ]
        },
        "dependencies": {
          "title": "Project dependency requirements",
          "type": "array",
          "items": {
            "type": "string"
          },
          "examples": [["attrs", "requests ~= 2.28"]]
        },
        "optional-dependencies": {
          "title": "Project extra dependency requirements",
          "description": "keys are extra names",
          "type": "object",
          "patternProperties": {
            "^([a-z\\d]|[a-z\\d]([a-z\\d-](?!--))*[a-z\\d])$": {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          },
          "examples": [
            {
              "typing": ["boto3-stubs", "typing-extensions ~= 4.1"]
            }
          ]
        },
        "dynamic": {
          "title": "Dynamic metadata values",
          "type": "array",
          "items": {
            "type": "string",
            "enum": [
              "version",
              "description",
              "readme",
              "requires-python",
              "license",
              "authors",
              "maintainers",
              "keywords",
              "classifiers",
              "urls",
              "scripts",
              "gui-scripts",
              "entry-points",
              "dependencies",
              "optional-dependencies"
            ]
          },
          "examples": [["version"]]
        }
      },
      "oneOf": [
        {
          "required": ["dynamic"],
          "properties": {
            "dynamic": {
              "type": "array",
              "contains": {
                "const": "version"
              }
            }
          }
        },
        {
          "required": ["version"],
          "properties": {
            "version": true
          }
        }
      ],
      "dependencies": {
        "version": {
          "not": {
            "required": ["dynamic"],
            "properties": {
              "dynamic": {
                "type": "array",
                "contains": {
                  "const": "version"
                }
              }
            }
          }
        },
        "description": {
          "not": {
            "required": ["dynamic"],
            "properties": {
              "dynamic": {
                "type": "array",
                "contains": {
                  "const": "description"
                }
              }
            }
          }
        },
        "readme": {
          "not": {
            "required": ["dynamic"],
            "properties": {
              "dynamic": {
                "type": "array",
                "contains": {
                  "const": "readme"
                }
              }
            }
          }
        },
        "requires-python": {
          "not": {
            "required": ["dynamic"],
            "properties": {
              "dynamic": {
                "type": "array",
                "contains": {
                  "const": "requires-python"
                }
              }
            }
          }
        },
        "license": {
          "not": {
            "required": ["dynamic"],
            "properties": {
              "dynamic": {
                "type": "array",
                "contains": {
                  "const": "license"
                }
              }
            }
          }
        },
        "authors": {
          "not": {
            "required": ["dynamic"],
            "properties": {
              "dynamic": {
                "type": "array",
                "contains": {
                  "const": "authors"
                }
              }
            }
          }
        },
        "maintainers": {
          "not": {
            "required": ["dynamic"],
            "properties": {
              "dynamic": {
                "type": "array",
                "contains": {
                  "const": "maintainers"
                }
              }
            }
          }
        },
        "keywords": {
          "not": {
            "required": ["dynamic"],
            "properties": {
              "dynamic": {
                "type": "array",
                "contains": {
                  "const": "keywords"
                }
              }
            }
          }
        },
        "classifiers": {
          "not": {
            "required": ["dynamic"],
            "properties": {
              "dynamic": {
                "type": "array",
                "contains": {
                  "const": "classifiers"
                }
              }
            }
          }
        },
        "urls": {
          "not": {
            "required": ["dynamic"],
            "properties": {
              "dynamic": {
                "type": "array",
                "contains": {
                  "const": "urls"
                }
              }
            }
          }
        },
        "scripts": {
          "not": {
            "required": ["dynamic"],
            "properties": {
              "dynamic": {
                "type": "array",
                "contains": {
                  "const": "scripts"
                }
              }
            }
          }
        },
        "gui-scripts": {
          "not": {
            "required": ["dynamic"],
            "properties": {
              "dynamic": {
                "type": "array",
                "contains": {
                  "const": "gui-scripts"
                }
              }
            }
          }
        },
        "entry-points": {
          "not": {
            "required": ["dynamic"],
            "properties": {
              "dynamic": {
                "type": "array",
                "contains": {
                  "const": "entry-points"
                }
              }
            }
          }
        },
        "dependencies": {
          "not": {
            "required": ["dynamic"],
            "properties": {
              "dynamic": {
                "type": "array",
                "contains": {
                  "const": "dependencies"
                }
              }
            }
          }
        },
        "optional-dependencies": {
          "not": {
            "required": ["dynamic"],
            "properties": {
              "dynamic": {
                "type": "array",
                "contains": {
                  "const": "optional-dependencies"
                }
              }
            }
          }
        }
      }
    }
  },
  "title": "JSON schema for Python project metadata and configuration",
  "type": "object",
  "x-taplo-info": {
    "authors": ["zevisert (https://github.com/zevisert)"],
    "pattern": ["^(.*(/|\\\\)pyproject\\.toml|pyproject\\.toml)$"]
  }
}
