Skip to content

Support using system CMake and Ninja when available #732

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ requires = [
"scikit-build>=0.13.1",
"Cython>=0.24",
"scipy>=0.16",
"cmake>=3.18",
"ninja"
]
build-backend = "setuptools.build_meta"

Expand Down
9 changes: 9 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import io
import os.path
import shutil

from setuptools import find_packages
from skbuild import setup
Expand All @@ -18,6 +19,13 @@ def exclude_non_implicit_cmake_files(cmake_manifest):
return [f for f in cmake_manifest if "implicit" in f]


setup_requires = []
if shutil.which("cmake") is None:
setup_requires += ["cmake>=3.18"]
if shutil.which("ninja") is None:
setup_requires += ["ninja"]


setup(
name="implicit",
version="0.7.2",
Expand All @@ -44,6 +52,7 @@ def exclude_non_implicit_cmake_files(cmake_manifest):
"Collaborative Filtering, Recommender Systems"
),
packages=find_packages(),
setup_requires=setup_requires,
install_requires=["numpy>=1.17.0", "scipy>=0.16", "tqdm>=4.27", "threadpoolctl"],
cmake_process_manifest_hook=exclude_non_implicit_cmake_files,
)