diff --git a/pyproject.toml b/pyproject.toml index ed97244c2..4d3bb6749 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,7 +1,5 @@ [build-system] requires = [ "setuptools", - "cmake>=3.12", - "ninja>=1.10" ] build-backend = "setuptools.build_meta" diff --git a/setup.py b/setup.py index 4bc54f109..58085d851 100644 --- a/setup.py +++ b/setup.py @@ -135,6 +135,12 @@ def build_extension(self, ext): with open("README.md", "r", encoding="utf-8") as fh: long_description = fh.read() +setup_requires = [] +if which("cmake") is None: + setup_requires += ["cmake>=3.12"] +if which("ninja") is None: + setup_requires += ["ninja>=1.10"] + setup( name="PyMatching", version=version['__version__'], @@ -153,6 +159,7 @@ def build_extension(self, ext): 'console_scripts': ['pymatching=pymatching._cli_argv:cli_argv'], }, python_requires=">=3.7", + setup_requires=setup_requires, install_requires=['scipy', 'numpy', 'networkx', 'matplotlib'], # Needed on Windows to avoid the default `build` colliding with Bazel's `BUILD`. options={'build': {'build_base': 'python_build_stim'}},