Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,8 @@ If you don't, our test suite will fail because we use Git tags for packaging.

Finally, **clone** your fork using one of the alternatives that you can copy-paste by pressing the big green button labeled `<> Code`.

You can (and should) run our test suite using [*tox*](https://tox.wiki/) with the [*tox-uv*](https://github.com/tox-dev/tox-uv) plugin.
The easiest way is to [install *uv*] which is needed in any case and then run `uv tool install --with tox-uv tox` to have it globally available or `uvx --with tox-uv tox` to use a temporary environment.
You can (and should) run our full test suite using [*tox*](https://tox.wiki/).
It's part of our development environment, so `uv run tox` works out of the box once you've [installed *uv*][install *uv*].

---

Expand Down Expand Up @@ -118,23 +118,23 @@ $ git fetch upstream --tags
When working on the documentation, use:

```console
$ tox run -e docs-watch
$ uv run tox run -e docs-watch
```

This will build the documentation, watch for changes, and rebuild it whenever you save a file.

To just build the documentation and exit immediately use:

```console
$ tox run -e docs-build
$ uv run tox run -e docs-build
```

You will find the built documentation in `docs/_build/html`.

To run doctests:

```console
$ tox run -e docs-doctests
$ uv run tox run -e docs-doctests
```


Expand All @@ -159,7 +159,7 @@ $ tox run -e docs-doctests
assert "foo" == x._a_private_attribute
```

- You can run the test suite with all dependencies against all supported Python versions - just as it will in our CI - by running `tox`.
- You can run the test suite with all dependencies against all supported Python versions - just as it will in our CI - by running `uv run tox`.

- Write [good test docstrings](https://jml.io/test-docstrings/).

Expand Down Expand Up @@ -272,7 +272,7 @@ If you want to reference multiple issues, copy the news fragment to another file
Towncrier will merge all news fragments with identical contents into one entry with multiple links to the respective pull requests.


`tox run -e changelog` will render the current changelog to the terminal if you have any doubts.
`uv run tox run -e changelog` will render the current changelog to the terminal if you have any doubts.


## Governance
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/build-docset.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,9 @@ jobs:
python-version: "3.x"
- uses: hynek/setup-cached-uv@34e35d30f1ebc7421a5cc733bca38dcc62603960 # v2.6.0

- run: uvx --with=tox-uv tox run -e docset
- run: >
uv run --only-group tox
tox run -e docset

- uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
Expand Down
19 changes: 11 additions & 8 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,15 +67,15 @@ jobs:
- uses: hynek/setup-cached-uv@34e35d30f1ebc7421a5cc733bca38dcc62603960 # v2.6.0

- run: >
uvx --with=tox-uv
uv run --only-group tox
tox run
-e $PYTHON-mypy

- name: Remove src to ensure tests run against wheel
run: rm -rf src

- run: >
uvx --with=tox-uv
uv run --only-group tox
tox run
--installpkg dist/*.whl
-e $PYTHON-tests
Expand Down Expand Up @@ -114,7 +114,7 @@ jobs:
env:
PYTHON: ${{ matrix.python-version }}
run: >
uvx --with=tox-uv
uv run --only-group tox
tox run
--installpkg dist/*.whl
-e $(echo $PYTHON | tr -d -)-tests
Expand Down Expand Up @@ -172,7 +172,9 @@ jobs:
- run: tar xf dist/*.tar.gz --strip-components=1
- uses: hynek/setup-cached-uv@34e35d30f1ebc7421a5cc733bca38dcc62603960 # v2.6.0

- run: uvx --with=tox-uv tox run -e docs-doctests,changelog
- run: >
uv run --only-group tox
tox run -e docs-doctests,changelog

lint:
name: Run linters
Expand All @@ -184,8 +186,7 @@ jobs:
- uses: hynek/setup-cached-uv@34e35d30f1ebc7421a5cc733bca38dcc62603960 # v2.6.0

- run: >
uvx --with=tox-uv
--python $(cat .python-version-default)
uv run --only-group tox
tox run -f lint

typing:
Expand All @@ -195,11 +196,13 @@ jobs:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
with:
python-version-file: .python-version-default
- uses: hynek/setup-cached-uv@34e35d30f1ebc7421a5cc733bca38dcc62603960 # v2.6.0

- run: >
uvx --with=tox-uv
--python $(cat .python-version-default)
uv run --only-group tox
tox run -f typing

install-dev:
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/codspeed.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,9 @@ jobs:
uses: CodSpeedHQ/action@88472375d0a4572cf70a9f1fe3a4e0ab8da1b924 # v5.0.1
with:
mode: simulation
run: uvx --with tox-uv tox run -e codspeed
run: >
uv run --only-group tox
tox run -e codspeed

imports:
name: Measure import times
Expand Down
2 changes: 2 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ benchmark = [
"pytest-codspeed",
"pytest-xdist[psutil]",
]
tox = ["tox>4", "tox-uv-bare"]
docs = [
"cogapp",
"furo",
Expand All @@ -73,6 +74,7 @@ docs = [
]
docs-watch = [{ include-group = "docs" }, "watchfiles"]
dev = [
{ include-group = "tox" },
{ include-group = "tests" },
{ include-group = "lint" },
{ include-group = "pyrefly" },
Expand Down
9 changes: 7 additions & 2 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
[tox]
requires =

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.

This looks like a use case for having tox to implement referencing this section from dep groups to dedupe the list..

cc @gaborbernat

@hynek hynek Aug 3, 2026

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

In this case it’s more of a belts-and-suspenders thing since we always run tox using uv. Maybe should be removed to fail loudly? Idk

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.

Well, my understanding is that this is for people that have tox as a primary pre-existing entry-point (and not uv) — tox then makes a managed venv under .tox/.tox/ and installs all the goodies + a newer version of itself. So to me this sounds like a more logical hook point for sticking automatic provisioning. I'm wondering, though, if tox's API allows plugins to extend this list — this would make for a powerful mechanism of setting up centralized ecosystem-centric infras.

I think this might also be in use by downstreams. But we'd have to ask @hroncok @befeleme @encukou @mgorny etc.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

The Fedora use case is verifying if things work in a given pre-existing environment (without PyPI wheels & without internet access). tox doesn't make a venv; instead a plugin checks if dependencies are installed. If any are missing it reports them, and gets re-run in a container that includes them.

For that, it doesn't really matter if uv gets installed, as long as it doesn't try downloading/provisioning anything :)

Anyway, removing tox.requires seems OK.

tox>=4.51.0
tox-uv
tox-uv-bare

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.

Wait, what? Is it published under two names now? 🤔

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Bare doesn’t install uv as a dependency

env_list =
lint-{ruff,pre-commit},
3.1{0-5}-tests,
Expand Down Expand Up @@ -98,14 +98,16 @@ commands =
docs

[testenv:docs-sponsors]
description = Ensure sponsor logos are up to date.
runner = uv-venv-runner
base_python_file = .python-version-default
package = skip
description = Ensure sponsor logos are up to date.
deps = cogapp
commands = cog -rP README.md docs/index.md


[testenv:lint-{ruff,pre-commit}]
base_python_file = .python-version-default
dependency_groups = lint
package = skip
commands =
Expand All @@ -124,16 +126,19 @@ commands =

[testenv:typing-pyright]
dependency_groups = pyright
base_python_file = .python-version-default
commands =
pyright
pytest tests/test_pyright.py -vv

[testenv:typing-ty]
dependency_groups = ty
base_python_file = .python-version-default
commands = ty check typing_tests/baseline.py

[testenv:typing-pyrefly]
dependency_groups = pyrefly
base_python_file = .python-version-default
commands = pyrefly check


Expand Down
Loading