Skip to content

Add hatch matrix - #368

Closed
Zethson wants to merge 4 commits into
mainfrom
fix/hatch_matrix
Closed

Zethson wants to merge 4 commits into
mainfrom
fix/hatch_matrix

Conversation

@Zethson

@Zethson Zethson commented Mar 18, 2025

Copy link
Copy Markdown
Member

Fixes #338

I am not sure whether we want to do this because users would have to take care of this as well and update it in addition to Github Actions workflows etc.

The default behavior is somewhat sane in my opinion where it:

If no environment options are selected, the test command will only run tests in the first defined environment that either already exists or is compatible. Additionally, the checking order will prioritize environments that define a version of Python that matches the interpreter that Hatch is running on.

https://hatch.pypa.io/1.13/tutorials/testing/overview/

@flying-sheep what is your opinion?

@github-actions

Copy link
Copy Markdown

A PR has been generated to the instance repo:
scverse/cookiecutter-scverse-instance#180

You can check out the PR to preview your changes
in an instance of the cookiecutter template. The PR will be kept in sync with
this PR automatically.

@grst grst mentioned this pull request Mar 19, 2025
@flying-sheep

Copy link
Copy Markdown
Member

This does nothing, see #338

@grst

grst commented Mar 20, 2025

Copy link
Copy Markdown
Collaborator

So what's the recommended way then to use hatch to test against multiple python versions?

@flying-sheep

Copy link
Copy Markdown
Member

#338 (comment)

[we are not missing a matrix definition since] the default one exists and I think it works fine

rely on the default matrix, as explained in our docs: https://cookiecutter-scverse-instance.readthedocs.io/en/latest/contributing.html#writing-tests

Alternatively, you can run all tests from the command line by executing

hatch test --all  # test with all supported Python versions

I guess we could add a link explaining hatch test -py 3.11.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

pyproject.toml missing hatch matrix definition

3 participants