diff --git a/.github/workflows/run_tests.yml b/.github/workflows/run_tests.yml index fcd071c..b1e2e13 100644 --- a/.github/workflows/run_tests.yml +++ b/.github/workflows/run_tests.yml @@ -27,15 +27,16 @@ jobs: fail-fast: false matrix: config: + - { name: "3.12", os: ubuntu-latest, python: "3.12", r: release } - { name: "3.11", os: ubuntu-latest, python: "3.11", r: release } - { name: "3.10", os: ubuntu-latest, python: "3.10", r: release } - - { name: "3.9", os: ubuntu-latest, python: "3.9", r: release } - - { name: "3.8", os: ubuntu-latest, python: "3.8", r: oldrel } + - { name: "3.9", os: ubuntu-latest, python: "3.9", r: oldrel } steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: fetch-depth: 0 + filter: blob:none - name: Install system dependencies if: runner.os == 'Linux' @@ -72,6 +73,8 @@ jobs: packages: | bioc::SingleCellExperiment bioc::scRNAseq + bioc::BiocFileCache@2.10.1 + # BiocFileCache because of https://github.com/Bioconductor/AnnotationHub/issues/46 - name: Install anndata2ri run: | diff --git a/pyproject.toml b/pyproject.toml index 134eaa8..752723c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -17,7 +17,7 @@ urls.'Documentation' = 'https://icb-anndata2ri.readthedocs-hosted.com/' urls.'Source Code' = 'https://github.com/theislab/anndata2ri' urls.'Issue Tracker' = 'https://github.com/theislab/anndata2ri/issues?q=is%3Aissue+is%3Aopen+sort%3Aupdated-desc' dynamic = ['version'] -requires-python = '>= 3.8' +requires-python = '>= 3.9' dependencies = [ 'rpy2 >= 3.5.2', # first with get_conversion 'tzlocal', # for pandas2ri @@ -36,7 +36,6 @@ doc = [ 'sphinx>=3.0', 'scanpydoc[theme,typehints]', 'lxml', # For scraping the R link info - 'importlib_resources; python_version < "3.9"', ] [tool.hatch.version] @@ -52,7 +51,7 @@ features = ['doc'] build = 'sphinx-build -M html docs docs/_build' [[tool.hatch.envs.test.matrix]] -python = ['3.8', '3.9', '3.10', '3.11'] +python = ['3.9', '3.10', '3.11', '3.12'] [tool.hatch.envs.test] features = ['test'] [tool.hatch.envs.test.scripts] diff --git a/src/anndata2ri/scipy2ri/_py2r.py b/src/anndata2ri/scipy2ri/_py2r.py index 551299a..c456305 100644 --- a/src/anndata2ri/scipy2ri/_py2r.py +++ b/src/anndata2ri/scipy2ri/_py2r.py @@ -1,14 +1,9 @@ from __future__ import annotations from functools import lru_cache, wraps +from importlib.resources import files from typing import TYPE_CHECKING - -try: - from importlib.resources import files -except ImportError: # Python < 3.9 - from importlib_resources import files - import numpy as np from rpy2.robjects import default_converter, numpy2ri from rpy2.robjects.conversion import localconverter diff --git a/src/anndata2ri/scipy2ri/_support.py b/src/anndata2ri/scipy2ri/_support.py index 75fb1b0..5460194 100644 --- a/src/anndata2ri/scipy2ri/_support.py +++ b/src/anndata2ri/scipy2ri/_support.py @@ -1,6 +1,6 @@ from __future__ import annotations -from functools import lru_cache +from functools import cache from typing import TYPE_CHECKING, Literal, get_args @@ -15,7 +15,7 @@ supported_r_matrix_storage: frozenset[SupportedMatStor] = frozenset(get_args(SupportedMatStor)) -@lru_cache(maxsize=None) +@cache def supported_r_matrix_classes( types: Iterable[SupportedMatType] | SupportedMatType = supported_r_matrix_types, storage: Iterable[SupportedMatStor] | SupportedMatStor = supported_r_matrix_storage,