{"record":{"id":"40cfe2ba70c60af3","repo":"astral-sh/uv","slug":"pip-compile-s-pip-args-is-unsupported-try-pas","errorCode":null,"errorMessage":"pip-compile's `--pip-args` is unsupported (try passing arguments to uv directly)","messagePattern":"pip-compile's `--pip-args` is unsupported \\(try passing arguments to uv directly\\)","errorType":"validation","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/uv-cli/src/compat.rs","lineNumber":145,"sourceCode":"\n        if self.config.is_some() {\n            return Err(anyhow!(\n                \"pip-compile's `--config` is unsupported (uv does not use a configuration file)\"\n            ));\n        }\n\n        if self.emit_options {\n            return Err(anyhow!(\n                \"pip-compile's `--emit-options` is unsupported (try `--emit-build-options` instead)\"\n            ));\n        }\n\n        if self.no_emit_options {\n            warn_user!(\"pip-compile's `--no-emit-options` has no effect (uv never emits options)\");\n        }\n\n        if self.pip_args.is_some() {\n            return Err(anyhow!(\n                \"pip-compile's `--pip-args` is unsupported (try passing arguments to uv directly)\"\n            ));\n        }\n\n        Ok(())\n    }\n}\n\n/// Arguments for `pip list` compatibility.\n///\n/// These represent a subset of the `pip list` interface that uv supports by default.\n#[derive(Args)]\npub struct PipListCompatArgs {\n    #[clap(long, hide = true)]\n    disable_pip_version_check: bool,\n}\n\nimpl CompatArgs for PipListCompatArgs {","sourceCodeStart":127,"sourceCodeEnd":163,"githubUrl":"https://github.com/astral-sh/uv/blob/f1a42680ff5272232d65748acf338b19778dde24/crates/uv-cli/src/compat.rs#L127-L163","documentation":"pip-compile's `--pip-args \"ARGS\"` forwards arbitrary arguments to the underlying pip invocation. That passthrough cannot be mapped onto uv (every option has its own spelling and semantics), so `PipCompileCompatArgs::validate()` rejects any `Some(pip_args)` value and tells you to pass arguments to uv directly. The pip-sync variant fails identically (compat.rs:243).","triggerScenarios":"`uv pip compile --pip-args \"--index-url=https://pypi.internal/simple\" requirements.in` or `uv pip sync --pip-args '--retries 5' requirements.txt`.","commonSituations":"Escape-hatch habits from pip-tools where undocumented options were shoved through `--pip-args`; generated CI scripts that append a generic `--pip-args` block to every tool; docker entrypoints parameterized with a single PIP_ARGS variable.","solutions":["Spell each forwarded option as a native uv flag: `--index-url`/`--extra-index-url`, `--retries`, `--timeout`, etc.","For repeated sets of options, store them in `uv.toml` or `UV_*` env vars instead of a quoted blob.","Delete `--pip-args` from shared scripts so the failure surfaces for everyone, not just uv users."],"exampleFix":"# before\nuv pip compile --pip-args \"--index-url=https://pypi.internal/simple\" requirements.in\n\n# after\nuv pip compile --index-url https://pypi.internal/simple requirements.in","handlingStrategy":"validation","validationCode":"def split_pip_args(pip_args: str) -> list[str]:\n    \"\"\"Expand a pip-tools --pip-args blob into individual uv flags.\"\"\"\n    import shlex\n    return shlex.split(pip_args)  # then validate each against `uv pip compile --help`","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Never keep a generic option-blob variable in scripts shared across pip-like tools; enumerate flags.","When migrating, run `uv pip compile --help` and map each old flag explicitly.","Put stable options in uv.toml so command lines stay short and auditable."],"tags":["cli","pip-tools","compatibility","compile","arguments"],"backgroundTag":null,"analyzedSha":"f1a42680ff5272232d65748acf338b19778dde24","analyzedAt":"2026-08-16T04:51:47.599Z","schemaVersion":2},"datasetVersion":"2026-08-16T08:17:34.114Z"}