Skip to content

Update Python dependencies and fix GitHub Actions workflow#99

Closed
rcmdnk wants to merge 1 commit intomne-tools:masterfrom
rcmdnk:github_actions
Closed

Update Python dependencies and fix GitHub Actions workflow#99
rcmdnk wants to merge 1 commit intomne-tools:masterfrom
rcmdnk:github_actions

Conversation

@rcmdnk
Copy link
Collaborator

@rcmdnk rcmdnk commented Oct 15, 2025

  • ubuntu-20.04 is obsolete and no longer supported. Since this repository does not strongly depend on a specific OS version, it is better to use ubuntu-latest to simplify maintenance.
  • Update outdated actions:
    • actions/checkout, conda-incubator/setup-miniconda, and codecov/codecov-action.
  • Add Python 3.10 and 3.13 to the matrix strategy.
    • Python 3.8 has already reached end of life, and some libraries no longer support it with their latest versions.
    • The test suite should therefore include newer Python releases.
    • Python 3.9 will also reach end of life at the end of October.
    • Although Python 3.14 is the latest version, Numba does not yet support it (numba/numba#9957
      ).
    • Hence, Python 3.10 and 3.13 were added to the matrix.
  • Remove env.PYTHON_VERSION and replace it with matrix.python-version for consistency with the workflow matrix configuration.

All tests will pass once #97 and #98 are merged.
Example test result is here: https://github.com/rcmdnk/mne-features/actions/runs/18524132632

@jbschiratti
Copy link
Collaborator

Thank you @rcmdnk for this PR! The workflow file has not been updated in a long time.

In my opinion, we should support Python >= 3.12,<3.14:

  • Python 3.10 will be deprecated in a year (~Oct. 2026)
  • As you noted, numba does not yet support Python 3.14.

Can you, please, update the workflow file to use 3.12 and 3.13?

@rcmdnk
Copy link
Collaborator Author

rcmdnk commented Oct 17, 2025

@jbschiratti
Thank you for the review.

The Python versions in the workflow have been updated to 3.12 and 3.13.

Regarding the Python version requirements, there are a few differences:

  • python>=3.8: specified in environment.yml for Conda
  • python_requires='>=3.6': specified in setup.py for the package build (PyPI requirement)

It would be good to align and maintain these versions consistently at some point.

As for merging, it seems I don’t have the permission to merge this PR.
Could you please merge it for me?

@rcmdnk
Copy link
Collaborator Author

rcmdnk commented Oct 17, 2025

It may be necessary for all checks to pass before merging this PR.
If that’s the case, I can create a combined PR including #97, #98, and this one (#99).

Would you prefer that I combine these commits into this PR, or open a new PR instead?

@jbschiratti
Copy link
Collaborator

@hubertjb Thank you for the review.

Be careful, you're tagging someone else on this PR.

The Python versions in the workflow have been updated to 3.12 and 3.13.

I've thought about this and I think that it would make sense to align with what's done in mne-python or scikit-learn.

Therefore, I'd suggest:

  • requires_python=">=3.10,<3.14" in setup.py
  • python >=3.10,<3.14 in environment.yaml
  • python-version: [ "3.10", "3.11", "3.12", "3.13" ] in main.yml

@rcmdnk rcmdnk changed the title Update GitHub Actions workflows and dependencies Update Python dependencies (GitHub Actions, environment.yaml, setup.py) Oct 17, 2025
@rcmdnk
Copy link
Collaborator Author

rcmdnk commented Oct 17, 2025

I'm sorry for the wrong mention.

Regarding the Python version requirements, I think it’s safer not to set <3.14 for this project.
If we specify <3.14, we’ll need to make a new release as soon as Numba releases a version that supports Python 3.14.
In addition, Python 3.15 is expected to be released next year.

@agramfort
Copy link
Member

@rcmdnk I just made you a maintainer of the repo. Thanks for helping this project stay usable by the community 🙏

@rcmdnk rcmdnk changed the title Update Python dependencies (GitHub Actions, environment.yaml, setup.py) Update Python dependencies and fix GitHub Actions workflow Oct 19, 2025
@rcmdnk rcmdnk force-pushed the github_actions branch 3 times, most recently from 7a3ea61 to 3b7a460 Compare October 20, 2025 02:08
@rcmdnk
Copy link
Collaborator Author

rcmdnk commented Oct 20, 2025

Thanks! This library is very useful, and I’ll try to keep it in good shape.

I've rebased this branch onto master (including #97, #98), and all tests are now green.
For this PR, I’ve set the Python version requirement to >=3.8 to minimize the impact.
If you’re okay with that, I’ll go ahead and merge the PR.

Note

The setup-miniconda action sometimes raises a CondaHTTPError.
Such jobs usually succeed when retried.
It seems the issue tends to occur more often at certain times of the day.
Ref: conda-incubator/setup-miniconda#129

To mitigate this, I’ve increased the number of retries and the timeout in the Conda configuration.
However, some jobs may still fail occasionally.
If that happens, simply re-run the failed jobs and they should pass.

@jbschiratti
Copy link
Collaborator

@rcmdnk Thank you very much for updating the repository.

One remark: I'm not sure that we need python >= 3.8 as Python 3.8 has reached end-of-life on October 2024.
If some people are still using Python 3.8, they probably should upgrade to Python 3.10 (or even Python 3.12).
I'd suggest to set python >= 3.10,<3.14. When numba is stable on Python 3.14, we'll allow 3.14 as well.

of auditory vs. visual stimuli).

"""
# Author: Jean-Baptiste Schiratti <jean.baptiste.schiratti@gmail.com>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You may add your name and e-mail in this list of authors :-)

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you check that you can successfully generate the docs with this new example?


X_train, X_test, y_train, y_test = train_test_split(data, y, test_size=0.2)
accuracy = pipe.fit(X_train, y_train).score(X_test, y_test)
print("Accuracy score = %1.3f" % accuracy)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use f-string instead

return ['ch%s' % ch for ch in range(n_channels)]
else:
return ['ch%s_%s' % (ch, i) for ch in range(n_channels)
return ['ch%s__%s' % (ch, i) for ch in range(n_channels)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use f-strings instead

Copy link
Collaborator

@jbschiratti jbschiratti Oct 20, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The same comment applies to other places of this file.

"""Get the feature names"""
# trick: use only the first epoch to get the feature names
df = extract_features(
X[:1],
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
X[:1],
X[0],


feature_names : list of str

separator : str
Copy link
Collaborator

@jbschiratti jbschiratti Oct 20, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should list valid separators? Not all strings should be used as separators, right?

For example:

Suggested change
separator : str
separator : Literal["", "_", "__"]

Copy link
Collaborator

@jbschiratti jbschiratti left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot @rcmdnk for these changes and updating the unit tests.

A few changes are needed before we merge this

chore: upgrade `actions/checkout` to v5 in .github/workflows/main.yml
chore: upgrade `conda-incubator/setup-miniconda` to v3 in .github/workflows/main.yml
chore: upgrade `codecov/codecov-action` to v5 in .github/workflows/main.yml
chore: update Ubuntu runner to `ubuntu-latest` in .github/workflows/main.yml
chore: add Python 3.10,3.11,3.12,3.13 to matrix strategy in .github/workflows/main.yml
chore: Configure retries and timeouts for conda downloads in .github/workflows/main.yml
chore: update python version (>=3.10,<3.14) in setup.py and environment.yml — 3.9 reaches end of security support in Oct 2025, and 3.14 is not yet supported by Numba (numba/numba#9957)
@rcmdnk
Copy link
Collaborator Author

rcmdnk commented Oct 20, 2025

@jbschiratti

Sorry, some previous commit hashes were changed when I rebased histories.
I've not changed examples/plot_feature_names_analysis.py in this PR.
The history was fixed and this PR changes only .github/fowkflows/main.yml, setup.py, and enviroment.yml.

As you mentioned above, I've updated python version as >=3.10,<3.14 in these files.

@rcmdnk
Copy link
Collaborator Author

rcmdnk commented Nov 20, 2025

#100 includes these ubuntu/python updates.
Therefore, I close this PR.

@rcmdnk rcmdnk deleted the github_actions branch February 1, 2026 03:20
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.

3 participants