forked from benfred/implicit
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
66 lines (57 loc) · 2.17 KB
/
setup.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
import io
import os.path
from packaging.version import LegacyVersion
from setuptools import find_packages
from skbuild import setup
from skbuild.cmaker import get_cmake_version
from skbuild.exceptions import SKBuildError
try:
import numpy.distutils # noqa
except ImportError:
pass
# Add CMake as a build requirement if cmake is not installed or is too low a version
setup_requires = []
try:
if LegacyVersion(get_cmake_version()) < LegacyVersion("3.17"):
setup_requires.append("cmake>=3.17")
except SKBuildError:
setup_requires.append("cmake>=3.17")
def read(file_name):
"""Read a text file and return the content as a string."""
file_path = os.path.join(os.path.dirname(__file__), file_name)
with io.open(file_path, encoding="utf-8") as f:
return f.read()
def exclude_non_implicit_cmake_files(cmake_manifest):
# we seem to be picking up a bunch of unrelated files from thrust/spdlog/rmm
# filter the cmake manifest down to things from this package only
return [f for f in cmake_manifest if "implicit" in f]
setup(
name="implicit",
version="0.6.1",
description="Collaborative Filtering for Implicit Feedback Datasets",
long_description=read("README.md"),
long_description_content_type="text/markdown",
url="http://github.com/benfred/implicit/",
author="Ben Frederickson",
author_email="[email protected]",
license="MIT",
classifiers=[
"Development Status :: 4 - Beta",
"Natural Language :: English",
"Intended Audience :: Science/Research",
"License :: OSI Approved :: MIT License",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Cython",
"Operating System :: OS Independent",
"Topic :: Software Development :: Libraries :: Python Modules",
],
keywords=(
"Matrix Factorization, Implicit Alternating Least Squares, "
"Collaborative Filtering, Recommender Systems"
),
packages=find_packages(),
install_requires=["numpy", "scipy>=0.16", "tqdm>=4.27"],
setup_requires=setup_requires,
cmake_process_manifest_hook=exclude_non_implicit_cmake_files,
)