{
  "$id": "https://json.schemastore.org/hatch.json",
  "$schema": "http://json-schema.org/draft-07/schema#",
  "additionalProperties": false,
  "definitions": {
    "Platform": {
      "enum": ["linux", "windows", "macos"]
    },
    "Metadata": {
      "title": "Metadata",
      "description": "Metadata for the project",
      "x-taplo": {
        "links": {
          "key": "https://hatch.pypa.io/latest/config/metadata/#metadata-options"
        }
      },
      "type": "object",
      "properties": {
        "allow-direct-references": {
          "title": "Allow-Direct-References",
          "description": "Whether to allow direct references",
          "x-taplo": {
            "links": {
              "key": "https://hatch.pypa.io/latest/config/metadata/#allowing-direct-references"
            }
          },
          "type": "boolean"
        },
        "allow-ambiguous-features": {
          "title": "Allow-Ambiguous-Features",
          "description": "Whether to allow ambiguous features",
          "x-taplo": {
            "links": {
              "key": "https://hatch.pypa.io/latest/config/metadata/#allowing-ambiguous-features"
            }
          },
          "type": "boolean"
        }
      }
    },
    "Override": {
      "title": "Override",
      "description": "TODO"
    },
    "Overrides": {
      "title": "Overrides",
      "description": "Overrides depending on things like platform, matrix variables, or environment variables",
      "x-taplo": {
        "links": {
          "key": "https://hatch.pypa.io/latest/config/environment/advanced/#option-overrides"
        }
      },
      "type": "object",
      "patternProperties": {
        "env|matrix|name": {
          "type": "object",
          "additionalProperties": {
            "$ref": "#/definitions/Override"
          }
        }
      },
      "properties": {
        "platform": {
          "type": "object",
          "propertyNames": {
            "$ref": "#/definitions/Platform"
          },
          "additionalProperties": {
            "$ref": "#/definitions/Override"
          }
        }
      }
    },
    "Env": {
      "title": "Env",
      "type": "object",
      "properties": {
        "template": {
          "title": "Template",
          "description": "Template environment to inherit from. Set to own name to make self referential (disable inheritance from “default”)",
          "x-taplo": {
            "links": {
              "key": "https://hatch.pypa.io/latest/config/environment/overview/#inheritance"
            }
          },
          "type": "string",
          "default": "default"
        },
        "detached": {
          "title": "Detached",
          "description": "Make the environment self-referential and skip project install",
          "x-taplo": {
            "links": {
              "key": "https://hatch.pypa.io/latest/config/environment/overview/#detached-environments"
            }
          },
          "type": "boolean",
          "default": false
        },
        "dependencies": {
          "title": "Dependencies",
          "description": "List of dependencies to install in the environment",
          "x-taplo": {
            "links": {
              "key": "https://hatch.pypa.io/latest/config/environment/overview/#dependencies"
            }
          },
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "extra-dependencies": {
          "title": "Extra dependencies",
          "description": "List of extra dependencies to install in the environment in addition to the template environment’s dependencies",
          "x-taplo": {
            "links": {
              "key": "https://hatch.pypa.io/latest/config/environment/overview/#dependencies"
            }
          },
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "features": {
          "title": "Features (extras)",
          "description": "List of optional dependency groups (extras) to install",
          "x-taplo": {
            "links": {
              "key": "https://hatch.pypa.io/latest/config/environment/overview/#features"
            }
          },
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "dev-mode": {
          "title": "Dev mode",
          "description": "Whether to install the project in development mode",
          "x-taplo": {
            "links": {
              "key": "https://hatch.pypa.io/latest/config/environment/overview/#dev-mode"
            }
          },
          "type": "boolean",
          "default": true
        },
        "skip-install": {
          "title": "Skip install",
          "description": "Whether to skip installing the project",
          "x-taplo": {
            "links": {
              "key": "https://hatch.pypa.io/latest/config/environment/overview/#skip-install"
            }
          },
          "type": "boolean",
          "default": false
        },
        "env-vars": {
          "title": "Environment variables",
          "description": "Environment variables to set",
          "x-taplo": {
            "links": {
              "key": "https://hatch.pypa.io/latest/config/environment/overview/#defined"
            }
          },
          "type": "object",
          "additionalProperties": {
            "type": "string"
          }
        },
        "env-include": {
          "title": "Environment variable include",
          "description": "Glob patterns of environment variables to include",
          "x-taplo": {
            "links": {
              "key": "https://hatch.pypa.io/latest/config/environment/overview/#filters"
            }
          },
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "env-exclude": {
          "title": "Environment variable exclude",
          "description": "Glob patterns of environment variables to exclude",
          "x-taplo": {
            "links": {
              "key": "https://hatch.pypa.io/latest/config/environment/overview/#filters"
            }
          },
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "scripts": {
          "title": "Scripts",
          "description": "Dictionary of scripts to run",
          "x-taplo": {
            "links": {
              "key": "https://hatch.pypa.io/latest/config/environment/overview/#scripts"
            }
          },
          "type": "object",
          "additionalProperties": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "array",
                "items": {
                  "type": "string"
                }
              }
            ]
          }
        },
        "pre-install-commands": {
          "title": "Pre-install commands",
          "description": "List of commands to run before installing the project",
          "x-taplo": {
            "links": {
              "key": "https://hatch.pypa.io/latest/config/environment/overview/#pre-install"
            }
          },
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "post-install-commands": {
          "title": "Post-install commands",
          "description": "List of commands to run after installing the project",
          "x-taplo": {
            "links": {
              "key": "https://hatch.pypa.io/latest/config/environment/overview/#post-install"
            }
          },
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "python": {
          "title": "Python version",
          "description": "Python version to use or an absolute path to a python interpreter",
          "x-taplo": {
            "links": {
              "key": "https://hatch.pypa.io/latest/config/environment/overview/#python-version"
            }
          },
          "type": "string"
        },
        "platforms": {
          "title": "Platforms",
          "description": "List of platforms to build for",
          "x-taplo": {
            "links": {
              "key": "https://hatch.pypa.io/latest/config/environment/overview/#supported-platforms"
            }
          },
          "type": "array",
          "items": {
            "$ref": "#/definitions/Platform"
          }
        },
        "description": {
          "title": "Description",
          "description": "Description of the environment for the `env show` command",
          "x-taplo": {
            "links": {
              "key": "https://hatch.pypa.io/latest/config/environment/overview/#description"
            }
          },
          "type": "string"
        },
        "type": {
          "title": "Type",
          "description": "Type of environment. Without plugins, the only supported type is \"virtual\"",
          "x-taplo": {
            "links": {
              "key": "https://hatch.pypa.io/latest/config/environment/overview/#type"
            }
          },
          "type": "string",
          "default": "virtual"
        },
        "matrix": {
          "title": "Matrix",
          "description": "Matrix of environments",
          "x-taplo": {
            "links": {
              "key": "https://hatch.pypa.io/latest/config/environment/advanced/#matrix"
            }
          },
          "type": "array",
          "items": {
            "type": "object",
            "additionalProperties": {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          }
        },
        "matrix-name-format": {
          "title": "Matrix name format",
          "description": "Format string for matrix names, supporting {variable} and {value} placeholders",
          "x-taplo": {
            "links": {
              "key": "https://hatch.pypa.io/latest/config/environment/advanced/#name-formatting"
            }
          },
          "type": "string",
          "default": "{value}"
        },
        "overrides": {
          "$ref": "#/definitions/Overrides"
        }
      }
    },
    "Envs": {
      "title": "Envs",
      "description": "Dictionary of environments",
      "x-taplo": {
        "links": {
          "key": "https://hatch.pypa.io/latest/config/environment/overview/"
        }
      },
      "type": "object",
      "additionalProperties": {
        "$ref": "#/definitions/Env"
      }
    },
    "Target": {
      "title": "Target",
      "type": "object",
      "properties": {
        "dependencies": {
          "title": "Dependencies",
          "description": "Additional dependencies to install in the environment",
          "x-taplo": {
            "links": {
              "key": "https://hatch.pypa.io/latest/config/build/#dependencies"
            }
          },
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "require-runtime-dependencies": {
          "title": "Require runtime dependencies",
          "description": "Whether to install the project’s runtime dependencies",
          "x-taplo": {
            "links": {
              "key": "https://hatch.pypa.io/latest/config/build/#dependencies"
            }
          },
          "type": "boolean",
          "default": false
        },
        "require-runtime-features": {
          "title": "Required runtime features",
          "description": "A list of the project’s runtime features to install",
          "x-taplo": {
            "links": {
              "key": "https://hatch.pypa.io/latest/config/build/#dependencies"
            }
          },
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "versions": {
          "title": "Versions",
          "description": "List of versions to build",
          "x-taplo": {
            "links": {
              "key": "https://hatch.pypa.io/latest/config/build/#versions"
            }
          },
          "type": "array",
          "items": {
            "type": "string"
          }
        }
      }
    },
    "CustomTargets": {
      "title": "CustomTargets",
      "description": "Build targets",
      "x-taplo": {
        "links": {
          "key": "https://hatch.pypa.io/latest/config/build/#build-targets"
        }
      },
      "type": "object",
      "additionalProperties": {
        "$ref": "#/definitions/Target"
      }
    },
    "Hook": {
      "title": "Build hook",
      "type": "object",
      "properties": {
        "dependencies": {
          "title": "Dependencies",
          "description": "Additional dependencies installed in the build environment",
          "x-taplo": {
            "links": {
              "key": "https://hatch.pypa.io/latest/config/build/#dependencies_1"
            }
          },
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "require-runtime-dependencies": {
          "title": "Require runtime dependencies",
          "description": "Whether to install the project’s runtime dependencies",
          "x-taplo": {
            "links": {
              "key": "https://hatch.pypa.io/latest/config/build/#dependencies_1"
            }
          },
          "type": "boolean",
          "default": false
        },
        "require-runtime-features": {
          "title": "Required runtime features",
          "description": "A list of the project’s runtime features to install",
          "x-taplo": {
            "links": {
              "key": "https://hatch.pypa.io/latest/config/build/#dependencies_1"
            }
          },
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "enable-by-default": {
          "title": "Conditional execution",
          "description": "Whether to enable current hook (disable to control activation using environment variables)",
          "x-taplo": {
            "links": {
              "key": "https://hatch.pypa.io/latest/config/build/#conditional-execution"
            }
          },
          "type": "boolean",
          "default": true
        }
      }
    },
    "Hooks": {
      "title": "Hooks",
      "description": "Build hooks",
      "x-taplo": {
        "links": {
          "key": "https://hatch.pypa.io/latest/config/build/#build-hooks"
        }
      },
      "type": "object",
      "additionalProperties": {
        "$ref": "#/definitions/Hook"
      }
    },
    "Build": {
      "title": "Build",
      "description": "Build configuration",
      "type": "object",
      "anyOf": [
        { "properties": { "dev-mode-dirs": false } },
        { "properties": { "dev-mode-exact": false } }
      ],
      "properties": {
        "ignore-vcs": {
          "title": "Ignore VCS in file selection",
          "description": "Whether to ignore VCS .*ignore files and include those files by default",
          "x-taplo": {
            "links": {
              "key": "https://hatch.pypa.io/latest/config/build/#vcs"
            }
          },
          "type": "boolean",
          "default": false
        },
        "include": {
          "title": "Include files",
          "description": "List of glob patterns to include files",
          "x-taplo": {
            "links": {
              "key": "https://hatch.pypa.io/latest/config/build/#patterns"
            }
          },
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "exclude": {
          "title": "Exclude files",
          "description": "List of glob patterns to exclude files",
          "x-taplo": {
            "links": {
              "key": "https://hatch.pypa.io/latest/config/build/#patterns"
            }
          },
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "artifacts": {
          "title": "Artifact files",
          "description": "List of glob patterns to include VCS-ignored files",
          "x-taplo": {
            "links": {
              "key": "https://hatch.pypa.io/latest/config/build/#artifacts"
            }
          },
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "only-packages": {
          "title": "Excluding files outside packages",
          "description": "Whether to only include non-artifact files in packages",
          "x-taplo": {
            "links": {
              "key": "https://hatch.pypa.io/latest/config/build/#excluding-files-outside-packages"
            }
          },
          "type": "boolean",
          "default": false
        },
        "sources": {
          "title": "Sources",
          "description": "Rewrite relative paths",
          "x-taplo": {
            "links": {
              "key": "https://hatch.pypa.io/latest/config/build/#rewriting-paths"
            }
          },
          "anyOf": [
            {
              "type": "object",
              "additionalProperties": {
                "type": "string"
              }
            },
            {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          ]
        },
        "skip-excluded-dirs": {
          "title": "Skip excluded dirs",
          "description": "Whether to skip excluded directories (for performance reasons)",
          "x-taplo": {
            "links": {
              "key": "https://hatch.pypa.io/latest/config/build/#performance"
            }
          },
          "type": "boolean",
          "default": false
        },
        "reproducible": {
          "title": "Reproducible",
          "description": "Whether to make the build reproducible",
          "x-taplo": {
            "links": {
              "key": "https://hatch.pypa.io/latest/config/build/#reproducible-builds"
            }
          },
          "type": "boolean",
          "default": true
        },
        "directory": {
          "title": "Output directory",
          "description": "Directory to write build artifacts to",
          "x-taplo": {
            "links": {
              "key": "https://hatch.pypa.io/latest/config/build/#output-directory"
            }
          },
          "type": "string",
          "default": "dist"
        },
        "dev-mode-dirs": {
          "title": "Dev mode directories",
          "description": "List of directories to add to PYTHONPATH in development mode",
          "x-taplo": {
            "links": {
              "key": "https://hatch.pypa.io/latest/config/build/#dev-mode"
            }
          },
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "dev-mode-exact": {
          "title": "Exact dev mode",
          "description": "Whether to use an exact dev mode that doesn’t add whole directories to PYTHONPATH",
          "x-taplo": {
            "links": {
              "key": "https://hatch.pypa.io/latest/config/build/#dev-mode"
            }
          },
          "type": "boolean"
        },
        "targets": {
          "$ref": "#/definitions/CustomTargets"
        },
        "hooks": {
          "$ref": "#/definitions/Hooks"
        }
      }
    },
    "Version": {
      "title": "Version",
      "description": "Version configuration",
      "x-taplo": {
        "links": {
          "key": "https://hatch.pypa.io/latest/version/#configuration"
        }
      },
      "type": "object",
      "properties": {
        "path": {
          "title": "Path",
          "description": "A relative path to a file containing the project version",
          "x-taplo": {
            "links": {
              "key": "https://hatch.pypa.io/latest/version/#configuration"
            }
          },
          "type": "string"
        },
        "pattern": {
          "title": "Pattern",
          "description": "A regex pattern to extract the version",
          "x-taplo": {
            "links": {
              "key": "https://hatch.pypa.io/latest/version/#configuration"
            }
          },
          "type": "string"
        }
      }
    },
    "PublishIndex": {
      "title": "PublishIndex",
      "description": "Publishing index configuration",
      "type": "object",
      "properties": {
        "disable": {
          "title": "Confirmation",
          "description": "Ask for confirmation when publishing to index",
          "x-taplo": {
            "links": {
              "key": "https://hatch.pypa.io/latest/publish/#confirmation"
            }
          },
          "type": "boolean",
          "default": false
        },
        "repos": {
          "title": "Repositories",
          "description": "Define named repositories to publish to",
          "x-taplo": {
            "links": {
              "key": "https://hatch.pypa.io/latest/publish/#repository"
            }
          },
          "type": "object",
          "properties": {
            "main": false,
            "test": false
          },
          "additionalProperties": {
            "type": "object",
            "properties": {
              "url": {
                "type": "string"
              }
            }
          }
        }
      }
    },
    "Publish": {
      "title": "Publish",
      "description": "Publish configuration",
      "x-taplo": {
        "links": {
          "key": "https://hatch.pypa.io/latest/publish/"
        }
      },
      "type": "object",
      "properties": {
        "index": {
          "$ref": "#/definitions/PublishIndex"
        }
      }
    }
  },
  "oneOf": [
    {
      "properties": {
        "version": false
      }
    },
    {
      "required": ["version"],
      "properties": {
        "build": {
          "type": "object",
          "properties": {
            "hooks": {
              "type": "object",
              "properties": {
                "vcs": {
                  "x-taplo": {
                    "links": {
                      "key": "https://github.com/ofek/hatch-vcs#build-hook"
                    }
                  },
                  "type": "object",
                  "properties": {
                    "version-file": { "type": "string" }
                  }
                }
              }
            }
          }
        },
        "metadata": {
          "type": "object",
          "properties": {
            "hooks": {
              "type": "object",
              "properties": {
                "vcs": {
                  "x-taplo": {
                    "links": {
                      "key": "https://github.com/ofek/hatch-vcs#metadata-hook"
                    }
                  },
                  "type": "object",
                  "properties": {
                    "urls": {
                      "type": "object",
                      "additionalProperties": {
                        "type": "string"
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "version": {
          "x-taplo": {
            "links": {
              "key": "https://github.com/ofek/hatch-vcs"
            }
          },
          "type": "object",
          "required": ["source"],
          "properties": {
            "source": {
              "const": "vcs"
            }
          }
        }
      }
    },
    {
      "required": ["version"],
      "properties": {
        "version": {
          "x-taplo": {
            "links": {
              "key": "https://hatch.pypa.io/latest/version/"
            }
          },
          "type": "object",
          "required": ["path"],
          "properties": {
            "path": { "type": "string" },
            "pattern": { "type": "string" }
          }
        }
      }
    }
  ],
  "properties": {
    "metadata": {
      "$ref": "#/definitions/Metadata"
    },
    "envs": {
      "$ref": "#/definitions/Envs"
    },
    "build": {
      "$ref": "#/definitions/Build"
    },
    "version": {
      "$ref": "#/definitions/Version"
    },
    "publish": {
      "$ref": "#/definitions/Publish"
    }
  },
  "title": "Hatch",
  "type": "object",
  "x-taplo-info": {
    "authors": [
      "flying-sheep (https://github.com/flying-sheep)",
      "Chaojie (https://github.com/ischaojie)"
    ],
    "pattern": ["^(.*(/|\\\\)hatch\\.toml|hatch\\.toml)$"]
  }
}
