Skip to content

Commit

Permalink
Backport PR #1373: Test against and list support for python 3.12 (#1377)
Browse files Browse the repository at this point in the history
Co-authored-by: Isaac Virshup <[email protected]>
  • Loading branch information
meeseeksmachine and ivirshup authored Feb 16, 2024
1 parent 0a23e3c commit 8279ca6
Show file tree
Hide file tree
Showing 7 changed files with 37 additions and 11 deletions.
10 changes: 5 additions & 5 deletions .azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@ jobs:
vmImage: "ubuntu-22.04"
strategy:
matrix:
Python3.11:
python.version: "3.11"
Python3.12:
python.version: "3.12"
RUN_COVERAGE: yes
TEST_TYPE: "coverage"
Python3.9:
python.version: "3.9"
PreRelease:
python.version: "3.11"
python.version: "3.12"
DEPENDENCIES_VERSION: "pre-release"
TEST_TYPE: "strict-warning"
minimum_versions:
Expand Down Expand Up @@ -105,8 +105,8 @@ jobs:
steps:
- task: UsePythonVersion@0
inputs:
versionSpec: "3.11"
displayName: "Use Python 3.11"
versionSpec: "3.12"
displayName: "Use Python 3.12"

- script: |
python -m pip install --upgrade pip
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/benchmark.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python: ["3.11"]
python: ["3.12"]
os: [ubuntu-latest]

env:
Expand Down
2 changes: 1 addition & 1 deletion .readthedocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ version: 2
build:
os: ubuntu-20.04
tools:
python: "3.11"
python: "3.12"
sphinx:
configuration: docs/conf.py
fail_on_warning: true # do not change or you will be fired
Expand Down
7 changes: 6 additions & 1 deletion anndata/tests/test_layers.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,12 @@ def test_readwrite_loom(tmp_path):
adata = AnnData(X=X, layers=dict(L=L.copy()))

with warnings.catch_warnings():
warnings.simplefilter("ignore", NumbaDeprecationWarning)
warnings.filterwarnings("ignore", category=NumbaDeprecationWarning)
warnings.filterwarnings(
"ignore",
message=r"datetime.datetime.utcnow\(\) is deprecated",
category=DeprecationWarning,
)
adata.write_loom(loom_path)
adata_read = read_loom(loom_path, X_name="")

Expand Down
25 changes: 22 additions & 3 deletions anndata/tests/test_readwrite.py
Original file line number Diff line number Diff line change
Expand Up @@ -392,7 +392,12 @@ def test_readwrite_loom(typ, obsm_mapping, varm_mapping, tmp_path):
adata_src.varm["X_b"] = np.zeros((adata_src.n_vars, 3))

with warnings.catch_warnings():
warnings.simplefilter("ignore", NumbaDeprecationWarning)
warnings.filterwarnings("ignore", category=NumbaDeprecationWarning)
warnings.filterwarnings(
"ignore",
message=r"datetime.datetime.utcnow\(\) is deprecated",
category=DeprecationWarning,
)
adata_src.write_loom(tmp_path / "test.loom", write_obsm_varm=True)

adata = ad.read_loom(
Expand Down Expand Up @@ -427,7 +432,15 @@ def test_readwrite_loom(typ, obsm_mapping, varm_mapping, tmp_path):
def test_readloom_deprecations(tmp_path):
loom_pth = tmp_path / "test.loom"
adata_src = gen_adata((5, 10), obsm_types=[np.ndarray], varm_types=[np.ndarray])
adata_src.write_loom(loom_pth, write_obsm_varm=True)

with warnings.catch_warnings():
warnings.filterwarnings("ignore", category=NumbaDeprecationWarning)
warnings.filterwarnings(
"ignore",
message=r"datetime.datetime.utcnow\(\) is deprecated",
category=DeprecationWarning,
)
adata_src.write_loom(loom_pth, write_obsm_varm=True)

# obsm_names -> obsm_mapping
obsm_mapping = {"df": adata_src.obs.columns}
Expand Down Expand Up @@ -536,7 +549,13 @@ def test_readwrite_empty(read, write, name, tmp_path):


def test_read_excel():
adata = ad.read_excel(HERE / "data/excel.xlsx", "Sheet1", dtype=int)
with warnings.catch_warnings():
warnings.filterwarnings(
"ignore",
message=r"datetime.datetime.utcnow\(\) is deprecated",
category=DeprecationWarning,
)
adata = ad.read_excel(HERE / "data/excel.xlsx", "Sheet1", dtype=int)
assert adata.X.tolist() == X_list


Expand Down
1 change: 1 addition & 0 deletions docs/release-notes/0.10.6.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,4 @@
```

* `anndata`'s CI now tests against minimum versions of it's dependencies. As a result, several dependencies had their minimum required version bumped. See diff for details {pr}`1314` {user}`ivirshup`
* `anndata` now tests against Python 3.12 {pr}`1373` {user}`ivirshup`
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ classifiers = [
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Topic :: Scientific/Engineering :: Bio-Informatics",
"Topic :: Scientific/Engineering :: Visualization",
]
Expand Down

0 comments on commit 8279ca6

Please sign in to comment.