Skip to content

Commit

Permalink
Fix CI (#3364)
Browse files Browse the repository at this point in the history
  • Loading branch information
flying-sheep authored Nov 14, 2024
1 parent 0146f1a commit ac19bb3
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 10 deletions.
2 changes: 1 addition & 1 deletion ci/scripts/min-deps.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def min_dep(req: Requirement) -> Requirement:
-------
>>> min_dep(Requirement("numpy>=1.0"))
"numpy==1.0"
<Requirement('numpy==1.0.*')>
"""
req_name = req.name
if req.extras:
Expand Down
4 changes: 1 addition & 3 deletions ci/scripts/towncrier_automation.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,7 @@ def main(argv: Sequence[str] | None = None) -> None:
text=True,
check=True,
).stdout.strip()
pr_description = (
"" if base_branch == "main" else "@meeseeksmachine backport to main"
)
pr_description = "" if base_branch == "main" else "@meeseeksdev backport to main"
branch_name = f"release_notes_{args.version}"

# Create a new branch + commit
Expand Down
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ addopts = [
"-ptesting.scanpy._pytest",
"--pyargs",
]
testpaths = ["./tests", "scanpy"]
testpaths = ["./tests", "./ci", "scanpy"]
norecursedirs = ["tests/_images"]
xfail_strict = true
nunit_attach_on = "fail"
Expand Down Expand Up @@ -211,7 +211,7 @@ exclude_also = [
"if __name__ == .__main__.:",
"if TYPE_CHECKING:",
# https://github.com/numba/numba/issues/4268
"@numba.njit.*",
'@(numba\.|nb\.)njit.*',
]

[tool.ruff]
Expand Down
13 changes: 9 additions & 4 deletions tests/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,10 @@
import numpy as np
import pytest
from anndata.tests.helpers import asarray
from packaging.version import Version
from scipy.sparse import csr_matrix, issparse

from scanpy._compat import DaskArray
from scanpy._compat import DaskArray, pkg_version
from scanpy._utils import (
axis_mul_or_truediv,
axis_sum,
Expand Down Expand Up @@ -225,11 +226,15 @@ def test_is_constant(array_type):
],
)
@pytest.mark.parametrize("block_type", [np.array, csr_matrix])
def test_is_constant_dask(axis, expected, block_type):
def test_is_constant_dask(request: pytest.FixtureRequest, axis, expected, block_type):
import dask.array as da

if (axis is None) and block_type is csr_matrix:
pytest.skip("Dask has weak support for scipy sparse matrices")
if block_type is csr_matrix and (
axis is None or pkg_version("dask") < Version("2023.2.0")
):
reason = "Dask has weak support for scipy sparse matrices"
# This test is flaky for old dask versions, but when `axis=None` it reliably fails
request.applymarker(pytest.mark.xfail(reason=reason, strict=axis is None))

x_data = [
[0, 0, 1, 1],
Expand Down

0 comments on commit ac19bb3

Please sign in to comment.