You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
README dependencies not in sync with pyproject.toml #13830
Core dependencies in README.rst are out of date with pyproject.toml, and have been since end of Jan. E.g., scipy >= 1.11 is listed in the readme, but this hasn't been the case since #13611.
There is a pre-commit hook dependency-sync that handles this, but seems like it hasn't been run. Is now causing checks to fail in Azure. Would be interested to know why this wasn't raising an error before. If you run the hook the readme dependencies do get updated as expected, so nothing's broken with the script being called.
Personally I wish that the README stays in sync with pyproject.toml, because I think folks reading it on the repo will assume it reflects current state of main. But doing this:
Get rid of it as a pre-commit hook and add it as part of what runs with our version-bump updates / CIs
...will allow it to get out of sync, and since dep version bumps can happen quite early in a release cycle, they could be out of sync for up to 4 months. Not sure what the best solution is.
Personally I wish that the README stays in sync with pyproject.toml, because I think folks reading it on the repo will assume it reflects current state of main. But doing this:
Get rid of it as a pre-commit hook and add it as part of what runs with our version-bump updates / CIs
...will allow it to get out of sync, and since dep version bumps can happen quite early in a release cycle, they could be out of sync for up to 4 months. Not sure what the best solution is.
@drammock Just opened #13832 as an attempt addressing this by including the syncing with README in the SPEC-0 action. At least then any changes would be caught each Monday when the job is run.
However, it does muddy what the function of the SPEC-0 action is, since now you could have changes to dependencies that are not being tracked by our SPEC-0 policy getting caught here.
Also, could be the case a change to the deps is made and a release pushed mid-week between SPEC-0 action runs, so that wouldn't be caught.
What about a new action for just checking this that runs on PRs?
Personally I wish that the README stays in sync with pyproject.toml, because I think folks reading it on the repo will assume it reflects current state of main. But doing this:
Get rid of it as a pre-commit hook and add it as part of what runs with our version-bump updates / CIs
...will allow it to get out of sync, and since dep version bumps can happen quite early in a release cycle, they could be out of sync for up to 4 months. Not sure what the best solution is.
I don't quite follow this. SPEC0 action is what bumps these deps in pyproject.toml, so it makes sense to me to have it also bump in README . This would ensure pyproject and README are always in sync, and reflect what is being used in main. So when I say:
Get rid of it as a pre-commit hook and add it as part of what runs with our version-bump updates / CIs
What I mean is really have SPEC0 update everything all at once. No need for any pre-commit hooks to mess with README deps list anymore (the "Copy core dependencies from pyproject.toml to README.rst" currently in pre-commit should be done in SPEC0).
@drammock Just opened #13832 as an attempt addressing this by including the syncing with README in the SPEC-0 action. At least then any changes would be caught each Monday when the job is run.
ooohhhh wait tools/hooks/update_environment_file.py will update things when a dep is added, not just when it updates. Never mind, that one can stay as a pre-commit hook.
SPEC0 action is what bumps these deps in pyproject.toml
But of the deps included in the README, SPEC0 only bumps numpy, scipy, and matplotlib. decorator, jinja2, lazy_loader, packaging, pooch, and tqdm are not managed by the SPEC0 action.
So these other packages could be updated independently of the SPEC0 action, and then we wait until the next Monday for this to be synced with the README.
So these other packages could be updated independently of the SPEC0 action, and then we wait until the next Monday for this to be synced with the README.
Sounds good to me. 1 week delay (max) seems totally fine, especially given how devs typically have very up-to-date dependencies rather than very out-of-date ones!
ok, so the hook only ran when pyproject.toml was updated locally by a human but all the recent changes to pyproject.toml have been done by the SPEC0 action in CI (where the hook is disabled).
If a human had bumped a dependency manually at some point before release, presumably this would have been caught then... but it seems like we're moving more and more towards pinning everything and automated bumping, so we shouldn't rely on humans running the hook anymore.
I guess the alternative would be have the hook always run even if pyproject.toml is untouched, but then random contributors might get local pre-commit failures that they don't expect/understand (if their clone happens to be in a state where the last commit to main was made by the SPEC0 action). So yeah, having the SPEC0 action do it still makes sense.
Activity
larsoner commentedon Apr 9, 2026
That hook only gets updated when we release .We should
README.rstquickly so that CIs are green again@tsbinns you up for doing either or both?
tsbinns commentedon Apr 9, 2026
@larsoner Sure, happy to work on both
tsbinns commentedon Apr 9, 2026
@larsoner Out of interest, why was
dependency-synconly being run on release, and not every commit likeupdate-env-file?drammock commentedon Apr 9, 2026
Note that our README also gets incorporated as "project description" into the PyPI release: https://pypi.org/project/mne/, so the deps listed on PyPI are also wrong.
Personally I wish that the README stays in sync with pyproject.toml, because I think folks reading it on the repo will assume it reflects current state of main. But doing this:
...will allow it to get out of sync, and since dep version bumps can happen quite early in a release cycle, they could be out of sync for up to 4 months. Not sure what the best solution is.
tsbinns commentedon Apr 9, 2026
Ah just saw this in pre-commit config:
tsbinns commentedon Apr 9, 2026
@drammock Just opened #13832 as an attempt addressing this by including the syncing with
READMEin the SPEC-0 action. At least then any changes would be caught each Monday when the job is run.However, it does muddy what the function of the SPEC-0 action is, since now you could have changes to dependencies that are not being tracked by our SPEC-0 policy getting caught here.
Also, could be the case a change to the deps is made and a release pushed mid-week between SPEC-0 action runs, so that wouldn't be caught.
What about a new action for just checking this that runs on PRs?
larsoner commentedon Apr 9, 2026
I don't quite follow this. SPEC0 action is what bumps these deps in
pyproject.toml, so it makes sense to me to have it also bump in README . This would ensurepyprojectandREADMEare always in sync, and reflect what is being used inmain. So when I say:What I mean is really have SPEC0 update everything all at once. No need for any
pre-commithooks to mess with README deps list anymore (the "Copy core dependencies from pyproject.toml to README.rst" currently in pre-commit should be done in SPEC0).Excellent, that's what I had in mind!
larsoner commentedon Apr 9, 2026
... and actually
tools/hooks/update_environment_file.pyshould probably be part of SPEC0 action, too. No need for that as pre-commit hook, eitherlarsoner commentedon Apr 9, 2026
ooohhhh wait
tools/hooks/update_environment_file.pywill update things when a dep is added, not just when it updates. Never mind, that one can stay as a pre-commit hook.tsbinns commentedon Apr 9, 2026
But of the deps included in the
README, SPEC0 only bumpsnumpy,scipy, andmatplotlib.decorator,jinja2,lazy_loader,packaging,pooch, andtqdmare not managed by the SPEC0 action.So these other packages could be updated independently of the SPEC0 action, and then we wait until the next Monday for this to be synced with the
README.larsoner commentedon Apr 9, 2026
Sounds good to me. 1 week delay (max) seems totally fine, especially given how devs typically have very up-to-date dependencies rather than very out-of-date ones!
drammock commentedon Apr 9, 2026
Maybe I misunderstood, I thought the proposal was to only sync README at release time. Weekly sync via SPEC0 action seems fine.
larsoner commentedon Apr 9, 2026
Not quite, that's the current state of affairs on
main😬 Hence why it was out of date and not noticed until I cut 1.12tsbinns commentedon Apr 9, 2026
Okay, I'll push on with #13832 then
drammock commentedon Apr 9, 2026
ok, so the hook only ran when
pyproject.tomlwas updated locally by a human but all the recent changes topyproject.tomlhave been done by the SPEC0 action in CI (where the hook is disabled).If a human had bumped a dependency manually at some point before release, presumably this would have been caught then... but it seems like we're moving more and more towards pinning everything and automated bumping, so we shouldn't rely on humans running the hook anymore.
I guess the alternative would be have the hook always run even if
pyproject.tomlis untouched, but then random contributors might get local pre-commit failures that they don't expect/understand (if their clone happens to be in a state where the last commit tomainwas made by the SPEC0 action). So yeah, having the SPEC0 action do it still makes sense.