scipy / oldest-supported-numpy

Meta-package providing the oldest supported Numpy for a given Python version and platform
BSD 2-Clause "Simplified" License
55 stars 33 forks source link

simplify condition for platform_machine #56

Closed h-vetinari closed 2 years ago

h-vetinari commented 2 years ago

From discussion here, CC @rgommers

We can replace the direct negation of platform_machine=='arm64' and platform_system=='Darwin' above with only platform_machine not in ('arm64') because there are no machines that satisfy arm64+non-Darwin.

h-vetinari commented 2 years ago

Seems this is running into a complication with packaging: https://github.com/pypa/packaging/issues/552

h-vetinari commented 2 years ago

@rgommers This should now work, and is IMO a nice simplification.

rgommers commented 2 years ago

This | syntax is supported by packaging. One concern I had is that not all install tools support this, but it seems to be okay - I've verified that packaging is vendored or depended on by Pip, Poetry and PDM. Hopefully there are no other half-baked implementations for parsing this grammer floating around.

rgommers commented 2 years ago

From discussion here,

Copying what @h-vetinari wrote there: "I understand that this contains the negation of the Darwin+arm64 from above, but since aarch64 and arm64 are distinguished, arm64 does not seem possible with anything but Darwin?"

As of today:

So this should be safe enough, at least right now.