Skip to content
Snippets Groups Projects
Unverified Commit 0ed95849 authored by Trung-Hoang Le's avatar Trung-Hoang Le Committed by GitHub
Browse files

Update suggestion command for building cornac from source (#645)

* Update suggestion command for building cornac from source

* Fix install command using escape dependency with specified version
parent 68f4f714
No related branches found
No related tags found
No related merge requests found
...@@ -30,14 +30,18 @@ import glob ...@@ -30,14 +30,18 @@ import glob
import shutil import shutil
from setuptools import Extension, Command, setup, find_packages from setuptools import Extension, Command, setup, find_packages
INSTALL_REQUIRES = ["numpy<2.0.0", "scipy<=1.13.1", "tqdm", "powerlaw"]
try: try:
from Cython.Distutils import build_ext from Cython.Distutils import build_ext
import numpy as np import numpy as np
import scipy import scipy
except ImportError: except ImportError:
escape_dependency_version = lambda x: '"{}"'.format(x) if "<" in x or "=" in x or ">" in x else x
exit( exit(
"We need some dependencies to build Cornac.\n" "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]))
) )
...@@ -351,7 +355,7 @@ setup( ...@@ -351,7 +355,7 @@ setup(
"recommendation", "recommendation",
], ],
ext_modules=extensions, 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"]}, extras_require={"tests": ["pytest", "pytest-pep8", "pytest-xdist", "pytest-cov", "Flask"]},
cmdclass=cmdclass, cmdclass=cmdclass,
packages=find_packages(), packages=find_packages(),
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment