ChrisNeedham24/microcosm

Upgrade to Python 3.12

ChrisNeedham24 opened this issue · 3 comments

  • Jump straight from 3.10 to 3.12 - there wasn't anything in 3.11 that I thought was worth upgrading for.
  • Update documentation to reflect that 3.12 is required.
  • Consider whether there are places where we could declare custom types (e.g. type Location = Tuple[int, int])
  • Replace usages of split_list_into_chunks() in calculator.py with itertools.batched() - can remove the custom function and its test afterwards.
  • Determine whether there are any multi-line f-strings we could use.
  • Deal with any other warnings that may appear.

Will also need to update nuitka since the current version only experimentally supports 3.11/3.12.

Acceptance Criteria:

  • Bump Python version in GitHub actions (.github/workflows/ci.yml and .github/workflows/bundle.yml) to the latest available patch version of 3.12.
  • Update README.md and CONTRIBUTING.md to refer to Python 3.12 rather than 3.10.
  • Investigate and determine whether there are any places where custom types (e.g. type Location = Tuple[int, int] would make sense, and implement them if so.
  • Replace usages of split_list_into_chunks() in calculator.py with itertools.batched().
  • Remove the split_list_into_chunks() function from calculator.py and its test from test_calculator.py.
  • Investigate and determine whether there are any cases where we would benefit from using multi-line f-strings, and implement them if so.
  • Remove any warnings that appear in your IDE (PyCharm is usually good for this).

Will also need to update pyproject.toml to remove 3.10 and 3.11 as supported.