Skip to content
This repository has been archived by the owner on Feb 27, 2024. It is now read-only.

Add environment marker to distinguish 32bit and 64bit windows #74

Open
mtreinish opened this issue Jul 11, 2022 · 2 comments
Open

Add environment marker to distinguish 32bit and 64bit windows #74

mtreinish opened this issue Jul 11, 2022 · 2 comments

Comments

@mtreinish
Copy link

Right now the environment markers defined in pep508 do not allow a way for specifying a requirement that is exclusively for 64 bit or 32 bit windows. The listed environment markers from: https://peps.python.org/pep-0508/#environment-markers all return identical data based on the OS install and not the current python environment. For example running on a 64bit and 32 bit build of python on the same 64bit windows system will yield:

Python API for marker 32bit Python output 64 bit Python output
os.name 'nt' 'nt'
sys.platform win32 win32
platform.machine() 'AMD64' 'AMD64'
platform.system() 'Windows' 'Windows'

It would be good if the platform markers offered a way to enable distinguishing between 32bit and 64bit python builds on a 64bit os (I'm assuming platform_machine works on a 32bit version of windows, but I don't have an install to test locally).

The first one that comes to mind would be platform_architecture to mirror platform.architecture() which returns (bits, linkage). Then for the marker we could match on string outputs like 64bit_WindowsPE for 64bit builds and 32bit_WindowsPE for 32 bit builds.

@mtreinish mtreinish changed the title Add environment marker to distniguish 32bit and 64bit windows Add environment marker to distinguish 32bit and 64bit windows Jul 11, 2022
@njsmith
Copy link
Member

njsmith commented Jul 12, 2022

What's the motivating use case? Wheels tags already let you select between 32bit and 64bit builds of a dependency...

@mtreinish
Copy link
Author

The use case is pretty straightforward if there is a compiled extension that has wheels only for 64 bit windows and an sdist published. Without having an environment marker the sdist will match and require 32 bit users to try and build it from source.

Personally I'm hitting this trying to add a requirement on symengine where there are no 32 bit wheels published and building from source is difficult and most users won't have the dependencies installed. On Linux it's trivial to use environment markers to restrict the requirement to x86_64 (or other supported architectures) and avoid it trying to build from source.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants