diff --git a/.github/workflows/python-somacore.yaml b/.github/workflows/python-somacore.yaml index f27d6c70..ee3d982f 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 @@ -20,11 +20,11 @@ jobs: with: python-version: ${{ env.PYTHON_VERSION }} cache: pip - cache-dependency-path: python-spec/requirements-py${{ env.PYTHON_VERSION }}-lint.txt + cache-dependency-path: "python-spec/requirements-py${{ env.PYTHON_VERSION }}*.txt" - name: Install static analysis packages - run: | - pip install -r python-spec/requirements-py${{ env.PYTHON_VERSION }}-lint.txt + working-directory: python-spec + run: pip install -r requirements-py${PYTHON_VERSION}.txt -r requirements-py${PYTHON_VERSION}-lint.txt - name: Restore pre-commit cache uses: actions/cache@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@v3 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 62af1603..00000000 --- a/python-spec/requirements-py3.8-lint.txt +++ /dev/null @@ -1,38 +0,0 @@ -anndata==0.9.2 -attrs==23.2.0 -black==24.4.2 -cfgv==3.4.0 -click==8.1.7 -distlib==0.3.8 -filelock==3.15.1 -h5py==3.11.0 -identify==2.5.36 -importlib_metadata==7.1.0 -isort==5.13.2 -llvmlite==0.41.1 -mypy==1.10.0 -mypy-extensions==1.0.0 -natsort==8.4.0 -nodeenv==1.9.1 -numba==0.58.1 -numpy==1.24.4 -packaging==24.1 -pandas==2.0.3 -pandas-stubs==2.0.3.230814 -pathspec==0.12.1 -platformdirs==4.2.2 -pre-commit==3.5.0 -pyarrow==16.1.0 -pyarrow-hotfix==0.6 -python-dateutil==2.9.0.post0 -pytz==2024.1 -PyYAML==6.0.1 -ruff==0.4.9 -scipy==1.10.1 -six==1.16.0 -tomli==2.0.1 -types-pytz==2024.1.0.20240417 -typing_extensions==4.12.2 -tzdata==2024.1 -virtualenv==20.26.2 -zipp==3.19.2 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 986ed83e..83555e88 100644 --- a/python-spec/src/somacore/coordinates.py +++ b/python-spec/src/somacore/coordinates.py @@ -26,9 +26,7 @@ class Axis: @attrs.define(frozen=True) -class CoordinateSpace( - collections.abc.Sequence -): # Change to Sequence[Axis] after 3.8 is dropped. +class CoordinateSpace(collections.abc.Sequence): """A coordinate space for spatial data. Args: @@ -37,7 +35,7 @@ class CoordinateSpace( Lifecycle: experimental """ - 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" (