Skip to content

Commit

Permalink
Add dependency checking for flask
Browse files Browse the repository at this point in the history
  • Loading branch information
darrylong committed Nov 27, 2023
1 parent 15c2185 commit bd10bd5
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
9 changes: 8 additions & 1 deletion cornac/serving/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,16 @@

import os
import pickle
from flask import Flask, jsonify, request
from csv import writer

try:
from flask import Flask, jsonify, request
except ImportError:
exit(
"Flask is required in order to serve models.\n"
+ "Run: pip3 install Flask"
)


def _import_model_class(model_class):
components = model_class.split(".")
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,7 @@ def extract_gcc_binaries():
"recommendation",
],
ext_modules=extensions,
install_requires=["numpy", "scipy", "tqdm>=4.19", "powerlaw", "Flask>=3.0.0"],
install_requires=["numpy", "scipy", "tqdm>=4.19", "powerlaw"],
extras_require={"tests": ["pytest", "pytest-pep8", "pytest-xdist", "pytest-cov"]},
cmdclass=cmdclass,
packages=find_packages(),
Expand Down

0 comments on commit bd10bd5

Please sign in to comment.