{"record":{"id":"a0713543a5c4c03d","repo":"astral-sh/uv","slug":"pip-sync-s-pip-args-is-unsupported-try-passin","errorCode":null,"errorMessage":"pip-sync's `--pip-args` is unsupported (try passing arguments to uv directly)","messagePattern":"pip-sync'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":243,"sourceCode":"            return Err(anyhow!(\n                \"pip-sync's `--user` is unsupported (use a virtual environment instead)\"\n            ));\n        }\n\n        if self.client_cert.is_some() {\n            return Err(anyhow!(\n                \"pip-sync's `--client-cert` is unsupported (uv doesn't support dedicated client certificates)\"\n            ));\n        }\n\n        if self.config.is_some() {\n            return Err(anyhow!(\n                \"pip-sync's `--config` is unsupported (uv does not use a configuration file)\"\n            ));\n        }\n\n        if self.pip_args.is_some() {\n            return Err(anyhow!(\n                \"pip-sync's `--pip-args` is unsupported (try passing arguments to uv directly)\"\n            ));\n        }\n\n        Ok(())\n    }\n}\n\n#[derive(Debug, Copy, Clone, ValueEnum)]\nenum Resolver {\n    Backtracking,\n    Legacy,\n}\n\n/// Arguments for `venv` compatibility.\n///\n/// These represent a subset of the `virtualenv` interface that uv supports by default.\n#[derive(Args)]","sourceCodeStart":225,"sourceCodeEnd":261,"githubUrl":"https://github.com/astral-sh/uv/blob/f1a42680ff5272232d65748acf338b19778dde24/crates/uv-cli/src/compat.rs#L225-L261","documentation":"pip-sync's `--pip-args \"ARGS\"` forwards a raw option string to the embedded pip invocation. uv is not pip; there is no nested command to forward arguments to, and blanket passthrough would break its guarantees, so `PipSyncCompatArgs::validate()` rejects any value and the message says to pass arguments to uv directly.","triggerScenarios":"`uv pip sync --pip-args '--extra-index-url https://pypi.internal/simple' requirements.txt`; commonly a variable-expanded blob like `--pip-args \"$SYNC_ARGS\"` inside a shared script.","commonSituations":"Escape hatches from pip-tools kept 'just in case'; parameterized CI templates where one string configures either pip-sync or uv; local wrapper functions that append generic pip options.","solutions":["Convert each option to its uv spelling on the command line (`--extra-index-url`, `--retries`, `--no-cache`, ...).","Move stable options into `uv.toml`/`UV_*` variables and keep only per-run flags in the script.","Delete the generic passthrough variable so future unsupported options fail visibly instead of hiding in a quoted string."],"exampleFix":"# before\nuv pip sync --pip-args '--extra-index-url https://pypi.internal/simple' requirements.txt\n\n# after\nuv pip sync --extra-index-url https://pypi.internal/simple requirements.txt","handlingStrategy":"validation","validationCode":"def expand_pip_args_for_sync(pip_args: str) -> list[str]:\n    import shlex\n    flags = shlex.split(pip_args)\n    for f in flags:\n        assert not f.startswith(\"--pip-args\")\n    return flags  # append directly to `uv pip sync` argv","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Eliminate option-blob variables; list each flag explicitly in scripts.","Validate expanded flags against `uv pip sync --help` in a unit test for your CI glue.","Move repeated options into uv.toml or UV_* environment variables."],"tags":["cli","pip-tools","compatibility","sync","arguments"],"backgroundTag":null,"analyzedSha":"f1a42680ff5272232d65748acf338b19778dde24","analyzedAt":"2026-08-16T04:51:47.599Z","schemaVersion":2},"datasetVersion":"2026-08-16T08:17:34.114Z"}