Skip to content

Conversation

@EndPositive
Copy link
Contributor

@EndPositive EndPositive commented Dec 19, 2025

Since #16923, - stdin paths are suddenly only supported on the RequirementsSource::Extensionless. However, parsing of cli arguments using from_requirements_txt, from_constraints_txt from_overrides_txt would always output a RequirementsSource::RequirementsTxt. Resulting in the error:

$ cat overrides.txt | cargo run --bin uv --profile dev --manifest-path ./uv/crates/uv/Cargo.toml pip install 'numpy' --overrides=-
    Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.22s
     Running `./uv/target/debug/uv pip install 'numpy' --overrides=-`
error: File not found: `-`

In this PR, I've added a small check in those for the - paths to use RequirementsSource::ExtensionLess.

I'm not too sure about this change though, as it would also implicitly start allowing PEP 723 scripts as input to overrides/constraints. I don't see the direct issue in that, but then maybe we should explicitly handle it so that an --overrides=script.py would also be supported. @zanieb what do you think?

Relates to #17227

Since astral-sh#16923, `-` stdin paths are only supported on the `RequirementsSource::Extensionless`. However, parsing of cli arguments using `from_requirements_txt`, `from_constraints_txt` `from_overrides_txt` would always output a `RequirementsSource::RequirementsTxt`. I've added a small check in those for the `-` paths to use `ExtensionLess`.

I'm not too sure about this change, as it would also implicitly start allowing PEP 723 scripts as input to overrides/constraints. I don't see the direct issue in that, but then maybe we should explicitly handle it so that an `--overrides=script.py` would also be supported.
@charliermarsh
Copy link
Member

Can you add some test coverage for this?

@charliermarsh charliermarsh merged commit cc4600c into astral-sh:main Dec 24, 2025
101 of 102 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants