Skip to content

Commit

Permalink
Add Python 3.12 (mne-tools#12361)
Browse files Browse the repository at this point in the history
Co-authored-by: Eric Larson <[email protected]>
  • Loading branch information
2 people authored and snwnde committed Mar 20, 2024
1 parent 8c1d40e commit 90f8035
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 7 deletions.
14 changes: 10 additions & 4 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,14 +55,14 @@ jobs:
strategy:
matrix:
include:
- os: ubuntu-latest
python: '3.10'
kind: conda
- os: ubuntu-latest
python: '3.11'
kind: pip-pre
- os: ubuntu-latest
python: '3.12'
kind: conda
- os: macos-latest
python: '3.9'
python: '3.11'
kind: mamba
- os: windows-latest
python: '3.10'
Expand All @@ -89,6 +89,12 @@ jobs:
python-version: ${{ matrix.python }}
if: startswith(matrix.kind, 'pip')
# Python (if conda)
- name: Remove numba and dipy
run: | # TODO: Remove when numba 0.59 and dipy 1.8 land on conda-forge
sed -i '/numba/d' environment.yml
sed -i '/dipy/d' environment.yml
sed -i 's/- mne$/- mne-base/' environment.yml
if: matrix.os == 'ubuntu-latest' && startswith(matrix.kind, 'conda') && matrix.python == '3.12'
- uses: mamba-org/setup-micromamba@v1
with:
environment-file: ${{ env.CONDA_ENV }}
Expand Down
9 changes: 9 additions & 0 deletions doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -1335,6 +1335,15 @@ def reset_warnings(gallery_conf, fname):
r"The .* was deprecated in Matplotlib 3\.7",
# scipy
r"scipy.signal.morlet2 is deprecated in SciPy 1\.12",
# Matplotlib->tz
r"datetime\.datetime\.utcfromtimestamp",
# joblib
r"ast\.Num is deprecated",
r"Attribute n is deprecated and will be removed in Python 3\.14",
# numpydoc
r"ast\.NameConstant is deprecated and will be removed in Python 3\.14",
# pooch
r"Python 3\.14 will, by default, filter extracted tar archives.*",
):
warnings.filterwarnings( # deal with other modules having bad imports
"ignore", message=".*%s.*" % key, category=DeprecationWarning
Expand Down
9 changes: 9 additions & 0 deletions mne/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,15 @@ def pytest_configure(config):
ignore:Mesa version 10\.2\.4 is too old for translucent.*:RuntimeWarning
# Matplotlib <-> NumPy 2.0
ignore:`row_stack` alias is deprecated.*:DeprecationWarning
# Matplotlib->tz
ignore:datetime.datetime.utcfromtimestamp.*:DeprecationWarning
# joblib
ignore:ast\.Num is deprecated.*:DeprecationWarning
ignore:Attribute n is deprecated and will be removed in Python 3\.14.*:DeprecationWarning
# numpydoc
ignore:ast\.NameConstant is deprecated and will be removed in Python 3\.14.*:DeprecationWarning
# pooch
ignore:Python 3\.14 will, by default, filter extracted tar archives.*:DeprecationWarning
""" # noqa: E501
for warning_line in warning_lines.split("\n"):
warning_line = warning_line.strip()
Expand Down
3 changes: 1 addition & 2 deletions mne/export/_egimff.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ def export_evokeds_mff(fname, evoked, history=None, *, overwrite=False, verbose=
using MFF read functions.
"""
mffpy = _import_mffpy("Export evokeds to MFF.")
import pytz

info = evoked[0].info
if np.round(info["sfreq"]) != info["sfreq"]:
Expand All @@ -73,7 +72,7 @@ def export_evokeds_mff(fname, evoked, history=None, *, overwrite=False, verbose=
if op.exists(fname):
os.remove(fname) if op.isfile(fname) else shutil.rmtree(fname)
writer = mffpy.Writer(fname)
current_time = pytz.utc.localize(datetime.datetime.utcnow())
current_time = datetime.datetime.now(datetime.timezone.utc)
writer.addxml("fileInfo", recordTime=current_time)
try:
device = info["device_info"]["type"]
Expand Down
2 changes: 1 addition & 1 deletion tools/github_actions_dependencies.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ INSTALL_ARGS="-e"
INSTALL_KIND="test_extra,hdf5"
if [ ! -z "$CONDA_ENV" ]; then
echo "Uninstalling MNE for CONDA_ENV=${CONDA_ENV}"
conda remove -c conda-forge --force -yq mne
conda remove -c conda-forge --force -yq mne-base
python -m pip uninstall -y mne
if [[ "${RUNNER_OS}" != "Windows" ]]; then
INSTALL_ARGS=""
Expand Down

0 comments on commit 90f8035

Please sign in to comment.