Skip to content

prevent machine ISA from overriding explicit env factors#3904

Merged
rahuldevikar merged 4 commits intotox-dev:mainfrom
rahuldevikar:fix/machine-isa-factor-conflict
Mar 27, 2026
Merged

prevent machine ISA from overriding explicit env factors#3904
rahuldevikar merged 4 commits intotox-dev:mainfrom
rahuldevikar:fix/machine-isa-factor-conflict

Conversation

@rahuldevikar
Copy link
Copy Markdown
Collaborator

@rahuldevikar rahuldevikar commented Mar 26, 2026

  • Machine ISA (e.g., arm64 from sysconfig.get_platform()) is no longer unconditionally added as an implicit factor, preventing it from conflicting with explicit ISA factors in the env name
  • When the env name contains an explicit ISA (e.g., py39-x86_64), only that ISA's factor conditions match — the machine's ISA is excluded
  • When no env factor conflicts (e.g., env is just py39), the machine ISA still works as an implicit factor
  • Fix applied to both INI (filter_for_env) and TOML (_replace_if_toml) config paths

Fixes: #3903

  • ran the linter to address style issues (tox -e fix)
  • wrote descriptive pull request text
  • ensured there are test(s) validating the fix
  • added news fragment in docs/changelog folder
  • updated/extended the documentation

@rahuldevikar rahuldevikar force-pushed the fix/machine-isa-factor-conflict branch 2 times, most recently from 3a12d0a to 1bb561a Compare March 26, 2026 05:09
@rahuldevikar rahuldevikar force-pushed the fix/machine-isa-factor-conflict branch from 1bb561a to ffbe462 Compare March 26, 2026 17:11
LATEST_PYTHON_MINOR_MIN: int = 10
LATEST_PYTHON_MINOR_MAX: int = 14

_KNOWN_ARCHITECTURES: frozenset[str] = frozenset({
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.

can we load this from py-discovery rather than duplicating here?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Ahh, good point. That's better. Let me fix

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

I added python-discovery to tox. Let me know if it's not okay.

@rahuldevikar rahuldevikar marked this pull request as ready for review March 27, 2026 04:16
@rahuldevikar rahuldevikar merged commit 451aa9c into tox-dev:main Mar 27, 2026
27 checks passed
@griels
Copy link
Copy Markdown

griels commented Mar 27, 2026

Thanks!

gaborbernat pushed a commit to gaborbernat/tox that referenced this pull request Mar 30, 2026
- Machine ISA (e.g., arm64 from sysconfig.get_platform()) is no longer
unconditionally added as an implicit factor, preventing it from
conflicting with explicit ISA factors in the env name
- When the env name contains an explicit ISA (e.g., py39-x86_64), only
that ISA's factor conditions match — the machine's ISA is excluded
- When no env factor conflicts (e.g., env is just py39), the machine ISA
still works as an implicit factor
- Fix applied to both INI (filter_for_env) and TOML (_replace_if_toml)
config paths

<!-- Thank you for your contribution!

Please, make sure you address all the checklists (for details on how see
[development
documentation](http://tox.readthedocs.org/en/latest/development.html#development))!
-->

- [ ] ran the linter to address style issues (`tox -e fix`)
- [ ] wrote descriptive pull request text
- [ ] ensured there are test(s) validating the fix
- [ ] added news fragment in `docs/changelog` folder
- [ ] updated/extended the documentation

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
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.

Multiline factors broken again in tox>=4.46.0 #3902

3 participants