modernize codebase - #38
Merged
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This PR modernizes the Gearbox codebase for Python 3.10+, removing legacy Python 2-era compatibility code, updating packaging scaffolding to pyproject.toml, and improving setup-app discovery via distribution file metadata.
Changes:
- Drop Python 2/legacy compatibility patterns (e.g.,
__future__imports, oldsuper(...), old import fallbacks), and refactor some loops/context managers. - Update
makepackagescaffolding to generatepyproject.tomlinstead ofsetup.py, with corresponding test updates. - Update
setup-appto locatewebsetupmodules via distributionfiles, with new tests for this behavior.
Reviewed changes
Copilot reviewed 16 out of 17 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/test_commands.py | Extends tests for makepackage output and setup-app websetup discovery via dist files. |
| gearbox/utils/log.py | Removes legacy configparser import fallback and simplifies setup_logging signature. |
| gearbox/utils/copydir.py | Replaces manual file open/close with context managers; adjusts interactive overwrite diff inputs. |
| gearbox/template.py | Modernizes class definition (class X:). |
| gearbox/main.py | Removes Python 2 print_function import; modernizes inspect usage and warning capture. |
| gearbox/commands/setup_app.py | Switches module discovery to dist files; uses importlib.import_module. |
| gearbox/commands/serve.py | Removes legacy Windows/old-library fallbacks; modernizes loops and imports. |
| gearbox/commands/scaffold.py | Reorders helper method placement; modernizes super(). |
| gearbox/commands/patch.py | Reorders helper method placement; modernizes super(). |
| gearbox/commands/help.py | Modernizes super(). |
| gearbox/commands/basic_package/template/setup.py_tmpl | Removes legacy setup.py template from scaffolding. |
| gearbox/commands/basic_package/template/pyproject.toml_tmpl | Adds PEP 517/621-style packaging template for new projects. |
| gearbox/commands/basic_package/template/README.rst_tmpl | Updates install instructions (pip, editable installs). |
| gearbox/commands/basic_package/command.py | Modernizes super() usage. |
| gearbox/commandmanager.py | Simplifies entry-point loading using importlib.metadata.entry_points().select. |
| gearbox/command.py | Modernizes base Command class definition. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.