Skip to content

Support for selecting via Python build CPU architecture #1149

@tr00st

Description

@tr00st

Would it be feasible to allow switching of Python environments based on CPU architecture?

I've been recently attempting to arrange builds of binary wheel files using Tox to automate the environment switching. This is particularly frustrating on Windows, as getting a working VC++ toolchain is a non-trivial exercise. To deal with this, I'm deploying scripts to our CI server that builds wheels of any binary packages we use, and uploads them to an isolated pypiserver instance. Tox currently works well for iterating over the versions available, but I've been unable to find a way to

Given the "py" launcher tracks CPU architecture, I've been able to come up with a way of patching this support in for Windows (see tr00st@b7dc030) - the patch I've made means a user could set up a set of environments, eg at worst:

[testenv:py35-x86]
basepython = python3.5-32
[testenv:py36-x86]
basepython = python3.6-32
[testenv:py37-x86]
basepython = python3.7-32
[testenv:py35-x64]
basepython = python3.5-64
[testenv:py36-x64]
basepython = python3.6-64
[testenv:py37-x64]
basepython = python3.7-64

This is more than enough for my scenario, but I'm aware this wouldn't solve the issue for Linux users - hence I'm holding off a PR for now. Any idea if this would be desirable, and if so how one might go about this on linux? (things that come to mind are running the python interpreter with a quick one-liner or using "file" package to inspect any potential python executable).

Happy to put a PR through if this is desirable as-is, but thought it would be worth discussing any other possible solutions.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:configurationfeature:newsomething does not exist yet, but shouldhelp:wantedIssues that have been acknowledged, a solution determined and a PR might likely be accepted.needs:discussionIt's not quite clear if and how this should be done

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions