Skip to content

Only configure setuptools logging if bdist_wheel is imported#641

Merged
agronholm merged 12 commits into
mainfrom
fix-logging
Nov 8, 2024
Merged

Only configure setuptools logging if bdist_wheel is imported#641
agronholm merged 12 commits into
mainfrom
fix-logging

Conversation

@agronholm

@agronholm agronholm commented Nov 7, 2024

Copy link
Copy Markdown
Contributor

This prevents the CLI commands from emitting unwanted output.

Fixes #632.

@codecov

codecov Bot commented Nov 7, 2024

Copy link
Copy Markdown

Codecov Report

Attention: Patch coverage is 50.00000% with 3 lines in your changes missing coverage. Please review.

Project coverage is 78.14%. Comparing base (c81f5c9) to head (13876db).
Report is 7 commits behind head on main.

Files with missing lines Patch % Lines
src/wheel/_bdist_wheel.py 40.00% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #641      +/-   ##
==========================================
+ Coverage   77.96%   78.14%   +0.17%     
==========================================
  Files          14       14              
  Lines        1121     1121              
==========================================
+ Hits          874      876       +2     
+ Misses        247      245       -2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@agronholm
agronholm marked this pull request as ready for review November 8, 2024 14:35
@agronholm
agronholm requested a review from henryiii November 8, 2024 14:36
Comment thread src/wheel/_bdist_wheel.py

# ensure Python logging is configured
try:
__import__("setuptools.logging")

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
__import__("setuptools.logging")
import setuptools.logging

Why not this? They should be the same, right? Usually you use this form if you have a variable value to import.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

(Though now I see this is just moved...)

Comment thread src/wheel/cli/convert.py

if verbose:
print(f"{archive}... ", flush=True)
print(f"{archive}...", flush=True, end="")

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Should this be to stderr?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I don't think so...? There's no docs indicating either way, and wheel tags prints the file names to stdout.

@agronholm
agronholm merged commit 68387af into main Nov 8, 2024
@agronholm
agronholm deleted the fix-logging branch November 8, 2024 15:27
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.

wheel tags command displays invalid filenames on stdout

2 participants