{"record":{"id":"32dc73562ad71790","repo":"astral-sh/uv","slug":"pyproject-toml-is-not-a-supported-output-format","errorCode":null,"errorMessage":"`pyproject.toml` is not a supported output format for `{}` (only `requirements.txt`-style output is supported)","messagePattern":"`pyproject\\.toml` is not a supported output format for `(.+?)` \\(only `requirements\\.txt`-style output is supported\\)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/uv/src/commands/pip/compile.rs","lineNumber":136,"sourceCode":"    annotation_style: AnnotationStyle,\n    link_mode: LinkMode,\n    mut python: Option<String>,\n    system: bool,\n    python_preference: PythonPreference,\n    concurrency: Concurrency,\n    quiet: bool,\n    cache: Cache,\n    workspace_cache: WorkspaceCache,\n    printer: Printer,\n    preview: Preview,\n) -> Result<ExitStatus> {\n    // If the user provides a `pyproject.toml` or other TOML file as the output file, raise an\n    // error.\n    if output_file\n        .and_then(Path::file_name)\n        .is_some_and(|name| name.eq_ignore_ascii_case(\"pyproject.toml\"))\n    {\n        return Err(anyhow!(\n            \"`pyproject.toml` is not a supported output format for `{}` (only `requirements.txt`-style output is supported)\",\n            \"uv pip compile\".green()\n        ));\n    }\n\n    // Determine the output format.\n    let format = format.unwrap_or_else(|| {\n        let extension = output_file.and_then(Path::extension);\n        if extension.is_some_and(|ext| ext.eq_ignore_ascii_case(\"txt\")) {\n            PipCompileFormat::RequirementsTxt\n        } else if extension.is_some_and(|ext| ext.eq_ignore_ascii_case(\"toml\")) {\n            PipCompileFormat::PylockToml\n        } else {\n            PipCompileFormat::RequirementsTxt\n        }\n    });\n\n    // If the user is exporting to PEP 751, ensure the filename matches the specification.","sourceCodeStart":118,"sourceCodeEnd":154,"githubUrl":"https://github.com/astral-sh/uv/blob/f1a42680ff5272232d65748acf338b19778dde24/crates/uv/src/commands/pip/compile.rs#L118-L154","documentation":"Error \"`pyproject.toml` is not a supported output format for `{}` (only `requirements.txt`-style output is supported)\" thrown in astral-sh/uv.","triggerScenarios":"Thrown at crates/uv/src/commands/pip/compile.rs:136 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"f1a42680ff5272232d65748acf338b19778dde24","analyzedAt":"2026-08-16T04:51:47.599Z","schemaVersion":2},"datasetVersion":"2026-08-16T08:17:34.114Z"}