Bump Python version to 3.12 and add pyupgrade for modernization - #74
Conversation
There was a problem hiding this comment.
🟡 Changes recommended
requires-python still permits Python 3.11 (">= 3.11,<3.15"), which is inconsistent with dropping 3.11 from the classifiers, CI matrix, and tox environments.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
This PR modernizes the project's Python support baseline: it drops Python 3.11 from the supported/tested versions, sets 3.12 as the local default, and adds pyupgrade (via a new fix tox environment) to keep the codebase on 3.12+ syntax. It also applies a small, behavior-preserving cleanup to two instruction handlers in the emulator core.
Changes:
- Drop Python 3.11 from the CI matrix, trove classifiers, and tox
env_list; add.python-version(3.12) and stop gitignoring it. - Add
pyupgradeto thelintdependency group and a newfixtox env that runspyupgrade --py312-plusand fails if changes are needed. - Remove redundant parentheses in
_ins_lda_inxand_ins_sta_inxinsrc/m6502/processor.py.
File summaries
| File | Description |
|---|---|
pyproject.toml |
Removes 3.11 classifier/tox env, adds pyupgrade dep and a new fix tox environment |
.github/workflows/ci.yml |
Removes Python 3.11 from the test matrix |
.python-version |
Adds pyenv default of 3.12 |
.gitignore |
Un-ignores .python-version so it can be tracked |
src/m6502/processor.py |
Removes redundant parentheses in two indexed-indirect handlers (no behavior change) |
Review details
- Files reviewed: 4/5 changed files
- Comments generated: 1
- Review effort level: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
There was a problem hiding this comment.
🟡 Changes recommended
The new fix tox env's command ordering makes the git diff --exit-code gate unreachable when pyupgrade rewrites files (pyupgrade exits non-zero), leaving its inline comment misleading and the env unusable for applying fixes locally.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Review details
- Files reviewed: 4/5 changed files
- Comments generated: 1
- Review effort level: Balanced
| allowlist_externals = ["git", "sh"] | ||
| commands = [ | ||
| # Finds all tracked .py files and updates them to Python 3.12+ syntax | ||
| ["sh", "-c", "git ls-files '*.py' | xargs pyupgrade --py312-plus"], |
* Bump Python version to 3.12, remove 3.11, and add pyupgrade for code modernization * Update required Python version to 3.12 in pyproject.toml
This pull request updates Python version support and improves linting automation, while also making minor code cleanups. The most important changes are grouped below.
Python Version Support:
.github/workflows/ci.yml),pyproject.tomlclassifiers, and tox environments, and set Python 3.12 as the default version in.python-version. [1] [2] [3] [4]Linting and Automation Improvements:
pyupgradeto the lint dependencies and introduced a newfixtox environment to automatically upgrade code to Python 3.12+ syntax and ensure code is up-to-date in CI. [1] [2]Code Cleanup:
_ins_lda_inxand_ins_sta_inxmethods insrc/m6502/processor.pyby removing redundant parentheses. [1] [2]