/** * Pure TypeScript interface definitions for pyproject.toml types. * * These interfaces serve as the source of truth for types. * Zod schemas are generated from these using ts-to-zod. * * @module pyproject/types */ import type { UvConfig } from '../uv-config/types'; /** * [build-system] per PEP 518. * @passthrough */ export interface PyProjectBuildSystem { requires: string[]; 'build-backend'?: string; 'backend-path'?: string[]; } /** * Author/maintainer entry. * @passthrough */ export interface Person { name?: string; email?: string; } /** * Readme field as an object. * @passthrough */ export interface ReadmeObject { file: string | string[]; content_type?: string; } /** * Readme field (can be string or object). */ export type Readme = string | ReadmeObject; /** * License field as an object. * @passthrough */ export interface LicenseObject { text?: string; file?: string; } /** * License field (can be string or object). */ export type License = string | LicenseObject; /** * Core PEP 621 fields for [project]. * @passthrough */ export interface PyProjectProject { name?: string; version?: string; description?: string; readme?: Readme; keywords?: string[]; authors?: Person[]; maintainers?: Person[]; license?: License; classifiers?: string[]; urls?: Record; dependencies?: string[]; 'optional-dependencies'?: Record; dynamic?: string[]; 'requires-python'?: string; scripts?: Record; entry_points?: Record>; } /** * PEP 735 include-group directive: `{include-group: "other-group"}`. */ export interface DependencyGroupInclude { 'include-group': string; } /** * A single entry in a dependency group: either a PEP 508 string or an include directive. */ export type DependencyGroupEntry = string | DependencyGroupInclude; /** * [dependency-groups] per PEP 735. */ export type PyProjectDependencyGroups = Record; /** * [tool.FOO] section. * @passthrough */ export interface PyProjectToolSection { uv?: UvConfig; } /** * A pyproject.toml file. * @passthrough */ export interface PyProjectToml { project?: PyProjectProject; 'build-system'?: PyProjectBuildSystem; 'dependency-groups'?: PyProjectDependencyGroups; tool?: PyProjectToolSection; }