Skip to content

README dependencies not in sync with pyproject.toml #13830

Closed

Description

@tsbinns

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.

The similar pre-commit hook update-env-file for updating environment.yml gets run whenever dependencies get updated through the spec_zero action, but dependeny-sync just passes (i.e., nothing to update; https://github.com/mne-tools/mne-python/actions/runs/24017316599/job/70039144843#step:10:110).

Activity

  1. larsoner commented on Apr 9, 2026

    @larsoner
    Member

    That hook only gets updated when we release .We should

    1. Fix the README.rst quickly so that CIs are green again
    2. Get rid of it as a pre-commit hook and add it as part of what runs with our version-bump updates / CIs

    @tsbinns you up for doing either or both?

  2. tsbinns commented on Apr 9, 2026

    @tsbinns
    MemberAuthor

    @larsoner Sure, happy to work on both

  3. tsbinns commented on Apr 9, 2026

    @tsbinns
    MemberAuthor

    @larsoner Out of interest, why was dependency-sync only being run on release, and not every commit like update-env-file?

  4. drammock commented on Apr 9, 2026

    @drammock
    Member

    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:

    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.

  5. tsbinns commented on Apr 9, 2026

    @tsbinns
    MemberAuthor

    @larsoner Out of interest, why was dependency-sync only being run on release, and not every commit like update-env-file?

    Ah just saw this in pre-commit config:

    ci:
        skip: [dependency-sync] # needs MNE to work, which exceeds the free tier space alloc.

  6. tsbinns commented on Apr 9, 2026

    @tsbinns
    MemberAuthor

    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:

    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?

  7. larsoner commented on Apr 9, 2026

    @larsoner
    Member

    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.

    Excellent, that's what I had in mind!

  8. larsoner commented on Apr 9, 2026

    @larsoner
    Member

    ... and actually tools/hooks/update_environment_file.py should probably be part of SPEC0 action, too. No need for that as pre-commit hook, either

  9. larsoner commented on Apr 9, 2026

    @larsoner
    Member

    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.

  10. tsbinns commented on Apr 9, 2026

    @tsbinns
    MemberAuthor

    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.

  11. larsoner commented on Apr 9, 2026

    @larsoner
    Member

    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!

  12. drammock commented on Apr 9, 2026

    @drammock
    Member

    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

    Maybe I misunderstood, I thought the proposal was to only sync README at release time. Weekly sync via SPEC0 action seems fine.

  13. larsoner commented on Apr 9, 2026

    @larsoner
    Member

    I thought the proposal was to only sync README at release time. Weekly sync via SPEC0 action seems fine.

    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.12

  14. tsbinns commented on Apr 9, 2026

    @tsbinns
    MemberAuthor

    Okay, I'll push on with #13832 then

  15. drammock commented on Apr 9, 2026

    @drammock
    Member

    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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions