Skip to content

Commit 93eaaf9

Browse files
committed
adop requirements installation
1 parent 3251404 commit 93eaaf9

File tree

1 file changed

+16
-6
lines changed

1 file changed

+16
-6
lines changed

tools/accuracy_checker/setup.py

+16-6
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,9 @@ def check_and_update_numpy(min_acceptable='1.15'):
5757
if update_required:
5858
subprocess.call(['pip3', 'install', 'numpy>={}'.format(min_acceptable)])
5959

60-
61-
class CoreInstall(install_command):
62-
pass
60+
def install_dependencies_with_pip(dependencies):
61+
for dep in dependencies:
62+
subprocess.call(['pip3', 'install', str(dep)])
6363

6464

6565
class CoreInstall(install_command):
@@ -74,11 +74,18 @@ def find_version(*path):
7474

7575
raise RuntimeError("Unable to find version string.")
7676

77-
77+
is_arm = platform.processor() == 'aarch64'
7878
long_description = read("README.md")
7979
version = find_version("accuracy_checker", "__init__.py")
8080

81-
requirements = [read('requirements-core.in') + read("requirements.in") if 'install_core' not in sys.argv else '']
81+
def prepare_requirements():
82+
requirements_core = read('requirements-core.in').split('\n')
83+
if 'install_core' in sys.argv:
84+
return requirements_core
85+
requirements = read("requirements.in").slit('\n')
86+
return requirements_core + requirements
87+
88+
requirements = prepare_requirements()
8289

8390
try:
8491
importlib.import_module('cv2')
@@ -92,6 +99,9 @@ def find_version(*path):
9299
warnings.warn("Problem with cv2 import: \n{}.\n Probably due to unsuitable numpy version, will be updated".format(opencv_import_error))
93100
check_and_update_numpy()
94101

102+
if is_arm:
103+
install_dependencies_with_pip(requirements)
104+
95105
setup(
96106
name="accuracy_checker",
97107
description="Deep Learning Accuracy validation framework",
@@ -105,7 +115,7 @@ def find_version(*path):
105115
]},
106116
zip_safe=False,
107117
python_requires='>=3.5',
108-
install_requires=requirements,
118+
install_requires=requirements if not is_arm else '',
109119
tests_require=[read("requirements-test.in")],
110120
cmdclass={'test': PyTest, 'install_core': CoreInstall}
111121
)

0 commit comments

Comments
 (0)