Remove Python 2 artifacts from codebase#309
Draft
Copilot wants to merge 2 commits into
Draft
Conversation
Copilot
AI
changed the title
[WIP] Remove Python 2 artefacts from codebase
Remove Python 2 artifacts from codebase
Jun 8, 2026
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.
Python 2 reached end-of-life on January 1, 2020. This PR removes all Python 2 compatibility shims and the
futurepackage dependency.__future__imports removedAll
from __future__ import absolute_import, division, print_function, unicode_literalslines dropped from ~19 files — these are no-ops on Python 3.Runtime compatibility branches eliminated
basestringtry/except →strsys.version[0] == '2'guards forfunctools,zip_longest, andizip_longest→ direct Python 3 importssys.version_info >= (3, 5)guard inhelper.py→ always useconcurrent.futures.ThreadPoolExecutortry/except ImportErrorfallbacks fromcollections→ directcollections.abcimports (Iterable,Mapping,Sequence)__div__/__rdiv__/__idiv__block in_compat/mixins.pyremoved__all__ASCII encoding block inparticles/__init__.pyremovedfuturepackage dependency removedReplaced
future.utils.with_metaclasswith native Python 3 metaclass syntax:Misc
run-tests.py: removed-2/--pycmd python2CLI argumentpyproject.toml: removedfuturefromdependencies, dropped stale Python 2 comment