From 8036fbff48416c8e956949c05bd2f8232b264fe1 Mon Sep 17 00:00:00 2001 From: Kenya Otsuka Date: Mon, 15 Jun 2026 16:02:03 +0000 Subject: [PATCH 1/2] chore: raise minimum Python to 3.8 and update legacy CI to 3.8/3.9 Part of #120: lift the floor from Python 3.6 to 3.8 while keeping the upper bound at <3.12. - requires-python: ">= 3.6, < 3.12" -> ">= 3.8, < 3.12" - drop now-dead python_version dependency markers (<3.7/<3.8) and flatten the trivially-true ones (numpy, h5py, typing-extensions, nipy, mkdocs*) - repurpose the legacy CI workflow (test_old.yml) from 3.6/3.7 to 3.8/3.9, dropping the 3.6 container hack, Cython pin, and torch/task ignores, and excluding pytest-github-actions-annotate-failures v0.3.0 (INTERNALERROR on 3.8/3.9, matching ci.yml) - remove the obsolete "Installation (Python 3.6~3.8)" README section --- .github/workflows/test_old.yml | 41 +++++----------------------------- README.md | 10 --------- pyproject.toml | 20 +++++++---------- 3 files changed, 14 insertions(+), 57 deletions(-) diff --git a/.github/workflows/test_old.yml b/.github/workflows/test_old.yml index be0a5c95..cd514c8d 100644 --- a/.github/workflows/test_old.yml +++ b/.github/workflows/test_old.yml @@ -5,42 +5,12 @@ on: branches: [ "maintenance/legacy" ] jobs: - test_py36: - runs-on: ubuntu-22.04 - - # NOTE: Python 3.6 is not supported in Ubuntu 22.04, so we use a container with Python 3.6 installed. - container: - image: python:3.6-buster - steps: - - uses: actions/checkout@v6 - - - name: Install dependencies - run: | - python -m pip install --upgrade pip - python -m pip install pytest pytest-cov pytest-github-actions-annotate-failures - pip install Cython==0.29.36 numpy - pip install .[dev] - - - name: Test with pytest - shell: bash - run: | - ( - set -o pipefail - pytest \ - --ignore=tests/dl/torch \ - --ignore=tests/recon/torch \ - --ignore=tests/task \ - --junitxml=pytest.yml \ - --cov-report=term-missing:skip-covered --cov=bdpy tests | tee pytest-coverage.txt - ) - - - test_py37: - runs-on: ubuntu-22.04 + test_legacy: + runs-on: ubuntu-latest strategy: fail-fast: false matrix: - python-version: ["3.7"] + python-version: ["3.8", "3.9"] steps: - uses: actions/checkout@v6 @@ -54,9 +24,10 @@ jobs: - name: Install dependencies run: | python -m pip install --upgrade pip - python -m pip install pytest pytest-cov pytest-github-actions-annotate-failures - pip install Cython==0.29.36 numpy + python -m pip install pytest pytest-cov "pytest-github-actions-annotate-failures!=0.3.0" pip install .[dev] + # NOTE: pytest-github-actions-annotate-failures v0.3.0 causes INTERNALERROR in Python 3.8 and 3.9. + # c.f. https://github.com/pytest-dev/pytest-github-actions-annotate-failures/issues/106 - name: Test with pytest run: | diff --git a/README.md b/README.md index e56a7835..0ccdfaaa 100644 --- a/README.md +++ b/README.md @@ -58,16 +58,6 @@ To install the latest development version ("master" branch of the repository), p $ pip install git+https://github.com/KamitaniLab/bdpy.git ``` -## Installation (Python 3.6~3.8) -For Python 3.6, use the following commands: - -```shell -$ pip install "Cython==0.29.36" "numpy" -$ pip install bdpy -``` - - - ## Packages - bdata: BdPy data format (BData) core package diff --git a/pyproject.toml b/pyproject.toml index a3cd00d6..8f153111 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -10,23 +10,20 @@ authors = [ { name = "Shuntaro C. Aoki", email = "s_aoki@i.kyoto-u.ac.jp" } ] readme = "README.md" -requires-python = ">= 3.6, < 3.12" +requires-python = ">= 3.8, < 3.12" license = { file = "LICENSE" } keywords = ["neuroscience", "neuroimaging", "brain decoding", "fmri", "machine learning"] dependencies = [ - "numpy>=1.19; python_version < '3.7'", - "numpy>=1.20; python_version >= '3.7'", + "numpy>=1.20", "scipy", "scikit-learn", - "h5py>=3.0; python_version >= '3.7'", - "h5py<3.0; python_version < '3.7'", + "h5py>=3.0", "hdf5storage", "pyyaml", "pandas", "tqdm", - "typing-extensions>=4.1.0; python_version < '3.8'", - "typing-extensions>=4.5.0; python_version >= '3.8'" + "typing-extensions>=4.5.0" ] [project.optional-dependencies] @@ -45,8 +42,7 @@ fig = [ mri = [ "numpy<1.24", "nibabel==3.2", - "nipy>=0.6.0; python_version >= '3.8'", - "nipy<0.6.0; python_version < '3.8'" + "nipy>=0.6.0" ] pipeline = [ "hydra-core", @@ -79,9 +75,9 @@ dev = [ "mypy" ] docs = [ - "mkdocs>=1.6; python_version >= '3.8'", - "mkdocs-material>=9.5; python_version >= '3.8'", - "mkdocstrings[python]>=0.25; python_version >= '3.8'", + "mkdocs>=1.6", + "mkdocs-material>=9.5", + "mkdocstrings[python]>=0.25", ] [tool.uv] From c7b70aefb8eb6a79009f04ef55e40ff34b0ab8c9 Mon Sep 17 00:00:00 2001 From: Kenya Otsuka Date: Tue, 16 Jun 2026 06:48:11 +0000 Subject: [PATCH 2/2] ci: unify legacy testing into ci.yml as a non-blocking job Address review feedback: instead of a separate test_old.yml workflow, split ci.yml into two jobs: - `test` (3.10/3.11): standard support, failures block merges - `test-legacy` (3.8/3.9): continue-on-error, so failures are visible but do not block merges Remove the now-redundant test_old.yml. Legacy coverage upload is omitted from test-legacy so only the standard job feeds coverage-comment.yml. --- .github/workflows/ci.yml | 38 +++++++++++++++++++++++++++++++-- .github/workflows/test_old.yml | 39 ---------------------------------- 2 files changed, 36 insertions(+), 41 deletions(-) delete mode 100644 .github/workflows/test_old.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0012f58c..67037870 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -17,12 +17,12 @@ env: COVERAGE_PYTHON: "3.11" jobs: - test: + test: # standard support: failures block merges runs-on: ubuntu-latest strategy: fail-fast: false matrix: - python-version: ["3.8", "3.9", "3.10", "3.11"] + python-version: ["3.10", "3.11"] steps: - uses: actions/checkout@v6 @@ -65,3 +65,37 @@ jobs: pytest.yml pr_number.txt retention-days: 3 + + test-legacy: # legacy support: failures are visible but do not block merges + runs-on: ubuntu-latest + continue-on-error: true + strategy: + fail-fast: false + matrix: + python-version: ["3.8", "3.9"] + + steps: + - uses: actions/checkout@v6 + + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v6 + with: + python-version: ${{ matrix.python-version }} + cache: "pip" + + - name: Install dependencies + run: | + python -m pip install --upgrade pip + python -m pip install pytest pytest-cov "pytest-github-actions-annotate-failures!=0.3.0" + pip install .[dev] + # NOTE: pytest-github-actions-annotate-failures v0.3.0 causes INTERNALERROR in Python 3.8 and 3.9. + # c.f. https://github.com/pytest-dev/pytest-github-actions-annotate-failures/issues/106 + + # https://stackoverflow.com/questions/985876/tee-and-exit-status + - name: Test with pytest + run: | + ( + set -o pipefail + pytest --junitxml=pytest.yml \ + --cov-report=term-missing:skip-covered --cov=bdpy tests | tee pytest-coverage.txt + ) diff --git a/.github/workflows/test_old.yml b/.github/workflows/test_old.yml deleted file mode 100644 index cd514c8d..00000000 --- a/.github/workflows/test_old.yml +++ /dev/null @@ -1,39 +0,0 @@ -name: test_old - -on: - push: - branches: [ "maintenance/legacy" ] - -jobs: - test_legacy: - runs-on: ubuntu-latest - strategy: - fail-fast: false - matrix: - python-version: ["3.8", "3.9"] - - steps: - - uses: actions/checkout@v6 - - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v6 - with: - python-version: ${{ matrix.python-version }} - cache: "pip" - - - name: Install dependencies - run: | - python -m pip install --upgrade pip - python -m pip install pytest pytest-cov "pytest-github-actions-annotate-failures!=0.3.0" - pip install .[dev] - # NOTE: pytest-github-actions-annotate-failures v0.3.0 causes INTERNALERROR in Python 3.8 and 3.9. - # c.f. https://github.com/pytest-dev/pytest-github-actions-annotate-failures/issues/106 - - - name: Test with pytest - run: | - ( - set -o pipefail - pytest \ - --junitxml=pytest.yml \ - --cov-report=term-missing:skip-covered --cov=bdpy tests | tee pytest-coverage.txt - )