diff --git a/.github/workflows/cibuildwheel.yml b/.github/workflows/cibuildwheel.yml index e47d189..a3a3651 100644 --- a/.github/workflows/cibuildwheel.yml +++ b/.github/workflows/cibuildwheel.yml @@ -90,10 +90,8 @@ jobs: - run: ls -al dist - name: Triage dependencies run: | - if [[ "${{ matrix.python-version }}" != "3.13" ]]; then - echo "PIP_EXTRA=wfdb numpy<2 numba pytest-error-for-skips" | tee -a $GITHUB_ENV - echo "PYTEST_EXTRA=--error-for-skips" | tee -a $GITHUB_ENV - fi + echo "PIP_EXTRA=wfdb numba pytest-error-for-skips" | tee -a $GITHUB_ENV + echo "PYTEST_EXTRA=--error-for-skips" | tee -a $GITHUB_ENV - run: python -m pip install ./dist/*.whl pytest pytest-cov edfio $PIP_EXTRA --only-binary="numpy,numba,edfio" - run: pytest -rfEXs --cov=sleepecg --cov-report=xml --tb=short --cov-branch --color=yes $PYTEST_EXTRA tests/ - uses: codecov/codecov-action@v5 diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index d1e38b9..d95170e 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,17 +1,17 @@ repos: - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.6.5 + rev: v0.9.2 hooks: - id: ruff args: [ --fix ] - id: ruff-format - repo: https://github.com/pre-commit/mirrors-mypy - rev: v1.11.2 + rev: v1.14.1 hooks: - id: mypy exclude: ^tests|^examples - args: [--python-version=3.9] + args: [--python-version=3.10] additional_dependencies: - types-PyYAML - types-requests diff --git a/CHANGELOG.md b/CHANGELOG.md index 85d7dce..3ea8184 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,9 @@ ### Changed - Split `get_config` function into `get_config` and `get_config_value` to get the entire configuration (as a dictionary) or an individual configuration key, respectively ([#229](https://github.com/cbrnr/sleepecg/pull/225) by [Clemens Brunner](https://github.com/cbrnr)) +### Removed +- Remove Python 3.9 support ([#241](https://github.com/cbrnr/sleepecg/pull/241) by [Clemens Brunner](https://github.com/cbrnr)) + ### Fixed - Fix `plot_ecg` for newer versions of Matplotlib ([#225](https://github.com/cbrnr/sleepecg/pull/225) by [Clemens Brunner](https://github.com/cbrnr)) diff --git a/README.md b/README.md index 42f4d1b..4f3261f 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -![Python](https://img.shields.io/pypi/pyversions/sleepecg.svg?logo=python&logoColor=white) +![Python](https://img.shields.io/python/required-version-toml?tomlFilePath=https%3A%2F%2Fraw.githubusercontent.com%2Fcbrnr%2Fsleepecg%2Frefs%2Fheads%2Fmain%2Fpyproject.toml&logo=python&logoColor=white) [![PyPI](https://img.shields.io/pypi/v/sleepecg)](https://pypi.org/project/sleepecg/) [![Docs](https://readthedocs.org/projects/sleepecg/badge/?version=latest)](https://sleepecg.readthedocs.io/en/stable/index.html) [![DOI](https://joss.theoj.org/papers/10.21105/joss.05411/status.svg)](https://doi.org/10.21105/joss.05411) diff --git a/pyproject.toml b/pyproject.toml index e57cc8c..36b4eec 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,5 +1,5 @@ [build-system] -requires = ["setuptools", "setuptools-scm", "wheel", "numpy>=2,<3"] +requires = ["setuptools", "setuptools-scm", "wheel", "numpy>=2"] build-backend = "setuptools.build_meta" [project] @@ -11,38 +11,38 @@ authors = [ {name = "Clemens Brunner", email = "clemens.brunner@gmail.com"}, ] readme = "README.md" -requires-python = ">= 3.9" +requires-python = ">= 3.10" classifiers = [ "License :: OSI Approved :: BSD License", "Operating System :: Microsoft :: Windows", "Operating System :: POSIX :: Linux", "Operating System :: MacOS :: MacOS X", "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", + "Programming Language :: Python :: 3.13", "Programming Language :: Python :: Implementation :: CPython", "Typing :: Typed", ] keywords = ["sleep", "ecg", "qrs", "peak"] dependencies = [ - "numpy >= 1.25.0, < 3.0.0", - "PyYAML >= 5.4.0", - "requests >= 2.25.0", - "scipy >= 1.7.0", - "tqdm >= 4.60.0", + "numpy >= 1.26.0", + "pyyaml >= 6.0.0", + "requests >= 2.32.3", + "scipy >= 1.13.0", + "tqdm >= 4.66.0", ] dynamic = ["version"] [project.optional-dependencies] full = [ # complete package functionality - "edfio >= 0.4.0", - "joblib >= 1.0.0", - "matplotlib >= 3.5.0", - "numba >= 0.59.1", - "tensorflow >= 2.16.1", - "wfdb >= 3.4.0", + "edfio >= 0.4.4", + "joblib >= 1.4.2", + "matplotlib >= 3.9.2", + "numba >= 0.61.0", + "tensorflow >= 2.17.0; python_version < '3.13'", + "wfdb >= 4.2.0", ] dev = [ # everything needed for development @@ -51,21 +51,20 @@ dev = [ # everything needed for development "mypy >= 0.991", "pre-commit >= 2.13.0", "pytest >= 6.2.0", + "pytest-cov >= 6.0.0", "ruff >= 0.4.0", - "setuptools >= 56.0.0", + "setuptools >= 72.1.0", ] doc = [ # RTD uses this when building the documentation - "mkdocs-material >= 8.4.0", - "mkdocstrings-python >= 0.8.2", + "mkdocs-material >= 9.5.0", + "mkdocstrings-python >= 1.11.1", ] cibw = [ # cibuildwheel uses this for running the test suite - "edfio >= 0.4.0", - "numba >= 0.59.1", - "wfdb >= 3.4.0", - # https://github.com/MIT-LCP/wfdb-python/pull/511 - "numpy < 2.0.0", # TODO: just for wfdb! + "edfio >= 0.4.4", + "numba >= 0.61.0", + "wfdb >= 4.2.0", ] [project.urls] @@ -79,7 +78,7 @@ test-requires = "pytest" test-extras = "cibw" test-command = "pytest {package}" skip = 'pp* *musllinux*' -build = "cp39-*" # abi3 +build = "cp310-*" # abi3 [[tool.cibuildwheel.overrides]] select = "*" diff --git a/readthedocs.yml b/readthedocs.yml index 0b981bd..e850934 100644 --- a/readthedocs.yml +++ b/readthedocs.yml @@ -6,7 +6,7 @@ version: 2 build: os: ubuntu-22.04 tools: - python: "3.11" + python: "3.12" mkdocs: configuration: mkdocs.yml diff --git a/setup.py b/setup.py index 726be88..cc1760a 100644 --- a/setup.py +++ b/setup.py @@ -4,10 +4,9 @@ # Following https://github.com/joerick/python-abi3-package-sample - -# Currently set to 3.9. If this is bumped for example to 3.10, the hex -# in the Extension needs to change to 0x030A0000, and the cibuildwheel `build` -# selector needs to change in pyproject.toml +# Currently set to 3.10. If this is bumped for example to 3.11, the hex in the Extension +# needs to change to 0x030B0000, and the cibuildwheel `build` selector needs to change +# in pyproject.toml. class bdist_wheel_abi3(bdist_wheel): def get_tag(self) -> tuple: @@ -15,7 +14,7 @@ def get_tag(self) -> tuple: if python.startswith("cp"): # on CPython, our wheels are abi3 and compatible back to 3.6 - return "cp39", "abi3", plat + return "cp310", "abi3", plat return python, abi, plat @@ -26,7 +25,7 @@ def get_tag(self) -> tuple: "sleepecg._heartbeat_detection", ["src/sleepecg/_heartbeat_detection.c"], include_dirs=[np.get_include()], - define_macros=[("Py_LIMITED_API", "0x03090000")], + define_macros=[("Py_LIMITED_API", "0x030A0000")], py_limited_api=True, ), ], diff --git a/src/sleepecg/utils.py b/src/sleepecg/utils.py index c799836..5e36c71 100644 --- a/src/sleepecg/utils.py +++ b/src/sleepecg/utils.py @@ -6,9 +6,9 @@ import datetime import warnings -from collections.abc import Iterable +from collections.abc import Callable, Iterable from pathlib import Path -from typing import Any, Callable, TypeVar +from typing import Any, TypeVar import numpy as np diff --git a/tests/test_sleep_readers.py b/tests/test_sleep_readers.py index 972d2e6..d717bfb 100644 --- a/tests/test_sleep_readers.py +++ b/tests/test_sleep_readers.py @@ -68,7 +68,7 @@ def _dummy_nsrr_xml(filename: str, hours: float, random_state: int): start += epoch_duration xml_file.write( - "\n" "\n", + "\n\n", )