File tree Expand file tree Collapse file tree 9 files changed +42
-39
lines changed Expand file tree Collapse file tree 9 files changed +42
-39
lines changed Original file line number Diff line number Diff line change 3030      - name : Install Dependencies 
3131        run : | 
3232          python -m pip install --upgrade pip 
33-           pip install -r requirements.txt 
34-           pip install pylint 
35-           pip install pytest 
33+           pip install .[test] 
3634
3735       - name : Pylint Source 
3836        run : | 
39-           find . -type f -name '*.py' | xargs pylint --extension-pkg-whitelist='pydantic' 
37+           find . -type f -name '*.py' | grep -v './build/' |  xargs pylint --extension-pkg-whitelist='pydantic' 
Original file line number Diff line number Diff line change 3030      - name : Install Dependencies 
3131        run : | 
3232          python -m pip install --upgrade pip 
33-           pip install -r requirements.txt 
34-           pip install pytest 
35-           pip install pytest-timeout 
36-           pip install pytest-cov 
37-           pip install pytest-asyncio 
33+           pip install .[test] 
3834
3935       - name : Run Tests 
4036        run : | 
41-           pytest --timeout=120 --timeout_method=thread --cov=runpod --cov-report=xml --cov-report=term-missing --cov-fail-under=100 -W error -p no:cacheprovider -p no:unraisableexception 
37+           pytest --ignore=build -- timeout=120 --timeout_method=thread --cov=runpod --cov-report=xml --cov-report=term-missing --cov-fail-under=100 -W error -p no:cacheprovider -p no:unraisableexception 
Original file line number Diff line number Diff line change 11# Change Log  
22
3- ## Release 1.3.0 (TBD )  
3+ ## Release 1.3.0 (10/12/23 )  
44
55### Changes  
66
77-  Backwards compatibility with Python >= 3.8
8+ -  Consolidated install dependencies to ` requirements.txt ` 
89
910### Fixed  
1011
Original file line number Diff line number Diff line change 1- aiohttp  >=  3.8.4  
1+ aiohttp  >=  3.8.6  
22aiohttp-retry  >=  2.8.3 
33
44backoff  ==  2.2.1 
55boto3  >=  1.26.165 
66click  >=  8.1.7 
7+ fastapi [all ] >=  0.94.0 
78pillow  >=  9.5.0 
89py-cpuinfo  ==  9.0.0 
910python-dotenv  >=  1.0.0 
1011requests  >=  2.31.0 
1112tomli  >=  2.0.1 
1213tqdm-loggable  ==  0.1.4 
13- setuptools_scm  ==  8.0.4 
14- 
15- fastapi [all ] >=  0.94.0 
16- 
17- # Minimum versions for dependencies 
1814urllib3  >=  1.26.6 
19- 
20- # Testing Requirements 
21- nest_asyncio  ==  1.5.8 
15+ setuptools_scm  ==  8.0.4 
Original file line number Diff line number Diff line change 22
33from  pkg_resources  import  get_distribution , DistributionNotFound 
44
5- try :
6-     __version__  =  get_distribution ("runpod" ).version 
7- except  DistributionNotFound :
8-     __version__  =  "unknown" 
5+ def  get_version ():
6+     """ Get the version of runpod-python """ "" 
7+     try :
8+         return  get_distribution ("runpod" ).version 
9+     except  DistributionNotFound :
10+         return  "unknown" 
11+ 
12+ __version__  =  get_version ()
Original file line number Diff line number Diff line change @@ -28,27 +28,13 @@ classifiers =
2828include_package_data  = true
2929packages  = find:
3030python_requires  = >= 3.8
31- install_requires  =
32-     aiohttp >= 3.8.4
33-     aiohttp-retry >= 2.8.3
34-     backoff >= 2.2.1
35-     boto3 >= 1.26.165
36-     click >= 8.1.7
37-     pillow >= 9.5.0
38-     py-cpuinfo >= 9.0.0
39-     python-dotenv >= 1.0.0
40-     requests >= 2.31.0
41-     tomli >= 2.0.1
42-     tqdm-loggable >= 0.1.4
43-     fastapi[all] >= 0.94.0
4431
45-     #  Minimum versions for dependencies
46-     urllib3 >= 1.26.6
4732
4833[options.extras_require] 
4934test  =
5035    asynctest
5136    nest_asyncio
37+     pylint
5238    pytest
5339    pytest-cov
5440    pytest-timeout
Original file line number Diff line number Diff line change 55
66from  setuptools  import  setup 
77
8+ with  open ('requirements.txt' , encoding = "UTF-8" ) as  requirements_file :
9+     requirements  =  requirements_file .read ().splitlines ()
10+ 
811if  __name__  ==  "__main__" :
912    setup (
1013        name = 'runpod' ,
1114        use_scm_version = True ,
1215        setup_requires = ['setuptools_scm' ],
16+         install_requires = requirements ,
1317
1418        entry_points = {
1519            'console_scripts' : [
Original file line number Diff line number Diff line change 11''' 
22Test shared functions related to authentication 
33''' 
4+ 
45import  unittest 
56import  importlib 
67
Original file line number Diff line number Diff line change 1+ """ Test the version module """ 
2+ 
3+ from  unittest .mock  import  patch , Mock 
4+ from  pkg_resources  import  DistributionNotFound 
5+ from  runpod .version  import  get_version 
6+ 
7+ def  test_version_found ():
8+     """ Test that the version is found """ 
9+     with  patch ('runpod.version.get_distribution' ) as  mock_get_distribution :
10+         mock_get_distribution .return_value  =  Mock (version = '1.0.0' )
11+         assert  get_version () ==  '1.0.0' 
12+         assert  mock_get_distribution .called 
13+ 
14+ def  test_version_not_found ():
15+     """ Test that the version is not found """ 
16+     with  patch ('runpod.version.get_distribution' ) as  mock_get_distribution :
17+         mock_get_distribution .side_effect  =  DistributionNotFound 
18+         assert  get_version () ==  'unknown' 
19+         assert  mock_get_distribution .called 
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments