Skip to content
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

Update suggestion command for building cornac from source #645

Merged
merged 2 commits into from
Sep 14, 2024
Merged
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
8 changes: 6 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,18 @@
import shutil
from setuptools import Extension, Command, setup, find_packages


INSTALL_REQUIRES = ["numpy<2.0.0", "scipy<=1.13.1", "tqdm", "powerlaw"]

try:
from Cython.Distutils import build_ext
import numpy as np
import scipy
except ImportError:
escape_dependency_version = lambda x: '"{}"'.format(x) if "<" in x or "=" in x or ">" in x else x
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need this lambda function? I don't see it being used

exit(
"We need some dependencies to build Cornac.\n"
+ "Run: pip3 install Cython numpy scipy"
+ "Run: pip3 install Cython {}".format(" ".join([escape_dependency_version(x) for x in INSTALL_REQUIRES]))
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tqtg Just updated the usage of lambda function. There is some packages with specified versions. The output of the suggested command looks like this Run: pip3 install Cython "numpy<2.0.0" "scipy<=1.13.1" tqdm powerlaw

)


Expand Down Expand Up @@ -351,7 +355,7 @@ def run(self):
"recommendation",
],
ext_modules=extensions,
install_requires=["numpy<2.0.0", "scipy<=1.13.1", "tqdm", "powerlaw"],
install_requires=INSTALL_REQUIRES,
extras_require={"tests": ["pytest", "pytest-pep8", "pytest-xdist", "pytest-cov", "Flask"]},
cmdclass=cmdclass,
packages=find_packages(),
Expand Down
Loading