Commit 74441ab
authored
build: Install tensorflow-macos on Apple silicon Macs (#2119)
* Use hatchling's environment markers system to use platform information
to determine when the installing machine is an Apple silicon Mac
and install tensorflow-macos instead of tensorflow in this situation.
- c.f. https://hatch.pypa.io/latest/config/dependency/#environment-markers
* This works because of the following:
- x86-64 Linux machine:
>>> import platform
>>> platform.machine()
'x86_64'
>>> platform.system()
'Linux'
- x86-64 Apple machine:
>>> import platform
>>> platform.machine()
'x86_64'
>>> platform.system()
'Darwin'
- AArch64 machine:
>>> import platform
>>> platform.machine()
'aarch64'
>>> platform.system()
'Linux'
- Apple silicon machine:
>>> import platform
>>> platform.machine()
'arm64'
>>> platform.system()
'Darwin'1 parent 46ce316 commit 74441ab
1 file changed
+2
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
66 | 66 | | |
67 | 67 | | |
68 | 68 | | |
69 | | - | |
| 69 | + | |
| 70 | + | |
70 | 71 | | |
71 | 72 | | |
72 | 73 | | |
| |||
0 commit comments