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 30
30
- name : Install Dependencies
31
31
run : |
32
32
python -m pip install --upgrade pip
33
- pip install -r requirements.txt
34
- pip install pylint
35
- pip install pytest
33
+ pip install .[test]
36
34
37
35
- name : Pylint Source
38
36
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 30
30
- name : Install Dependencies
31
31
run : |
32
32
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]
38
34
39
35
- name : Run Tests
40
36
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 1
1
# Change Log
2
2
3
- ## Release 1.3.0 (TBD )
3
+ ## Release 1.3.0 (10/12/23 )
4
4
5
5
### Changes
6
6
7
7
- Backwards compatibility with Python >= 3.8
8
+ - Consolidated install dependencies to ` requirements.txt `
8
9
9
10
### Fixed
10
11
Original file line number Diff line number Diff line change 1
- aiohttp >= 3.8.4
1
+ aiohttp >= 3.8.6
2
2
aiohttp-retry >= 2.8.3
3
3
4
4
backoff == 2.2.1
5
5
boto3 >= 1.26.165
6
6
click >= 8.1.7
7
+ fastapi [all ] >= 0.94.0
7
8
pillow >= 9.5.0
8
9
py-cpuinfo == 9.0.0
9
10
python-dotenv >= 1.0.0
10
11
requests >= 2.31.0
11
12
tomli >= 2.0.1
12
13
tqdm-loggable == 0.1.4
13
- setuptools_scm == 8.0.4
14
-
15
- fastapi [all ] >= 0.94.0
16
-
17
- # Minimum versions for dependencies
18
14
urllib3 >= 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 2
2
3
3
from pkg_resources import get_distribution , DistributionNotFound
4
4
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 =
28
28
include_package_data = true
29
29
packages = find:
30
30
python_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
44
31
45
- # Minimum versions for dependencies
46
- urllib3 >= 1.26.6
47
32
48
33
[options.extras_require]
49
34
test =
50
35
asynctest
51
36
nest_asyncio
37
+ pylint
52
38
pytest
53
39
pytest-cov
54
40
pytest-timeout
Original file line number Diff line number Diff line change 5
5
6
6
from setuptools import setup
7
7
8
+ with open ('requirements.txt' , encoding = "UTF-8" ) as requirements_file :
9
+ requirements = requirements_file .read ().splitlines ()
10
+
8
11
if __name__ == "__main__" :
9
12
setup (
10
13
name = 'runpod' ,
11
14
use_scm_version = True ,
12
15
setup_requires = ['setuptools_scm' ],
16
+ install_requires = requirements ,
13
17
14
18
entry_points = {
15
19
'console_scripts' : [
Original file line number Diff line number Diff line change 1
1
'''
2
2
Test shared functions related to authentication
3
3
'''
4
+
4
5
import unittest
5
6
import importlib
6
7
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