Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prevent pip "rich" ouput #3607

Merged
merged 5 commits into from
Nov 20, 2024

Conversation

Klaim
Copy link
Member

@Klaim Klaim commented Nov 15, 2024

The goal here is to help with #3576 , although there might be other issues behind it.

If someone reading this know some other flags/env-vars we could use to obtain a pure json utf-8 output, feel free to add suggestions 👍🏽

@wolfv
Copy link
Member

wolfv commented Nov 15, 2024

Usually rich / pip should implement the isatty kind of detection to figure out wether to print colors or not. However, it could indeed be the case that someone adds an env var that forces colors for pip which would make this crash.

You could also be more aggressive about running in a pristine environment.

Just some thoughts :)

@Klaim Klaim force-pushed the klaim/fix-pip-output-format branch from 069c32c to a202c62 Compare November 18, 2024 11:57
@Klaim
Copy link
Member Author

Klaim commented Nov 18, 2024

I reproduced the issue from #3576 by running the command with FORCE_COLOR=1. It seems that NO_COLOR=1 is not enough to prevent the parsing failure in that context even if the color is indeed removed. So the best solution so far that works locally is to unset FORCE_COLOR for the time of the call.

@Klaim Klaim force-pushed the klaim/fix-pip-output-format branch from cc1ebfc to 0d3cf2e Compare November 18, 2024 12:56
@Klaim Klaim self-assigned this Nov 18, 2024
@Klaim Klaim added the release::bug_fixes For PRs fixing bugs label Nov 18, 2024
@Klaim Klaim marked this pull request as ready for review November 18, 2024 13:39
Copy link
Member

@Hind-M Hind-M left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you also please rebase on main?

libmamba/src/core/prefix_data.cpp Outdated Show resolved Hide resolved
@JohanMabille JohanMabille merged commit e1e0f8c into mamba-org:main Nov 20, 2024
32 checks passed
@jjerphan jjerphan deleted the klaim/fix-pip-output-format branch November 21, 2024 15:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release::bug_fixes For PRs fixing bugs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants