Skip to content

Make tox factor usage more extensible#1384

Open
sirosen wants to merge 1 commit intoglobus:mainfrom
sirosen:refactor-tox-envs
Open

Make tox factor usage more extensible#1384
sirosen wants to merge 1 commit intoglobus:mainfrom
sirosen:refactor-tox-envs

Conversation

@sirosen
Copy link
Copy Markdown
Member

@sirosen sirosen commented May 4, 2026

Previously, the test environments were binary flagged between mindeps
and !mindeps. This is unfortunately bad for adding additional factors,
as discovered when testing orjson as a factor. Because tox does not
allow negative factors to be layered with "OR" semantics, it becomes
difficult to deselect the locked requirements in test.txt in order
to replace them.

The base testenv is simplified to have unconditional dependencies, and
factor-based dependency selection is done in descendant envs which can
therefore fully replace the deps declared by the base env.

The change in configuration also provides an opportunity to refactor the
depends declaration into the list form which makes it inheritable.

Previously, the test environments were binary flagged between `mindeps`
and `!mindeps`. This is unfortunately bad for adding additional factors,
as discovered when testing `orjson` as a factor. Because `tox` does not
allow negative factors to be layered with "OR" semantics, it becomes
difficult to deselect the locked requirements in `test.txt` in order
to replace them.

The base testenv is simplified to have unconditional dependencies, and
factor-based dependency selection is done in descendant envs which can
therefore fully replace the deps declared by the base env.

The change in configuration also provides an opportunity to refactor the
`depends` declaration into the list form which makes it inheritable.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

no-news-is-good-news This change does not require a news file

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant