Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[MAINT] drop python 3.7 #4033

Merged
merged 4 commits into from
Oct 25, 2023
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/bug.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,11 @@ body:
label: Python version
description: What python version are you using?
options:
- label: '3.12'
- label: '3.11'
- label: '3.10'
- label: '3.9'
- label: '3.8'
- label: '3.7'

- type: textarea
attributes:
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
min_requirements:
if: github.repository == 'nilearn/nilearn'
runs-on: ubuntu-latest
name: Python 3.7, minimal requirements without Matplotlib
name: minimal requirements without Matplotlib
defaults:
run:
shell: bash
Expand All @@ -22,10 +22,10 @@ jobs:
steps:
- name: Checkout nilearn
uses: actions/checkout@v4
- name: Setup python '3.7'
- name: Setup python '3.8'
uses: actions/setup-python@v4
with:
python-version: '3.7'
python-version: '3.8'
- name: Display Python version
shell: bash -l {0}
run: python -c "import sys; print(sys.version)"
Expand All @@ -45,7 +45,7 @@ jobs:
min_requirements_matplotlib:
if: github.repository == 'nilearn/nilearn'
runs-on: ubuntu-latest
name: Python 3.7, minimal requirements with Matplotlib
name: minimal requirements with Matplotlib
defaults:
run:
shell: bash
Expand All @@ -58,7 +58,7 @@ jobs:
- name: Setup python
uses: actions/setup-python@v4
with:
python-version: '3.7'
python-version: '3.8'
- name: Display Python version
shell: bash -l {0}
run: python -c "import sys; print(sys.version)"
Expand All @@ -79,7 +79,7 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12']
python-version: ['3.9', '3.10', '3.11', '3.12']
name: ${{ matrix.os }} with Python ${{ matrix.python-version }} and latest package versions
defaults:
run:
Expand Down
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ repos:
rev: v3.13.0
hooks:
- id: pyupgrade
args: [--py36-plus]
args: [--py38-plus]

- repo: https://github.com/pre-commit/pygrep-hooks
rev: v1.10.0
Expand Down
18 changes: 9 additions & 9 deletions nilearn/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,19 +49,19 @@
__version__ = "0+unknown"


def _py37_deprecation_warning():
py37_warning = (
"Python 3.7 support is deprecated and will be removed in "
"release 0.12 of Nilearn. Consider switching to "
"Python 3.9 or 3.10."
def _py_deprecation_warning():
py_warning = (
"Python 3.8 support is deprecated "
"and will be removed in release 0.12.0 of Nilearn."
"Consider switching to a more recent Python version."
)
warnings.filterwarnings("once", message=py37_warning)
warnings.warn(message=py37_warning, category=FutureWarning, stacklevel=3)
warnings.filterwarnings("once", message=py_warning)
warnings.warn(message=py_warning, category=FutureWarning, stacklevel=3)


def _python_deprecation_warnings():
if sys.version_info.major == 3 and sys.version_info.minor == 7:
_py37_deprecation_warning()
if sys.version_info.major == 3 and sys.version_info.minor == 8:
_py_deprecation_warning()


_python_deprecation_warnings()
Expand Down
12 changes: 6 additions & 6 deletions nilearn/tests/test_init.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,17 @@ def test_version_number():


with warnings.catch_warnings(record=True):
from nilearn import _py37_deprecation_warning, _python_deprecation_warnings
from nilearn import _py_deprecation_warning, _python_deprecation_warnings


def test_py37_deprecation_warning():
with pytest.warns(FutureWarning, match="Python 3.7 support is deprecated"):
_py37_deprecation_warning()
def test_py_deprecation_warning():
with pytest.warns(FutureWarning, match="Python 3.8 support is deprecated"):
_py_deprecation_warning()


def test_python_deprecation_warnings():
if sys.version_info.major == 3 and sys.version_info.minor == 6:
if sys.version_info.major == 3 and sys.version_info.minor == 8:
with pytest.warns(
FutureWarning, match="Python 3.6 support is deprecated"
FutureWarning, match="Python 3.8 support is deprecated"
):
_python_deprecation_warnings()
3 changes: 1 addition & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ classifiers = [
"Operating System :: POSIX",
"Operating System :: Unix",
"Operating System :: MacOS",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
Expand All @@ -41,7 +40,7 @@ license = {text = "new BSD"}
maintainers = [{name = "Bertrand Thirion", email = "bertrand.thirion@inria.fr"}]
name = "nilearn"
readme = "README.rst"
requires-python = ">=3.7"
requires-python = ">=3.8"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure we should already deprecate Python 3.8 ?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure either. 3.8 reaches EOL in October next year. We can discuss in the coredev meeting


[project.optional-dependencies]
# A combination of dependencies useful for developers
Expand Down