Skip to content

Improve tox usage documentation - #1088

Open
Czaki wants to merge 7 commits into
napari:mainfrom
Czaki:tox_doc
Open

Improve tox usage documentation#1088
Czaki wants to merge 7 commits into
napari:mainfrom
Czaki:tox_doc

Conversation

@Czaki

@Czaki Czaki commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

References and relevant issues

Depends on napari/napari#9368 (if we want a section about the coverage)

Description

Improve part of the documentation about the usage of tox for testing the napari.

Add details about

  • Running a subset of tests
  • Running minimum requirement test
  • Using constraints
  • Creating a debug environment

Plus some minor fixes in tox commands.

The documentation might be simplified if napari/napari#9270 is ended and merged.

@Czaki
Czaki requested a review from DragaDoncila July 27, 2026 07:57
@github-actions github-actions Bot added the documentation Improvements or additions to documentation label Jul 27, 2026

@brisvag brisvag left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Love this, thanks! Added some copy edit comments.

Comment thread docs/developers/contributing/testing.md Outdated
Comment thread docs/developers/contributing/testing.md Outdated
Comment thread docs/developers/contributing/testing.md Outdated
Comment thread docs/developers/contributing/testing.md Outdated
Comment thread docs/developers/contributing/testing.md Outdated
Comment thread docs/developers/contributing/testing.md Outdated
Comment thread docs/developers/contributing/testing.md Outdated
Comment thread docs/developers/contributing/testing.md Outdated
Comment thread docs/developers/contributing/testing.md Outdated
Comment thread docs/developers/contributing/testing.md Outdated
Co-authored-by: Lorenzo Gaifas <brisvag@gmail.com>

@willingc willingc left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Nice enhancements to the docs @Czaki.

@TimMonko, it may make sense to create pixi tasks that replicate the examples shared here for ease of local runs.

Comment thread docs/developers/contributing/testing.md Outdated
Comment thread docs/developers/contributing/testing.md Outdated
Comment thread docs/developers/contributing/testing.md Outdated
Comment thread docs/developers/contributing/testing.md Outdated
Comment thread docs/developers/contributing/testing.md Outdated
Comment thread docs/developers/contributing/testing.md Outdated
UV_CONSTRAINT=resources/constraints/constraints_py313.txt tox -e py313-pyqt6
```

Constraint usage guarantees the same version of dependencies as in the CI environment. It usually isn’t needed, but it sometimes happens that the newest version of some dependency is not compatible with the napari test suite, and it is useful to have a way to run tests with the same versions of dependencies as in the CI environment.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
Constraint usage guarantees the same version of dependencies as in the CI environment. It usually isn’t needed, but it sometimes happens that the newest version of some dependency is not compatible with the napari test suite, and it is useful to have a way to run tests with the same versions of dependencies as in the CI environment.
Constraint usage guarantees the same version of dependencies as in the CI environment where versions are specified down to the SHA commits of the dependencies.
While it usually isn’t needed to run this locally, running tests with the constraint file ensures that tests run with the exact same versions of dependencies as in napari's CI environment.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

It is not specified to SHA of commit but to version on PyPI.

Comment thread docs/developers/contributing/testing.md Outdated
Comment thread docs/developers/contributing/testing.md Outdated
TimMonko pushed a commit to napari/napari that referenced this pull request Aug 10, 2026
# References and relevant issues

required for napari/docs#1088

# Description

When I was doing #8367, I did not spot that fully removing of
`[tool.coverage.paths]` from `pyproject.toml` will make it hard to
generate a local coverage report when running tests using Tox.

This PR restores this option. 

On the other hand, no one reported this problem...
Co-authored-by: Carol Willing <carolcode@willingconsulting.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation hackathon:krakow-2026

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

4 participants