Skip to content

Remove setup_logging from comtypes.logutil. - #967

Merged
junkmd merged 2 commits into
remove_code_template_for_interface_commentfrom
remove_setup_logging
Oct 13, 2026
Merged

junkmd merged 2 commits into
remove_code_template_for_interface_commentfrom
remove_setup_logging

Conversation

@junkmd

@junkmd junkmd commented Oct 13, 2026

Copy link
Copy Markdown
Collaborator

Closes #920

1. Summary

This PR cleans up legacy and over-engineered components in preparation for upcoming releases (such as Python 3.15 support), including intentional breaking removals of previously deprecated utilities.

Warning

Breaking Change:
setup_logging and the internal deprecated decorator have been completely removed from comtypes.logutil.

2. Motivation & Background

Ahead of supporting Python 3.15, we are addressing legacy inconsistencies, deprecated APIs, and over-engineered utilities to improve codebase health and maintainability:

3. Breaking Changes & Migration Guide

Removal of setup_logging from comtypes.logutil

Description of the Incompatibility

  • Previous behavior: comtypes.logutil provided a setup_logging(*pathnames) helper configuring root logging from INI-style config files (deprecated since Proposal: Fix NTDebugHandler and Deprecate setup_logging in logutil.py. #920).
  • New behavior: setup_logging and the internal deprecated decorator have been removed entirely from comtypes.logutil. The module now only exposes NTDebugHandler.

Impact on Your Code

  • Any call to comtypes.logutil.setup_logging(...) will raise AttributeError.

Migration Action

  • Configure logging directly using the standard logging library. If routing debug output to the Windows debug console via NTDebugHandler:

    import logging
    from comtypes.logutil import NTDebugHandler
    
    handler = NTDebugHandler()
    handler.setFormatter(logging.Formatter("%(levelname)s:%(name)s:%(message)s"))
    logging.root.addHandler(handler)
    logging.root.setLevel(logging.DEBUG)
  • For INI-based configuration, use logging.config.fileConfig from the standard library.


4. Key Changes

@junkmd junkmd added this to the 1.5.0 / Support Python 3.15 milestone Oct 13, 2026
@junkmd junkmd added the debt label Oct 13, 2026
@junkmd
junkmd added this pull request to stack #968 October 13, 2026 14:52
@junkmd
junkmd force-pushed the remove_setup_logging branch from 1717b33 to 8229380 Compare October 13, 2026 14:53
@codecov-commenter

codecov-commenter commented Oct 13, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 89.34%. Comparing base (40b08b0) to head (8229380).

Additional details and impacted files
@@                              Coverage Diff                               @@
##           remove_code_template_for_interface_comment     #967      +/-   ##
==============================================================================
+ Coverage                                       89.20%   89.34%   +0.14%     
==============================================================================
  Files                                             142      142              
  Lines                                           13902    13856      -46     
==============================================================================
- Hits                                            12401    12380      -21     
+ Misses                                           1501     1476      -25     

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@junkmd
junkmd merged commit 91408c2 into main Oct 13, 2026
199 of 226 checks passed
@junkmd
junkmd deleted the remove_setup_logging branch October 13, 2026 15:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Proposal: Fix NTDebugHandler and Deprecate setup_logging in logutil.py.

2 participants