@@ -57,9 +57,9 @@ def check_and_update_numpy(min_acceptable='1.15'):
57
57
if update_required :
58
58
subprocess .call (['pip3' , 'install' , 'numpy>={}' .format (min_acceptable )])
59
59
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 )])
63
63
64
64
65
65
class CoreInstall (install_command ):
@@ -74,11 +74,18 @@ def find_version(*path):
74
74
75
75
raise RuntimeError ("Unable to find version string." )
76
76
77
-
77
+ is_arm = platform . processor () == 'aarch64'
78
78
long_description = read ("README.md" )
79
79
version = find_version ("accuracy_checker" , "__init__.py" )
80
80
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 ()
82
89
83
90
try :
84
91
importlib .import_module ('cv2' )
@@ -92,6 +99,9 @@ def find_version(*path):
92
99
warnings .warn ("Problem with cv2 import: \n {}.\n Probably due to unsuitable numpy version, will be updated" .format (opencv_import_error ))
93
100
check_and_update_numpy ()
94
101
102
+ if is_arm :
103
+ install_dependencies_with_pip (requirements )
104
+
95
105
setup (
96
106
name = "accuracy_checker" ,
97
107
description = "Deep Learning Accuracy validation framework" ,
@@ -105,7 +115,7 @@ def find_version(*path):
105
115
]},
106
116
zip_safe = False ,
107
117
python_requires = '>=3.5' ,
108
- install_requires = requirements ,
118
+ install_requires = requirements if not is_arm else '' ,
109
119
tests_require = [read ("requirements-test.in" )],
110
120
cmdclass = {'test' : PyTest , 'install_core' : CoreInstall }
111
121
)
0 commit comments