From 63c7ba8d00f21970e2970e6f4a7e8c63c36d9685 Mon Sep 17 00:00:00 2001 From: Ryan Williams Date: Mon, 23 Sep 2024 16:04:54 -0400 Subject: [PATCH] drop Python 3.8 support (#224) --- .github/workflows/python-somacore.yaml | 4 ++-- pyproject.toml | 6 +++--- python-spec/requirements-py3.8-lint.txt | 3 --- python-spec/requirements-py3.8.txt | 19 ------------------- python-spec/requirements-py3.9-lint.txt | 3 +++ python-spec/src/somacore/coordinates.py | 3 +-- python-spec/update-requirements-txt | 4 ++-- 7 files changed, 11 insertions(+), 31 deletions(-) delete mode 100644 python-spec/requirements-py3.8-lint.txt delete mode 100644 python-spec/requirements-py3.8.txt create mode 100644 python-spec/requirements-py3.9-lint.txt diff --git a/.github/workflows/python-somacore.yaml b/.github/workflows/python-somacore.yaml index b6611425..a23d6773 100644 --- a/.github/workflows/python-somacore.yaml +++ b/.github/workflows/python-somacore.yaml @@ -12,7 +12,7 @@ jobs: format-check: runs-on: ubuntu-latest env: - PYTHON_VERSION: "3.8" + PYTHON_VERSION: "3.9" steps: - uses: actions/checkout@v3 @@ -45,7 +45,7 @@ jobs: strategy: fail-fast: false matrix: - python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] + python-version: ["3.9", "3.10", "3.11", "3.12"] steps: - uses: actions/checkout@v4 with: diff --git a/pyproject.toml b/pyproject.toml index 1cf68cc6..63c415fa 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -24,7 +24,7 @@ dependencies = [ "scipy", "typing-extensions>=4.1", # For LiteralString (py3.11) ] -requires-python = "~=3.8" +requires-python = ">=3.9" urls = { repository = "https://github.com/single-cell-data/SOMA.git" } classifiers = ["License :: OSI Approved :: MIT License"] @@ -43,7 +43,7 @@ tag_regex = '^python-(?P[vV]?\d+(?:\.\d+){0,2}[^\+]*)(?:\+.*)?$' [tool.ruff] lint.extend-select = ["I"] -target-version = "py38" +target-version = "py39" [tool.ruff.lint.isort] force-single-line = true @@ -54,7 +54,7 @@ single-line-exclusions = ["typing", "typing_extensions"] check_untyped_defs = true enable_error_code = ["ignore-without-code"] warn_redundant_casts = true -python_version = 3.8 +python_version = 3.9 # We want to enable this but it won't work when running locally due to the # presence of _version.py (which invalidates the ignore, which causes an error). # diff --git a/python-spec/requirements-py3.8-lint.txt b/python-spec/requirements-py3.8-lint.txt deleted file mode 100644 index 5b1ec208..00000000 --- a/python-spec/requirements-py3.8-lint.txt +++ /dev/null @@ -1,3 +0,0 @@ -mypy==1.11.2 -pandas-stubs==2.0.3.230814 # last version that supports Python 3.8 -pre-commit==3.5.0 diff --git a/python-spec/requirements-py3.8.txt b/python-spec/requirements-py3.8.txt deleted file mode 100644 index 7da2b9f5..00000000 --- a/python-spec/requirements-py3.8.txt +++ /dev/null @@ -1,19 +0,0 @@ -anndata==0.9.2 -attrs==23.2.0 -h5py==3.11.0 -importlib_metadata==7.1.0 -llvmlite==0.41.1 -natsort==8.4.0 -numba==0.58.1 -numpy==1.24.4 -packaging==24.1 -pandas==2.0.3 -pyarrow==16.1.0 -pyarrow-hotfix==0.6 -python-dateutil==2.9.0.post0 -pytz==2024.1 -scipy==1.10.1 -six==1.16.0 -typing_extensions==4.12.2 -tzdata==2024.1 -zipp==3.19.2 diff --git a/python-spec/requirements-py3.9-lint.txt b/python-spec/requirements-py3.9-lint.txt new file mode 100644 index 00000000..aef1a068 --- /dev/null +++ b/python-spec/requirements-py3.9-lint.txt @@ -0,0 +1,3 @@ +mypy==1.11.2 +pandas-stubs==2.2.2.240807 # last version which supports Python 3.9 +pre-commit==3.8.0 diff --git a/python-spec/src/somacore/coordinates.py b/python-spec/src/somacore/coordinates.py index 727dac3d..83555e88 100644 --- a/python-spec/src/somacore/coordinates.py +++ b/python-spec/src/somacore/coordinates.py @@ -35,8 +35,7 @@ class CoordinateSpace(collections.abc.Sequence): Lifecycle: experimental """ - # Change to Sequence[Axis] after 3.8 is dropped. - axes: Tuple[Axis, ...] = attrs.field(converter=tuple) + axes: Sequence[Axis] = attrs.field(converter=tuple) @axes.validator def _validate(self, _, axes: Tuple[Axis, ...]) -> None: diff --git a/python-spec/update-requirements-txt b/python-spec/update-requirements-txt index 172bee02..42f9b88a 100755 --- a/python-spec/update-requirements-txt +++ b/python-spec/update-requirements-txt @@ -10,9 +10,9 @@ TEMPDIR="$(mktemp -d)" trap "trash $TEMPDIR" EXIT # The version of Python we want to run lints under. -LINTVER=3.8 +LINTVER=3.9 -for PYVER in 3.8 3.9 3.10 3.11 3.12; do +for PYVER in 3.9 3.10 3.11 3.12; do CONDIR="$TEMPDIR/py-$PYVER" conda create -y -p "$CONDIR" "python=$PYVER" (