Skip to content

eegprep extra: declare torch>=2.7 on Python 3.11 (torch 2.6 pins sympy 1.13.1) - #1535

Merged
bruAristimunha merged 1 commit into
braindecode:masterfrom
bruAristimunha:bd-eegprep-floor
Nov 2, 2026
Merged

bruAristimunha merged 1 commit into
braindecode:masterfrom
bruAristimunha:bd-eegprep-floor

Conversation

@bruAristimunha

Copy link
Copy Markdown
Collaborator

With torch==2.6.0 (our floor) on Python 3.11, pip install braindecode[eegprep] cannot resolve:

  • torch 2.6.0 pins sympy==1.13.1;
  • every eegprep release that supports Python 3.11 (from 0.2.23, which is our floor, through 0.3.0) needs sympy>=1.14.0;
  • eegprep 0.4.0 has no sympy requirement but needs Python >= 3.12.

torch 2.7 relaxed its pin to sympy>=1.13.3.

The eegprep extra now declares that floor where it applies: torch>=2.7; python_version < "3.12". Core requirements do not change. On Python >= 3.12, torch 2.6 plus eegprep 0.4.0 still resolve, so the marker leaves those installs alone.

The all extra and CI's tests,moabb,hub,eegprep,typing,viz set include eegprep, so they get the same floor.

The whats_new entry is under 2.1.0 → Requirements. Resolution matrix from the Voyager Job (pip install --dry-run, before/after, py3.11/3.12 × torch 2.6.0 / 2.7.0 / latest) will be posted in a comment below.

Copilot AI balanced review requested due to automatic review settings November 2, 2026 20:55

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.

🟢 Approval recommended

No active review issues were identified for the change making the Python 3.11 PyTorch requirement explicit.

No open issues 🎉

What changed in this PR

This PR makes the eegprep extra’s PyTorch requirement explicit on Python 3.11 to avoid incompatible SymPy requirements.

Changes:

  • Adds torch>=2.7 to the eegprep extra for Python versions below 3.12, also applying through the all extra.
  • Leaves core dependencies and Python 3.12+ requirements unchanged.
  • Documents the requirement in the 2.1.0 release notes.
File Description
pyproject.toml Adds the conditional PyTorch minimum and explains the dependency conflict.
docs/​whats_new.rst Records the Python 3.11 requirement under Requirements.

Review effort: Balanced

@bruAristimunha

Copy link
Copy Markdown
Collaborator Author

Verified in Voyager Jobs bd2fu-t2new-20261102t205841z (this PR, head 9c6fd05c) and bd2fu-t2b-20261102t205554z (master baseline). Each case below is pip 26.3 install --dry-run --ignore-installed -c <constraint> "<checkout>[extras]", with torch and torchaudio pinned together in the constraint:

side Python torch constraint extras resolves torch sympy eegprep
PR 3.11 ==2.6.0 core yes 2.6.0 1.13.1 -
PR 3.11 ==2.6.0 eegprep no - - -
PR 3.11 ==2.6.0 CI set (tests,moabb,hub,eegprep,typing,viz) no - - -
PR 3.11 ==2.6.0 all no - - -
PR 3.11 ==2.7.0 core yes 2.7.0 1.14.0 -
PR 3.11 ==2.7.0 eegprep yes 2.7.0 1.14.0 0.3.0
PR 3.11 ==2.7.0 CI set (tests,moabb,hub,eegprep,typing,viz) yes 2.7.0 1.14.0 0.3.0
PR 3.11 ==2.7.0 all yes 2.7.0 1.14.0 0.3.0
PR 3.11 none (latest) core yes 2.15.0 1.14.0 -
PR 3.11 none (latest) eegprep yes 2.15.0 1.14.0 0.3.0
PR 3.11 none (latest) CI set (tests,moabb,hub,eegprep,typing,viz) yes 2.15.0 1.14.0 0.3.0
PR 3.11 none (latest) all yes 2.15.0 1.14.0 0.3.0
PR 3.12 ==2.6.0 core yes 2.6.0 1.13.1 -
PR 3.12 ==2.6.0 eegprep yes 2.6.0 1.13.1 0.4.0
PR 3.12 ==2.6.0 CI set (tests,moabb,hub,eegprep,typing,viz) yes 2.6.0 1.13.1 0.4.0
PR 3.12 ==2.6.0 all yes 2.6.0 1.13.1 0.4.0
PR 3.12 ==2.7.0 core yes 2.7.0 1.14.0 -
PR 3.12 ==2.7.0 eegprep yes 2.7.0 1.14.0 0.4.0
PR 3.12 ==2.7.0 CI set (tests,moabb,hub,eegprep,typing,viz) yes 2.7.0 1.14.0 0.4.0
PR 3.12 ==2.7.0 all yes 2.7.0 1.14.0 0.4.0
PR 3.12 none (latest) core yes 2.15.0 1.14.0 -
PR 3.12 none (latest) eegprep yes 2.15.0 1.14.0 0.4.0
PR 3.12 none (latest) CI set (tests,moabb,hub,eegprep,typing,viz) yes 2.15.0 1.14.0 0.4.0
PR 3.12 none (latest) all yes 2.15.0 1.14.0 0.4.0

Summary:

  • With this PR, every case resolves except Python 3.11 + torch 2.6.0 together with an extra that includes eegprep. There pip stops right away and names the requirement: braindecode[eegprep] 2.1.0.dev0 depends on torch>=2.7; python_version < "3.12" and extra == "eegprep" / The user requested (constraint) torch==2.6.0.
  • On master the same Python 3.11 + torch 2.6.0 installs fail with an opaque eegprep[eeglabio] 0.3.0 ... no matching distributions available: eegprep (eegprep and the CI set), or with resolution-too-deep after about 7.5 min of backtracking (all).
  • Python 3.12 at torch 2.6.0 still resolves eegprep, the CI set and all (eegprep 0.4.0, sympy 1.13.1), so the marker does not raise its floor.
  • The core install at torch 2.6.0 is unchanged on both Python versions.
  • A real install of this branch on py3.11 + torch 2.7.0+cpu + [tests,eegprep] gave eegprep 0.3.0 and sympy 1.14.0, pip check was clean, and test_eegprep_preprocessor.py passed 48 tests (Jobs bd2fu-t2-20261102t205415z and bd2fu-t2new-20261102t205841z).

@bruAristimunha
bruAristimunha merged commit 2482cb5 into braindecode:master Nov 2, 2026
9 checks passed
@codecov

codecov Bot commented Nov 2, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 91.36%. Comparing base (70f5bd2) to head (9c6fd05).
⚠️ Report is 2 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #1535   +/-   ##
=======================================
  Coverage   91.36%   91.36%           
=======================================
  Files         170      170           
  Lines       22115    22115           
=======================================
  Hits        20206    20206           
  Misses       1909     1909           
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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.

2 participants