Add architecture (ISA) awareness to Python discovery#3815
Add architecture (ISA) awareness to Python discovery#3815gaborbernat merged 12 commits intotox-dev:mainfrom
Conversation
|
Waiting on virtualenv new release(>=20.39) |
gaborbernat
left a comment
There was a problem hiding this comment.
Should have a test via tox r -e pyxy-{platform} to validate this. The machine should be a valid factor.
|
Given this code depends on virtualenv 20.39, should the dependency on virtualenv not be adjusted to reflect this? Line 61 in 5a5e6b2 I assume that's what is causing the CI failure here, when running with tox 4.46.0: https://github.com/Memrise/mypy-json-report/actions/runs/22365072220/job/64728762783?pr=268. |
|
Just as a follow up, the test failure was fixed by updating the virtualenv version to 20.39. |
|
Thanks @Tenzer, it would probably be better if we update the min version. |
The recent 4.46.0 release introduced the feature[1] which requires virtualenv>=20.39.0 . [1] tox-dev#3815
The recent 4.46.0 release introduced the feature[1] which requires virtualenv>=20.39.0 . [1] tox-dev#3815
We are seeing the CI failure exactly caused by this, and I proposed #3829 to fix it. |
The recent 4.46.0 release introduced the feature[1] which requires virtualenv>=20.39.0 . [1] tox-dev#3815
The recent 4.46.0 release introduced the feature[1] which requires virtualenv>=20.39.0 . [1] tox-dev#3815
The recent 4.46.0 release introduced the feature[1] which requires virtualenv>=20.39.0 . [1] #3815 - [x] ran the linter to address style issues (`tox -e fix`) - [x] wrote descriptive pull request text - [x] ensured there are test(s) validating the fix - [x] added news fragment in `docs/changelog` folder - [x] updated/extended the documentation
This change makes tox aware of the CPU architecture (ISA) when discovering and validating Python interpreters.
It closes #3069 and addresses the consolidated requests in #3320, #3137, and #2535.
For context:
On machines that can run multiple architectures — like Apple Silicon running both arm64 and x86_64 through Rosetta, or Linux with qemu-user — tox now lets you pin an environment to a specific architecture via base_python. For example, cpython3.12-64-arm64 will only match an ARM interpreter, and tox will fail if the discovered interpreter doesn't match, the same way it already does for version mismatches.
The architecture is derived from sysconfig.get_platform() (e.g. linux-x86_64, macosx-14.0-arm64) and flows through virtualenv's PythonSpec, which normalizes common aliases (amd64 → x86_64, aarch64 → arm64).
Needs virtualenv >= 20.39 at runtime
tox -e fix)docs/changelogfolder