Register
Login
Resources
Docs Blog Datasets Glossary Case Studies Tutorials & Webinars
Product
Data Engine LLMs Platform Enterprise
Pricing Explore
Connect to our Discord channel

#434 add deci requirements to ensure compatibility

Merged
Ghost merged 1 commits into Deci-AI:master from deci-ai:hotfix/SG-000-add-deci-requirements-back-to-ensure-comptability
@@ -58,9 +58,10 @@ jobs:
                 command: |
                 command: |
                   flake8 --statistics --config scripts/flake8-config setup.py $(git diff --diff-filter ACM origin/master --name-only | grep 'py$' | grep -v 'experimental/' | grep -v 'experimental_models/')
                   flake8 --statistics --config scripts/flake8-config setup.py $(git diff --diff-filter ACM origin/master --name-only | grep 'py$' | grep -v 'experimental/' | grep -v 'experimental_models/')
       - run:
       - run:
-          name: add requirements.txt to source code
+          name: add requirements.txt and requirements.pro.txt to source code
           command: |
           command: |
             cp requirements.txt src/super_gradients/requirements.txt
             cp requirements.txt src/super_gradients/requirements.txt
+            cp requirements.pro.txt src/super_gradients/requirements.pro.txt
       - run:
       - run:
           name: install python dependencies
           name: install python dependencies
           command: |
           command: |
@@ -82,7 +83,7 @@ jobs:
           no_output_timeout: 30m
           no_output_timeout: 30m
           command: |
           command: |
             . venv/bin/activate
             . venv/bin/activate
-            python3 -m pip install .
+            python3 -m pip install .[pro]
       - run:
       - run:
           name: run tests with coverage
           name: run tests with coverage
           no_output_timeout: 30m
           no_output_timeout: 30m
@@ -137,9 +138,10 @@ jobs:
           check_version_file: true
           check_version_file: true
 
 
       - run:
       - run:
-          name: add requirements.txt to source code
+          name: add requirements.txt and requirements.pro.txt to source code
           command: |
           command: |
             cp requirements.txt src/super_gradients/requirements.txt
             cp requirements.txt src/super_gradients/requirements.txt
+            cp requirements.pro.txt src/super_gradients/requirements.pro.txt
       - run:
       - run:
           name: edit package version
           name: edit package version
           command: |
           command: |
Discard
1
2
  1. deci-lab-client==2.60.0
  2. deci-common==3.5.0
Discard
@@ -26,4 +26,4 @@ pycocotools==2.0.4
 protobuf~=3.19.0
 protobuf~=3.19.0
 treelib==1.6.1
 treelib==1.6.1
 termcolor==1.1.0
 termcolor==1.1.0
-packaging>=20.4
+packaging>=20.4
Discard
@@ -9,6 +9,7 @@ from setuptools import find_packages
 
 
 README_LOCATION = 'README.md'
 README_LOCATION = 'README.md'
 REQ_LOCATION = 'requirements.txt'
 REQ_LOCATION = 'requirements.txt'
+REQ_PRO_LOCATION = 'requirements.pro.txt'
 VERSION_FILE = "version.txt"
 VERSION_FILE = "version.txt"
 
 
 
 
@@ -23,6 +24,11 @@ def get_requirements():
         return f.read().splitlines()
         return f.read().splitlines()
 
 
 
 
+def get_pro_requirements():
+    with open(REQ_PRO_LOCATION, encoding="utf-8") as f:
+        return f.read().splitlines()
+
+
 def get_version():
 def get_version():
     with open(VERSION_FILE, encoding="utf-8") as f:
     with open(VERSION_FILE, encoding="utf-8") as f:
         return f.readline()
         return f.readline()
@@ -43,8 +49,9 @@ setup(
         'super_gradients.recipes': ['*.yaml', '**/*.yaml'],
         'super_gradients.recipes': ['*.yaml', '**/*.yaml'],
         'super_gradients.common': ['auto_logging/auto_logging_conf.json'],
         'super_gradients.common': ['auto_logging/auto_logging_conf.json'],
         'super_gradients.examples': ['*.ipynb', '**/*.ipynb'],
         'super_gradients.examples': ['*.ipynb', '**/*.ipynb'],
-        'super_gradients': ['requirements.txt'],
+        'super_gradients': ['requirements.txt', 'requirements.pro.txt'],
     },
     },
     long_description=readme(),
     long_description=readme(),
-    long_description_content_type="text/markdown"
+    long_description_content_type="text/markdown",
+    extras_require={"pro": get_pro_requirements()}
 )
 )
Discard
@@ -13,7 +13,7 @@ LIB_CHECK_IMPOSSIBLE_MSG = 'Library check is not supported when super_gradients
 logger = get_logger(__name__, log_level=logging.DEBUG)
 logger = get_logger(__name__, log_level=logging.DEBUG)
 
 
 
 
-def get_requirements_path() -> Union[None, Path]:
+def get_requirements_path(requirements_file_name: str) -> Union[None, Path]:
     """Get the path of requirement.txt from the root if exist.
     """Get the path of requirement.txt from the root if exist.
     There is a difference when installed from artifact or locally.
     There is a difference when installed from artifact or locally.
         - In the first case, requirements.txt is copied to the package during the CI.
         - In the first case, requirements.txt is copied to the package during the CI.
@@ -30,10 +30,10 @@ def get_requirements_path() -> Union[None, Path]:
     project_root = package_root.parent.parent  # moving to super-gradients
     project_root = package_root.parent.parent  # moving to super-gradients
 
 
     # If installed from artifact, requirements.txt is in package_root, if installed locally it is in project_root
     # If installed from artifact, requirements.txt is in package_root, if installed locally it is in project_root
-    if (package_root / "requirements.txt").exists():
-        return package_root / "requirements.txt"
-    elif (project_root / "requirements.txt").exists():
-        return project_root / "requirements.txt"
+    if (package_root / requirements_file_name).exists():
+        return package_root / requirements_file_name
+    elif (project_root / requirements_file_name).exists():
+        return project_root / requirements_file_name
     else:
     else:
         return None  # Could happen when installed through github directly ("pip install git+https://github.com/...")
         return None  # Could happen when installed through github directly ("pip install git+https://github.com/...")
 
 
@@ -51,7 +51,9 @@ def get_installed_libs_with_version() -> Dict[str, str]:
 def verify_installed_libraries() -> List[str]:
 def verify_installed_libraries() -> List[str]:
     """Check that all installed libs respect the requirement.txt"""
     """Check that all installed libs respect the requirement.txt"""
 
 
-    requirements_path = get_requirements_path()
+    requirements_path = get_requirements_path("requirements.txt")
+    pro_requirements_path = get_requirements_path("requirements.pro.txt")
+
     if requirements_path is None:
     if requirements_path is None:
         return [LIB_CHECK_IMPOSSIBLE_MSG]
         return [LIB_CHECK_IMPOSSIBLE_MSG]
 
 
@@ -60,6 +62,12 @@ def verify_installed_libraries() -> List[str]:
 
 
     installed_libs_with_version = get_installed_libs_with_version()
     installed_libs_with_version = get_installed_libs_with_version()
 
 
+    # if pro_requirements_path is not None:
+    with open(pro_requirements_path, "r") as f:
+        pro_requirements = f.readlines()
+    if "deci-lab-client" in installed_libs_with_version:
+        requirements += pro_requirements
+
     errors = []
     errors = []
     for requirement in requirements:
     for requirement in requirements:
         if ">=" in requirement:
         if ">=" in requirement:
Discard