# Copyright 2020 The Trieste Contributors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
from pathlib import Path

from setuptools import find_packages, setup

with open("README.md", "r") as file:
    long_description = file.read()

setup(
    name="trieste",
    version=Path("trieste/VERSION").read_text().strip(),
    author="The Trieste contributors",
    author_email="labs@secondmind.ai",
    description="A Bayesian optimization research toolbox built on TensorFlow",
    long_description=long_description,
    long_description_content_type="text/markdown",
    url="https://github.com/secondmind-labs/trieste",
    packages=find_packages(include=("trieste*",)),
    package_data={
        "trieste": ["py.typed", "VERSION"],
    },
    classifiers=[
        "Programming Language :: Python :: 3.7",
        "License :: OSI Approved :: Apache Software License",
        "Operating System :: OS Independent",
    ],
    python_requires="~=3.7",
    install_requires=[
        "absl-py",
        "dill!=0.3.6",
        "gpflow>=2.7.0",
        "gpflux>=0.4.0",
        "numpy",
        "tensorflow>=2.5",
        "tensorflow-probability>=0.13",
        "greenlet>=1.1.0",
    ],
    extras_require={
        "plotting": ["seaborn", "plotly"],
        "qhsri": ["pymoo", "cvxpy"],
    },
)

setup.py
# Copyright 2020 The Trieste Contributors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
from pathlib import Path

from setuptools import find_packages, setup

with open("README.md", "r") as file:
    long_description = file.read()

setup(
    name="trieste",
    version=Path("trieste/VERSION").read_text().strip(),
    author="The Trieste contributors",
    author_email="labs@secondmind.ai",
    description="A Bayesian optimization research toolbox built on TensorFlow",
    long_description=long_description,
    long_description_content_type="text/markdown",
    url="https://github.com/secondmind-labs/trieste",
    packages=find_packages(include=("trieste*",)),
    package_data={
        "trieste": ["py.typed", "VERSION"],
    },
    classifiers=[
        "Programming Language :: Python :: 3.7",
        "License :: OSI Approved :: Apache Software License",
        "Operating System :: OS Independent",
    ],
    python_requires="~=3.7",
    install_requires=[
        "absl-py",
        "dill!=0.3.6",
        "gpflow>=2.7.0",
        "gpflux>=0.4.0",
        "numpy",
        "tensorflow>=2.5; platform_system!='Darwin' or platform_machine!='arm64'",
        "tensorflow-macos>=2.5; platform_system=='Darwin' and platform_machine=='arm64'",
        "tensorflow-probability>=0.13",
        "greenlet>=1.1.0",
    ],
    extras_require={
        "plotting": ["seaborn", "plotly"],
        "qhsri": ["pymoo", "cvxpy"],
    },
)

setup.py
diff --git a/setup.py b/setup.py
index cead08089c..96e03844b8 100644
--- a/setup.py
+++ b/setup.py
@@ -43,7 +43,8 @@
         "gpflow>=2.7.0",
         "gpflux>=0.4.0",
         "numpy",
-        "tensorflow>=2.5",
+        "tensorflow>=2.5; platform_system!='Darwin' or platform_machine!='arm64'",
+        "tensorflow-macos>=2.5; platform_system=='Darwin' and platform_machine=='arm64'",
         "tensorflow-probability>=0.13",
         "greenlet>=1.1.0",
     ],

Cannot install trieste from pypi on MacOS
**Describe the bug**
`pip install trieste` fails on MacOS

