Skip to content

Bump Python version to 3.12 and add pyupgrade for modernization - #74

Merged
hspaans merged 2 commits into
masterfrom
73-bump-to-python-312314-and-add-pyupgrade
Sep 3, 2026
Merged

Bump Python version to 3.12 and add pyupgrade for modernization#74
hspaans merged 2 commits into
masterfrom
73-bump-to-python-312314-and-add-pyupgrade

Conversation

@hspaans

@hspaans hspaans commented Sep 3, 2026

Copy link
Copy Markdown
Owner

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:

  • Dropped support for Python 3.11 in the test matrix (.github/workflows/ci.yml), pyproject.toml classifiers, and tox environments, and set Python 3.12 as the default version in .python-version. [1] [2] [3] [4]

Linting and Automation Improvements:

  • Added pyupgrade to the lint dependencies and introduced a new fix tox environment to automatically upgrade code to Python 3.12+ syntax and ensure code is up-to-date in CI. [1] [2]

Code Cleanup:

  • Simplified expressions in _ins_lda_inx and _ins_sta_inx methods in src/m6502/processor.py by removing redundant parentheses. [1] [2]

@hspaans hspaans self-assigned this Sep 3, 2026
Copilot AI balanced review requested due to automatic review settings September 3, 2026 21:56
@hspaans hspaans linked an issue Sep 3, 2026 that may be closed by this pull request

Copilot AI left a comment

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.

🟡 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 pyupgrade to the lint dependency group and a new fix tox env that runs pyupgrade --py312-plus and fails if changes are needed.
  • Remove redundant parentheses in _ins_lda_inx and _ins_sta_inx in src/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.

Comment thread pyproject.toml
Copilot AI review requested due to automatic review settings September 3, 2026 22:10
@hspaans
hspaans merged commit faf26e3 into master Sep 3, 2026
9 checks passed
@hspaans
hspaans deleted the 73-bump-to-python-312314-and-add-pyupgrade branch September 3, 2026 22:12

Copilot AI left a comment

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.

🟡 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

Comment thread pyproject.toml
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"],
hspaans added a commit that referenced this pull request Sep 3, 2026
* 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
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.

Bump to Python 3.12~3.14 and add pyupgrade

2 participants