Skip to content

Commit

Permalink
Drop support for Python 3.6 and 3.7 (#780)
Browse files Browse the repository at this point in the history
* Drop Python 3.6 and 3.7. Support Python 3.11

* Drop 3.11

* regex=True for pandas 2.0.0
  • Loading branch information
JulioAPeraza committed Apr 4, 2023
1 parent 17ea335 commit 4b14bcb
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 43 deletions.
10 changes: 1 addition & 9 deletions .github/workflows/testing.yml
Expand Up @@ -38,15 +38,7 @@ jobs:
fail-fast: false
matrix:
os: ["ubuntu-latest", "macos-latest"]
python-version: ["3.6", "3.7", "3.8", "3.9", "3.10"]
include:
# ubuntu-20.04 is used only to test python 3.6
- os: "ubuntu-20.04"
python-version: "3.6"
exclude:
# ubuntu-latest does not support python 3.6
- os: "ubuntu-latest"
python-version: "3.6"
python-version: ["3.8", "3.9", "3.10"]

defaults:
run:
Expand Down
6 changes: 5 additions & 1 deletion docs/installation.rst
Expand Up @@ -15,9 +15,13 @@ If you want to use the most up-to-date version, you can install from the ``main`
pip install git+https://github.com/neurostuff/NiMARE.git
NiMARE requires Python >=3.6 and a number of packages.
NiMARE requires Python ``>=3.8`` and a number of packages.
For a complete list, please see ``nimare/setup.cfg``.

.. note::
We only support Python versions that are part of the Python release cycle (i.e., 3.8, 3.9, and
3.10). For more information, see `Python Supported Versions`_.

What Next?
----------

Expand Down
2 changes: 2 additions & 0 deletions docs/links.rst
Expand Up @@ -68,6 +68,8 @@

.. _PyMARE: https://pymare.readthedocs.io/en/latest/

.. _Python Supported Versions: https://devguide.python.org/versions/#supported-versions

.. _scikit-learn: https://scikit-learn.org/stable/developers/index.html

.. _Scribe: https://brainmap.org/scribe/
Expand Down
32 changes: 0 additions & 32 deletions nimare/__init__.py
@@ -1,6 +1,5 @@
"""NiMARE: Neuroimaging Meta-Analysis Research Environment."""
import logging
import sys
import warnings

from ._version import get_versions
Expand Down Expand Up @@ -41,34 +40,3 @@
]

del get_versions


def _py367_deprecation_warning():
"""Deprecation warnings message.
Notes
-----
Adapted from Nilearn.
"""
py36_warning = (
"Python 3.6 and 3.7 support is deprecated and will be removed in release 0.1.0 of NiMARE. "
"Consider switching to Python 3.8, 3.9 or 3.10."
)
warnings.filterwarnings("once", message=py36_warning)
warnings.warn(message=py36_warning, category=FutureWarning, stacklevel=3)


def _python_deprecation_warnings():
"""Raise deprecation warnings.
Notes
-----
Adapted from Nilearn.
"""
if sys.version_info.major == 3 and (
sys.version_info.minor == 6 or sys.version_info.minor == 7
):
_py367_deprecation_warning()


_python_deprecation_warnings()
2 changes: 1 addition & 1 deletion nimare/annotate/cogat.py
Expand Up @@ -161,7 +161,7 @@ def extract_cogat(text_df, id_df=None, text_column="abstract"):
term_id = id_df["id"].loc[term_idx]
pattern = regex_dict[term]
counts_df[term_id] += text_df[text_column].str.count(pattern).astype(int)
text_df[text_column] = text_df[text_column].str.replace(pattern, term_id)
text_df[text_column] = text_df[text_column].str.replace(pattern, term_id, regex=True)

return counts_df, text_df

Expand Down

0 comments on commit 4b14bcb

Please sign in to comment.