Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ jobs:
- "3.14"
- "3.13"
- "3.12"
- "3.11"
steps:
- name: Setup python for test ${{ matrix.py }}
uses: actions/setup-python@v7
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ profile_default/
ipython_config.py

# pyenv
.python-version
#.python-version

# pipenv
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
Expand Down
1 change: 1 addition & 0 deletions .python-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.12
18 changes: 15 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ classifiers = [
"Intended Audience :: Developers",
"License :: OSI Approved :: MIT License",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
Comment thread
hspaans marked this conversation as resolved.
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: 3.14",
Expand All @@ -27,7 +26,7 @@ maintainers = [
{name="Hans Spaans", email="hspaans@gmail.com"},
]

requires-python = ">= 3.11,<3.15"
requires-python = ">= 3.12,<3.15"

dependencies = [
]
Expand Down Expand Up @@ -62,6 +61,7 @@ lint = [
"flake8-rst-docstrings",
"flake8-isort",
"pymarkdownlnt",
"pyupgrade",
"rstcheck",
"yamllint",
]
Expand Down Expand Up @@ -111,7 +111,7 @@ skips = ["B101", "B601", "S101"]

[tool.tox]
requires = ["tox>=4.52.1,<5.0.0"]
env_list = ["lint", "fix", "3.14", "3.13", "3.12", "3.11", "cov", "type", "pkg_meta"]
env_list = ["lint", "fix", "3.14", "3.13", "3.12", "cov", "type", "pkg_meta"]
skip_missing_interpreters = true

[tool.tox.env_run_base]
Expand Down Expand Up @@ -155,3 +155,15 @@ commands = [
["pymarkdownlnt", "scan", "."],
["python", "-c", 'print(r"{env_python}")'],
]

[tool.tox.env.fix]
description = "running pyupgrade at {envdir}"
package = "editable"
dependency_groups = ["lint", "test"]
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"],
# Fails the build if pyupgrade modified any files (perfect for CI)
["git", "diff", "--exit-code"]
]
6 changes: 2 additions & 4 deletions src/m6502/processor.py
Original file line number Diff line number Diff line change
Expand Up @@ -777,7 +777,7 @@ def _ins_lda_inx(self) -> None:
The instruction costs 2 bytes and 6 cycles to complete.
"""
self.reg_a = self._read_byte(
self._read_word(((self._fetch_byte() + self.reg_x) & 0xFF))
self._read_word((self._fetch_byte() + self.reg_x) & 0xFF)
)
self._evaluate_flags_nz(self.reg_a)
self.cycles += 1 # TODO: Why is the extra cycle required?
Expand Down Expand Up @@ -1261,9 +1261,7 @@ def _ins_sta_inx(self) -> None:
The instruction costs 2 bytes and 6 cycles to complete.
"""
self._write_byte(
self._read_byte(
self._read_word(((self._fetch_byte() + self.reg_x) & 0xFF))
),
self._read_byte(self._read_word((self._fetch_byte() + self.reg_x) & 0xFF)),
self.reg_a,
)

Expand Down