From 52c5374e332ad3d1761bf9111d7d1f6e25a742dd Mon Sep 17 00:00:00 2001 From: JulioAPeraza Date: Wed, 25 Jan 2023 11:51:22 -0500 Subject: [PATCH 1/4] Add deprecation warnings for Python 3.6 and 3.7 --- .github/workflows/python-publish.yml | 2 +- .github/workflows/testing.yml | 10 ++++++++- pymare/__init__.py | 32 ++++++++++++++++++++++++++++ 3 files changed, 42 insertions(+), 2 deletions(-) diff --git a/.github/workflows/python-publish.yml b/.github/workflows/python-publish.yml index 88d6b34..bee4ac8 100644 --- a/.github/workflows/python-publish.yml +++ b/.github/workflows/python-publish.yml @@ -17,7 +17,7 @@ jobs: - name: Set up Python uses: actions/setup-python@v2 with: - python-version: '3.7' + python-version: '3.8' - name: Install dependencies run: | python -m pip install --upgrade pip diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml index 555c1b5..050df84 100644 --- a/.github/workflows/testing.yml +++ b/.github/workflows/testing.yml @@ -40,6 +40,14 @@ jobs: matrix: os: ["ubuntu-latest", "macos-latest"] python-version: ["3.6", "3.7", "3.8", "3.9"] + 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" name: ${{ matrix.os }} with Python ${{ matrix.python-version }} defaults: run: @@ -73,7 +81,7 @@ jobs: - name: Set up Python environment uses: actions/setup-python@v2 with: - python-version: "3.7" + python-version: "3.8" - name: "Install the package" shell: bash {0} diff --git a/pymare/__init__.py b/pymare/__init__.py index e91cc9b..26a1fd6 100644 --- a/pymare/__init__.py +++ b/pymare/__init__.py @@ -1,4 +1,7 @@ """PyMARE: Python Meta-Analysis & Regression Engine.""" +import sys +import warnings + from .core import Dataset, meta_regression from .effectsize import OneSampleEffectSizeConverter, TwoSampleEffectSizeConverter @@ -13,3 +16,32 @@ __version__ = _version.get_versions()["version"] del _version + + +def _py367_deprecation_warning(): + """Deprecation warnings message. + Notes + ----- + Adapted from NiMARE. + """ + py36_warning = ( + "Python 3.6 and 3.7 support is deprecated and will be removed in release 0.0.5 of PyMARE. " + "Consider switching to Python 3.8, 3.9." + ) + 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 NiMARE. + """ + if sys.version_info.major == 3 and ( + sys.version_info.minor == 6 or sys.version_info.minor == 7 + ): + _py367_deprecation_warning() + + +_python_deprecation_warnings() From 2984f887d9f0a9b71a8aa02da0927162b639c203 Mon Sep 17 00:00:00 2001 From: JulioAPeraza Date: Wed, 25 Jan 2023 16:33:55 -0500 Subject: [PATCH 2/4] Temporary remove scheduled tests --- .github/workflows/testing.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml index 050df84..f0d13bf 100644 --- a/.github/workflows/testing.yml +++ b/.github/workflows/testing.yml @@ -7,9 +7,6 @@ on: pull_request: branches: - '*' - schedule: - # Run tests every Sunday at 12am - - cron: '0 0 * * 0' concurrency: group: environment-${{ github.ref }} From 222e75c98cb969afecdda195d96ea7ecfb52c183 Mon Sep 17 00:00:00 2001 From: JulioAPeraza Date: Wed, 25 Jan 2023 16:34:58 -0500 Subject: [PATCH 3/4] Revert "Temporary remove scheduled tests" This reverts commit 2984f887d9f0a9b71a8aa02da0927162b639c203. --- .github/workflows/testing.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml index f0d13bf..050df84 100644 --- a/.github/workflows/testing.yml +++ b/.github/workflows/testing.yml @@ -7,6 +7,9 @@ on: pull_request: branches: - '*' + schedule: + # Run tests every Sunday at 12am + - cron: '0 0 * * 0' concurrency: group: environment-${{ github.ref }} From 75fbb1dcacfb8be32e05f74df82d2e53c0795584 Mon Sep 17 00:00:00 2001 From: JulioAPeraza Date: Wed, 25 Jan 2023 16:40:10 -0500 Subject: [PATCH 4/4] Fix lint error --- pymare/__init__.py | 2 ++ setup.cfg | 2 ++ 2 files changed, 4 insertions(+) diff --git a/pymare/__init__.py b/pymare/__init__.py index 26a1fd6..6f112e9 100644 --- a/pymare/__init__.py +++ b/pymare/__init__.py @@ -20,6 +20,7 @@ def _py367_deprecation_warning(): """Deprecation warnings message. + Notes ----- Adapted from NiMARE. @@ -34,6 +35,7 @@ def _py367_deprecation_warning(): def _python_deprecation_warnings(): """Raise deprecation warnings. + Notes ----- Adapted from NiMARE. diff --git a/setup.cfg b/setup.cfg index a71d2e7..17959f6 100644 --- a/setup.cfg +++ b/setup.cfg @@ -97,5 +97,7 @@ max-line-length = 99 exclude=*build/,_version.py putty-ignore = */__init__.py : +F401 +per-file-ignores = + */__init__.py:D401 ignore = E203,E402,E722,W503 docstring-convention = numpy