curved-television-6568
09/12/2022, 3:10 PMcurved-television-6568
09/12/2022, 3:14 PMtensorflow
which works fine for linux and Mac as long as it is x86_64.
Now enter Mac M1 which as arm64, there are no prebuilt wheels for this platform, however there is a tensorflow-macos
that does have wheels for macos arm64. Is there any way to support both of these in the same Pants resolve, or do I need to work around this juggling with Pants resolves to make it work?
(running experiments now, posting in case someone already know the answer to this 🙂 )curved-television-6568
09/12/2022, 3:14 PMtensorflow ; sys_platform != "darwin" or platform_machine == "x86_64"
tensorflow-macos ; sys_platform == "darwin" and platform_machine == "arm64"
curved-television-6568
09/12/2022, 3:32 PM⠂ 2064.65s Generate lockfile for python-default
.. still going..curved-television-6568
09/12/2022, 4:44 PMrequirements
field of the python_requirement
target.. think that does what I want 🙂
requirements
type: Iterable[str]
required
A pip-style requirement string, e.g. `["Django==3.2.8"]`.
You can specify multiple requirements for the same project in order to use environment markers, such as
`["foo>=1.2,<1.3 ; python_version>'3.6'", "foo==0.9 ; python_version<'3'"]`.
curved-television-6568
09/12/2022, 5:34 PMpython_requirement(
name="test",
resolve="dummy",
requirements=[
"tensorflow ; sys_platform != 'darwin' or platform_machine == 'x86_64'",
"tensorflow-macos ; sys_platform == 'darwin' and platform_machine == 'arm64'",
],
)
curved-television-6568
09/12/2022, 5:35 PMcurved-television-6568
09/12/2022, 6:02 PM2022-09-12T14:01:32,317 INFO: pip is looking at multiple versions of pyparsing to determine which version is compatible with other requirements. This could take a while.
My attempts at pinning down pyparsing doesn’t seem to do anything..curved-television-6568
09/12/2022, 6:05 PMcurved-television-6568
09/12/2022, 6:42 PMcurved-television-6568
09/12/2022, 7:25 PMenough-analyst-54434
09/12/2022, 7:40 PM--pip-version 22.2.2
using Pex 2.1 104. Pants has not been upgraded yet, but that's the latest Pip and it solves some - definitely not all - resolve perf issues.enough-analyst-54434
09/12/2022, 7:40 PMenough-analyst-54434
09/12/2022, 7:41 PMenough-analyst-54434
09/12/2022, 8:00 PMpython_requirement
variant. On both, it might be a bit better for sanity sake to make the markers exactly inverse so you know it's an xor, so:
tensorflow ; sys_platform != "darwin" or platform_machine != "arm64"
tensorflow-macos ; sys_platform == "darwin" and platform_machine == "arm64"
enough-analyst-54434
09/12/2022, 8:00 PMenough-analyst-54434
09/12/2022, 8:02 PMenough-analyst-54434
09/12/2022, 8:02 PMcurved-television-6568
09/12/2022, 8:02 PMcurved-television-6568
09/12/2022, 8:03 PMenough-analyst-54434
09/12/2022, 8:03 PMenough-analyst-54434
09/12/2022, 8:03 PMcurved-television-6568
09/12/2022, 8:04 PMenough-analyst-54434
09/12/2022, 8:04 PMcurved-television-6568
09/12/2022, 8:05 PMenough-analyst-54434
09/12/2022, 8:05 PMcurved-television-6568
09/12/2022, 8:06 PM./pants --keep-sandbox=always ..
then tail -f /sandbox/.tmp/pex…/pip.log
enough-analyst-54434
09/12/2022, 8:06 PMcurved-television-6568
09/12/2022, 8:06 PMenough-analyst-54434
09/12/2022, 8:06 PMenough-analyst-54434
09/12/2022, 8:07 PMcurved-television-6568
09/12/2022, 8:07 PMenough-analyst-54434
09/12/2022, 8:07 PMcurved-television-6568
09/12/2022, 8:08 PMcurved-television-6568
09/12/2022, 8:09 PMcurved-television-6568
09/12/2022, 8:18 PMThe conflict is caused by:
The user requested keras
tensorflow 2.10.0 depends on keras<2.11 and >=2.10.0
tensorflow-macos 2.9.2 depends on keras<2.10.0 and >=2.9.0rc0
curved-television-6568
09/12/2022, 8:19 PMcurved-television-6568
09/12/2022, 8:21 PM>=
for both of them… works 🙌enough-analyst-54434
09/12/2022, 8:22 PMcurved-television-6568
09/12/2022, 8:33 PMcurved-television-6568
09/12/2022, 8:33 PM