Skip to content

(chore): derive CI matrix from hatch env#1998

Merged
ilan-gold merged 8 commits intomainfrom
ig/derive-matrix
May 28, 2025
Merged

(chore): derive CI matrix from hatch env#1998
ilan-gold merged 8 commits intomainfrom
ig/derive-matrix

Conversation

@ilan-gold
Copy link
Copy Markdown
Contributor

@ilan-gold ilan-gold added this to the 0.11.5 milestone May 27, 2025
@codecov
Copy link
Copy Markdown

codecov bot commented May 27, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 85.07%. Comparing base (2e9cfca) to head (a618a86).
⚠️ Report is 39 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1998      +/-   ##
==========================================
- Coverage   87.10%   85.07%   -2.03%     
==========================================
  Files          46       46              
  Lines        6949     6949              
==========================================
- Hits         6053     5912     -141     
- Misses        896     1037     +141     

see 7 files with indirect coverage changes

@flying-sheep
Copy link
Copy Markdown
Member

flying-sheep commented May 28, 2025

Ah, I just realized: Since we do

hatch run ${{ matrix.env.name }}:run

Instead of hatch test, hatch won’t do its CLI argument processing, so --randomize and --parallel don’t exist, and the normal defaults of the plugins apply.

E.g. when we do hatch test without --randomize, hatch passes -p no:randomly to the CLI to disable the plugin. Doing hatch run hatch-test.*:run means that we’re already using the plugin in scanpy (and this PR).

@ilan-gold
Copy link
Copy Markdown
Contributor Author

Doing hatch run hatch-test.*:run means that we’re already using the plugin in scanpy (and this PR).

Why did I have to add the PYTEST_ADDOPTS then?

@ilan-gold
Copy link
Copy Markdown
Contributor Author

I don't think we need an equivalent of scverse/scanpy#3607 (comment) here. If the case arises where we have non-experimental extras, then we can revisit. But xarray is both experimental and likely to be removed in the enxt released in a standalone package. I foresee a scenario where we support array libraries in the future, but in that case I would just make a new arr-full section or similar.

@ilan-gold ilan-gold marked this pull request as ready for review May 28, 2025 14:43
@ilan-gold
Copy link
Copy Markdown
Contributor Author

Re: testing for coverage, I would be in favor of doing it for each type here. pre, min, and stable could in theory have three different behaviors (unlikely) in which case we would want full coverage.

@ilan-gold ilan-gold requested a review from flying-sheep May 28, 2025 14:45
@flying-sheep
Copy link
Copy Markdown
Member

flying-sheep commented May 28, 2025

sure, why not! would make things simpler too. The reason we had it this way is as you said; it’s very unlikely to have three branches.

/edit: done

Why did I have to add the PYTEST_ADDOPTS then?

because while we have a coverage and non-coverage version of the test step, they both had shared options: -n auto --junitxml=... and so on

I don't think we need [a minimal extra features job]

OK. I think then the min, stable, and pre triad also makes sense as names, as min is not ambiguous between “few/no extra features” and “resolve to lowest possible dependency versions”.

Copy link
Copy Markdown
Member

@flying-sheep flying-sheep left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good, but why are the tests so slow? (that’s not new, I just saw it now)

before you merge, please edit the rules in https://github.com/scverse/anndata/settings/rules

  1. In both rulesets (version branch and default branch)
  2. go to “Require status checks to pass” → “Show additional settings” → “Status checks that are required”
  3. remove all pytest (…) entries
  4. remove the check-build entry
  5. add the check entry instead
  6. save
  7. refresh this PR page to see that you can now merge with a green button

grafik

@ilan-gold
Copy link
Copy Markdown
Contributor Author

ilan-gold commented May 28, 2025

looks good, but why are the tests so slow? (that’s not new, I just saw it now)

I would assume it's the xarray tests + zarr v3/v2 both being tested, both of which ballooned the tests here by quite a bit. Another reason to remove the xarray part of the codebase. I can also look into perhaps doing some more reuse of fixtures or cutting down on number of tests.

@ilan-gold ilan-gold merged commit 0bce929 into main May 28, 2025
15 checks passed
@ilan-gold ilan-gold deleted the ig/derive-matrix branch May 28, 2025 15:33
@scverse scverse deleted a comment from lumberbot-app bot May 28, 2025

- name: Run Pytest (treat warnings as errors)
if: matrix.test-type == 'strict-warning'
run: pytest --strict-warnings -n auto
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oof, this should have stayed in.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants