Skip to content

Commit

Permalink
Merge pull request #114 from JulioAPeraza/depc-py36
Browse files Browse the repository at this point in the history
Raise deprecation warnings with Python 3.6 and 3.7
  • Loading branch information
JulioAPeraza authored Jan 26, 2023
2 parents 001f5d6 + 75fbb1d commit 604bb4f
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/python-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 9 additions & 1 deletion .github/workflows/testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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}
Expand Down
34 changes: 34 additions & 0 deletions pymare/__init__.py
Original file line number Diff line number Diff line change
@@ -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

Expand All @@ -13,3 +16,34 @@

__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()
2 changes: 2 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 604bb4f

Please sign in to comment.