Skip to content

Conversation

@junkmd
Copy link
Collaborator

@junkmd junkmd commented Jan 25, 2026

Overview

This pull request cleans up and simplifies this project by removing old code for Python 2.3 compatibility and eliminating unused utility functions within the test suite.
This enhances the maintainability of the codebase and facilitates future development.

Codebase Simplification

Removal of Outdated Compatibility Code

The try...except TypeError block in client/lazybind.py, which handled the read-only behavior of the __name__ attribute for Python 2.3, has been removed.
This updates the code to modern Python environments, eliminating unnecessary complexity.

Elimination of Unused Test Utilities

The is_resource_enabled and requires functions have been removed from test/__init__.py. These functions were not actively used by other parts of the test suite, contributing to a simpler test setup.

Test Clarification

Streamlining Test Imports

In test/test_subinterface.py, the unused sys module import and the test_main function have been removed.
This clarifies the intent of the test file and eliminates irrelevant code.

Remove unused `sys` import and `test_main` function.
Streamline `ctypes` imports for better clarity.
Remove `is_resource_enabled` and `requires` functions to simplify test setup.
Removes a `try...except TypeError` block related to `__name__` assignment
in `client/lazybind.py`. This compatibility code for Python 2.3's read-only
`__name__` attribute is no longer necessary in modern Python versions,
simplifying the codebase.
@junkmd junkmd added this to the 1.4.16 milestone Jan 25, 2026
@junkmd junkmd added tests enhance or fix tests coding style Topics related to style, formatters, linters, and delinting. labels Jan 25, 2026
@codecov
Copy link

codecov bot commented Jan 25, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 87.30%. Comparing base (e2c65cc) to head (561c07e).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #916      +/-   ##
==========================================
+ Coverage   87.19%   87.30%   +0.10%     
==========================================
  Files         135      135              
  Lines       12787    12766      -21     
==========================================
- Hits        11150    11145       -5     
+ Misses       1637     1621      -16     

☔ View full report in Codecov by Sentry.
📢 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 ebedd2e into enthought:main Jan 25, 2026
52 checks passed
@junkmd junkmd deleted the remove_unused_or_deadcode branch January 25, 2026 14:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

coding style Topics related to style, formatters, linters, and delinting. tests enhance or fix tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant