Skip to content

Commit 604bb4f

Browse files
authored
Merge pull request #114 from JulioAPeraza/depc-py36
Raise deprecation warnings with Python 3.6 and 3.7
2 parents 001f5d6 + 75fbb1d commit 604bb4f

File tree

4 files changed

+46
-2
lines changed

4 files changed

+46
-2
lines changed

.github/workflows/python-publish.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
- name: Set up Python
1818
uses: actions/setup-python@v2
1919
with:
20-
python-version: '3.7'
20+
python-version: '3.8'
2121
- name: Install dependencies
2222
run: |
2323
python -m pip install --upgrade pip

.github/workflows/testing.yml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,14 @@ jobs:
4040
matrix:
4141
os: ["ubuntu-latest", "macos-latest"]
4242
python-version: ["3.6", "3.7", "3.8", "3.9"]
43+
include:
44+
# ubuntu-20.04 is used only to test python 3.6
45+
- os: "ubuntu-20.04"
46+
python-version: "3.6"
47+
exclude:
48+
# ubuntu-latest does not support python 3.6
49+
- os: "ubuntu-latest"
50+
python-version: "3.6"
4351
name: ${{ matrix.os }} with Python ${{ matrix.python-version }}
4452
defaults:
4553
run:
@@ -73,7 +81,7 @@ jobs:
7381
- name: Set up Python environment
7482
uses: actions/setup-python@v2
7583
with:
76-
python-version: "3.7"
84+
python-version: "3.8"
7785

7886
- name: "Install the package"
7987
shell: bash {0}

pymare/__init__.py

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
"""PyMARE: Python Meta-Analysis & Regression Engine."""
2+
import sys
3+
import warnings
4+
25
from .core import Dataset, meta_regression
36
from .effectsize import OneSampleEffectSizeConverter, TwoSampleEffectSizeConverter
47

@@ -13,3 +16,34 @@
1316

1417
__version__ = _version.get_versions()["version"]
1518
del _version
19+
20+
21+
def _py367_deprecation_warning():
22+
"""Deprecation warnings message.
23+
24+
Notes
25+
-----
26+
Adapted from NiMARE.
27+
"""
28+
py36_warning = (
29+
"Python 3.6 and 3.7 support is deprecated and will be removed in release 0.0.5 of PyMARE. "
30+
"Consider switching to Python 3.8, 3.9."
31+
)
32+
warnings.filterwarnings("once", message=py36_warning)
33+
warnings.warn(message=py36_warning, category=FutureWarning, stacklevel=3)
34+
35+
36+
def _python_deprecation_warnings():
37+
"""Raise deprecation warnings.
38+
39+
Notes
40+
-----
41+
Adapted from NiMARE.
42+
"""
43+
if sys.version_info.major == 3 and (
44+
sys.version_info.minor == 6 or sys.version_info.minor == 7
45+
):
46+
_py367_deprecation_warning()
47+
48+
49+
_python_deprecation_warnings()

setup.cfg

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,5 +97,7 @@ max-line-length = 99
9797
exclude=*build/,_version.py
9898
putty-ignore =
9999
*/__init__.py : +F401
100+
per-file-ignores =
101+
*/__init__.py:D401
100102
ignore = E203,E402,E722,W503
101103
docstring-convention = numpy

0 commit comments

Comments
 (0)