Open engeir opened 3 weeks ago
https://github.com/astral-sh/rye/pull/342 pub fn execute(cmd: Args) -> Result<(), Error> { let _guard = redirect_to_stderr(true); I'm not sure if this issue should be fixed, because it seems to be intentional by the developers, or maybe it's a mistake.
Aha, I see! It was opposite to the behaviour I expected so I figured it was just overlooked, but feel free to close if it isn't really an issue.
I would probably expect this to be written to stdout, personally.
I would probably expect this to be written to stdout, personally. I think so, I will try to submit a PR, but still have to see the administrator to accept or not.
This is definitely a very opinionated topic. Personally I prefer STDERR to keep it separate from STDOUT. This is standard for a lot of applications, like strace as a fine example. 2&>1 |
is not too hard write to enable you grepping through the output from my POV.
@Woovie what's to be kept separate from STDOUT though? The entire output of rye run -l
is a list of commands which is meaningful data that could be piped to another tool as is the intent of STDOUT. Think about if there were some log messages output by Rye while determining what the list of commands is — that'd go to STDERR and should not be piped to another program. If you just combine STDERR / STDOUT you're unable to discern which information is relevant.
Steps to Reproduce
[project.scripts]
section, orrye add
a package with entry points.rye run -l
(orrye run
) to see the list of available entry pointsrye run -l | grep "my-entrypoint"
Expected Result
I would expect in step 3 to be able to grep against the list of available entry points. If not from
rye run
, then at least fromrye run -l
/rye run --list
.Actual Result
rye run -l
output to stderr, so all entry points are printed and then a non-zero exit code occur due to no grep matches.rye run -l 2>&1 | grep "my-entrypoint"
will give the desired result.Version Info
rye 0.34.0 commit: 0.34.0 (d31340178 2024-05-20) platform: linux (x86_64) self-python: cpython@3.12.1 symlink support: true uv enabled: true
Stacktrace
No response