**To reproduce**
Steps to reproduce the behaviour:
```
$ pip install trieste
Collecting trieste
  Downloading trieste-1.1.2-py3-none-any.whl (246 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 246.6/246.6 kB 3.4 MB/s eta 0:00:00
  Downloading trieste-1.1.1-py3-none-any.whl (246 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 246.5/246.5 kB 10.5 MB/s eta 0:00:00
  Downloading trieste-1.1.0-py3-none-any.whl (246 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 246.5/246.5 kB 10.5 MB/s eta 0:00:00
  Downloading trieste-1.0.0-py3-none-any.whl (240 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 240.4/240.4 kB 16.6 MB/s eta 0:00:00
  Using cached trieste-0.13.3-py3-none-any.whl (233 kB)
  Using cached trieste-0.13.2-py3-none-any.whl (218 kB)
  Using cached trieste-0.13.1-py3-none-any.whl (220 kB)
Collecting dill==0.3.4
  Using cached dill-0.3.4-py2.py3-none-any.whl (86 kB)
Collecting gpflow==2.5.2
  Using cached gpflow-2.5.2-py3-none-any.whl (383 kB)
Collecting trieste
  Using cached trieste-0.13.0-py3-none-any.whl (215 kB)
  Using cached trieste-0.12.0-py3-none-any.whl (208 kB)
  Using cached trieste-0.11.3-py3-none-any.whl (196 kB)
  Using cached trieste-0.11.2-py3-none-any.whl (196 kB)
  Using cached trieste-0.11.1-py3-none-any.whl (195 kB)
  Using cached trieste-0.11.0-py3-none-any.whl (195 kB)
  Using cached trieste-0.10.0-py3-none-any.whl (168 kB)
  Using cached trieste-0.9.1-py3-none-any.whl (139 kB)
  Using cached trieste-0.9.0-py3-none-any.whl (136 kB)
  Using cached trieste-0.8.0-py3-none-any.whl (150 kB)
  Using cached trieste-0.7.0-py3-none-any.whl (110 kB)
  Using cached trieste-0.6.1-py3-none-any.whl (77 kB)
  Using cached trieste-0.6.0-py3-none-any.whl (77 kB)
  Using cached trieste-0.5.1-py3-none-any.whl (63 kB)
Collecting gpflow==2.2.*
  Using cached gpflow-2.2.1-py3-none-any.whl (271 kB)
Collecting numpy
  Downloading numpy-1.24.3-cp39-cp39-macosx_11_0_arm64.whl (13.9 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 13.9/13.9 MB 16.5 MB/s eta 0:00:00
Collecting trieste
  Using cached trieste-0.5.0-py3-none-any.whl (63 kB)
Collecting gpflow==2.1.*
  Using cached gpflow-2.1.5-py3-none-any.whl (260 kB)
Collecting trieste
  Using cached trieste-0.4.0-py3-none-any.whl (43 kB)
  Using cached trieste-0.3.1-py3-none-any.whl (38 kB)
  Using cached trieste-0.3.0-py3-none-any.whl (38 kB)
  Using cached trieste-0.2.0-py3-none-any.whl (35 kB)
ERROR: Cannot install trieste==0.10.0, trieste==0.11.0, trieste==0.11.1, trieste==0.11.2, trieste==0.11.3, trieste==0.12.0, trieste==0.13.0, trieste==0.13.1, trieste==0.13.2, trieste==0.13.3, trieste==0.2.0, trieste==0.3.0, trieste==0.3.1, trieste==0.4.0, trieste==0.5.0, trieste==0.5.1, trieste==0.6.0, trieste==0.6.1, trieste==0.7.0, trieste==0.8.0, trieste==0.9.0, trieste==0.9.1, trieste==1.0.0, trieste==1.1.0, trieste==1.1.1 and trieste==1.1.2 because these package versions have conflicting dependencies.

The conflict is caused by:
    trieste 1.1.2 depends on tensorflow>=2.5
    trieste 1.1.1 depends on tensorflow>=2.5
    trieste 1.1.0 depends on tensorflow>=2.5
    trieste 1.0.0 depends on tensorflow>=2.5
    trieste 0.13.3 depends on tensorflow>=2.5
    trieste 0.13.2 depends on tensorflow>=2.4
    trieste 0.13.1 depends on tensorflow>=2.4
    trieste 0.13.0 depends on tensorflow>=2.4
    trieste 0.12.0 depends on tensorflow>=2.4
    trieste 0.11.3 depends on tensorflow>=2.4
    trieste 0.11.2 depends on tensorflow>=2.4
    trieste 0.11.1 depends on tensorflow>=2.4
    trieste 0.11.0 depends on tensorflow>=2.4
    trieste 0.10.0 depends on tensorflow>=2.4
    trieste 0.9.1 depends on tensorflow>=2.4
    trieste 0.9.0 depends on tensorflow>=2.4
    trieste 0.8.0 depends on tensorflow>=2.4
    trieste 0.7.0 depends on tensorflow>=2.4
    trieste 0.6.1 depends on tensorflow>=2.4
    trieste 0.6.0 depends on tensorflow>=2.4
    trieste 0.5.1 depends on tensorflow!=2.2.0, !=2.3.0 and >=2.1
    trieste 0.5.0 depends on tensorflow!=2.2.0, !=2.3.0 and >=2.1
    trieste 0.4.0 depends on tensorflow!=2.2.0, !=2.3.0 and >=2.1
    trieste 0.3.1 depends on tensorflow!=2.2.0, !=2.3.0 and >=2.1
    trieste 0.3.0 depends on tensorflow!=2.2.0, !=2.3.0 and >=2.1
    trieste 0.2.0 depends on tensorflow!=2.2.0, !=2.3.0 and >=2.1

To fix this you could try to:
1. loosen the range of package versions you've specified
2. remove package versions to allow pip attempt to solve the dependency conflict

ERROR: ResolutionImpossible: for help visit https://pip.pypa.io/en/latest/topics/dependency-resolution/#dealing-with-dependency-conflicts
```

**Expected behaviour**
It should be possible to install trieste from pypi on MacOS

**System information**
 - OS: MacOS Ventura 13.2
 - Python version: 3.8.13
 - Trieste version: 0.2.0 - 1.1.2
 - TensorFlow version: 2.11.0
 - GPflow version: 2.8.0


