From c0a4c007957eb040c433b17d92f7c7a789bad908 Mon Sep 17 00:00:00 2001
From: Sebastiano Ferraris <sebastiano.ferraris@gmail.com>
Date: Sun, 25 Aug 2019 08:38:12 +0100
Subject: [PATCH] Minor: requirements to list in setup to avoid repetitions
 (#1244)

* requirements to list in setup to avoid repetitions

* minor refactoring
---
 setup.py | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/setup.py b/setup.py
index 976cc4bd..3c8f55c7 100644
--- a/setup.py
+++ b/setup.py
@@ -119,6 +119,13 @@ def make_cython_ext(name, module, sources):
     return extension
 
 
+def get_requirements(filename='requirements.txt'):
+    here = os.path.dirname(os.path.realpath(__file__))
+    with open(os.path.join(here, filename), 'r') as f:
+        requires = [line.replace('\n', '') for line in f.readlines()]
+    return requires
+
+
 if __name__ == '__main__':
     write_version_py()
     setup(
@@ -146,10 +153,7 @@ if __name__ == '__main__':
         license='Apache License 2.0',
         setup_requires=['pytest-runner', 'cython', 'numpy'],
         tests_require=['pytest'],
-        install_requires=[
-            'mmcv>=0.2.10', 'numpy', 'matplotlib', 'six', 'terminaltables',
-            'pycocotools', 'torch>=1.1', 'imagecorruptions'
-        ],
+        install_requires=get_requirements(),
         ext_modules=[
             make_cython_ext(
                 name='soft_nms_cpu',
-- 
GitLab