Skip to content

Conversation

@Stealthii
Copy link
Contributor

@Stealthii Stealthii commented Mar 13, 2024

The 'uv pip freeze' command should automatically determine whether or not to provide coloring if the output is going to a terminal or TTY with support. This is not happening in this case.

Ensuring color is always disabled for this command is a good first step to work around this issue. Fixes #38.

The 'uv pip freeze' command should automatically determine whether or
not to provide coloring if the output is going to a terminal or TTY with
support. This is not happening in this case.

Ensuring color is always disabled for this command is a good first step
to work around this issue.
@Stealthii Stealthii requested a review from gaborbernat as a code owner March 13, 2024 18:26
@Stealthii
Copy link
Contributor Author

Stealthii commented Mar 13, 2024

Before:

$ file .tox/py38-mindeps/constraints.txt
.tox/py38-mindeps/constraints.txt: ASCII text, with escape sequences

After:

$ file .tox/py38-mindeps/constraints.txt
.tox/py38-mindeps/constraints.txt: ASCII text

Copy link
Member

@gaborbernat gaborbernat left a comment

Choose a reason for hiding this comment

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

Tests please.

@Stealthii
Copy link
Contributor Author

Apologies, been struggling with testing this one.

  • Similar tests in tox test_python_api.py (256-279) only test against result.out, which is already sanitised. pip is also in our instance, not installed
  • Setting up demo_pkg_inline, even running a full install during the test, I'm stumped for a mechanism to test against the stdout of a call. I can't find any tests that do this in tox, and the two IOWrappers at call[0][2] are empty (I'd considered them potentially stdout/stderr)

@gaborbernat
Copy link
Member

Just assert against assert execute_calls.call_args ?

This test ensures we are enforcing no-color on the uv call when listing
dependencies.
@Stealthii
Copy link
Contributor Author

Ah ok - I was trying to write a test for the actual output from installed() to validate it as pure string. I've added a test for the call arguments themselves in fab11cf.

Copy link
Member

@gaborbernat gaborbernat left a comment

Choose a reason for hiding this comment

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

@gaborbernat gaborbernat merged commit b67f324 into tox-dev:main Mar 14, 2024
@Stealthii Stealthii deleted the bugfix/colorless-freeze branch March 14, 2024 17:07
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.

uv pip freeze creates color in output

2 participants