Skip to content

Drop Python 2 compatibility branches across OMV runtime/install paths#154

Merged
pgleeson merged 7 commits into
masterfrom
copilot/drop-python2-related-bits
May 18, 2026
Merged

Drop Python 2 compatibility branches across OMV runtime/install paths#154
pgleeson merged 7 commits into
masterfrom
copilot/drop-python2-related-bits

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented May 18, 2026

OMV still contained Python 2-era conditionals in core install and execution paths despite Python 2 no longer being supported. This PR removes those branches and normalizes behavior to Python 3-only code paths.

  • Engine install path cleanup

    • Removed NetPyNE’s Python 2-only dependency preinstall branch in omv/engines/getnetpyne.py.
    • Simplified NEURON default version handling in omv/engines/getnrn.py to Python 3 assumptions, with a single default constant (DEFAULT_NEURON_VERSION).
    • Added explicit version-family matcher for pip-based NEURON installs (7.8.x, 8.x) via _supports_pip_install(...).
  • Runtime execution path cleanup

    • Removed Python-version branching around subprocess input encoding in:
      • omv/engines/neuron_.py
      • omv/engines/pyneuron.py
    • Both paths now always send encoded command bytes (Python 3 behavior).
  • Parser/output simplification

    • Removed redundant Python 2/3 conditional formatting in omv/parse_omt.py where both branches were identical.
  • Legacy generated CI config alignment

    • Updated autogen Travis template target from Python 2.7 to 3.12 in omv/autogen.py.
  • Focused regression coverage

    • Added omv/test/test_drop_py2_bits.py to lock in:
      • default NEURON install version behavior,
      • supported pip-install version-family behavior,
      • NetPyNE install path behavior without Python 2 branches.

Example of the simplification:

# before
if sys.version_info[0] == 3:
    c = dedent(cmd).encode()
else:
    c = dedent(cmd)

# after
c = dedent(cmd).encode()

Copilot AI linked an issue May 18, 2026 that may be closed by this pull request
Copilot AI and others added 6 commits May 18, 2026 10:49
Copilot AI changed the title [WIP] Remove python2 related code as no longer supported Drop Python 2 compatibility branches across OMV runtime/install paths May 18, 2026
Copilot AI requested a review from pgleeson May 18, 2026 10:55
@pgleeson pgleeson marked this pull request as ready for review May 18, 2026 11:42
@pgleeson pgleeson merged commit 2a7d344 into master May 18, 2026
47 checks passed
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.

Task: drop python2 related bits

2 participants