From b1aa02e939e89b4bcf1a83fcaf0b000730cd6e8f Mon Sep 17 00:00:00 2001 From: Sourabh Date: Tue, 13 Dec 2022 17:32:00 +0530 Subject: [PATCH 1/7] Updating all python dependencies and making it == to prevent failures. --- bin/build_project.sh | 42 +++++++++-- common/requirements.txt | 22 ++---- dvp/requirements.txt | 21 ++---- libs/requirements.txt | 25 +++---- platform/requirements.txt | 24 +++---- platform/setup.py | 1 - tools/requirements.txt | 50 +++++-------- tools/setup.py | 12 ++-- .../_internal/plugin_validator.py | 12 ++-- .../_internal/test_plugin_validator.py | 72 ++++++++++++------- 10 files changed, 142 insertions(+), 139 deletions(-) diff --git a/bin/build_project.sh b/bin/build_project.sh index 5f237d95..27242ce4 100644 --- a/bin/build_project.sh +++ b/bin/build_project.sh @@ -13,6 +13,8 @@ modules=("common" "libs" "platform" "tools" "dvp") should_build=false should_test=false verbose=false +coverage=false +flake8=false screenSize=$(tput cols) equalFiller="=" greenColor=$(tput setaf 10) @@ -81,6 +83,16 @@ run_operations() { build_module print_as_per_screen_size " $module_name build complete " "${greenColor}" ${equalFiller} "${screenSize}" fi + if [ "$flake8" = true ]; then + echo + print_as_per_screen_size " $module_name Flake8 Main starts " "${orangeColor}" ${equalFiller} "${screenSize}" + python -m flake8 "$module_path/src/test/python" --max-line-length 88 + print_as_per_screen_size " $module_name Flake8 Main complete " "${greenColor}" ${equalFiller} "${screenSize}" + echo + print_as_per_screen_size " $module_name Flake8 Test starts " "${orangeColor}" ${equalFiller} "${screenSize}" + python -m flake8 "$module_path/src/main/python" --max-line-length 88 + print_as_per_screen_size " $module_name Flake8 Test complete " "${greenColor}" ${equalFiller} "${screenSize}" + fi if [ "$should_test" = true ]; then echo print_as_per_screen_size " $module_name tests starts " "${orangeColor}" ${equalFiller} "${screenSize}" @@ -112,11 +124,18 @@ build_module() { # Test the module test_module() { - if [ "$verbose" = true ]; then - python -m pytest -v src/test/python + cmd=[] + if [ "$coverage" = true ]; then + cmd=( coverage run -m pytest ) else - python -m pytest src/test/python + cmd=( python -m pytest ) fi + if [ "$verbose" = true ]; then + cmd=( ${cmd[@]} -v) + fi + cmd=( ${cmd[@]} src/test/python) + echo "Test command is ${cmd[*]}" + ${cmd[@]} } # Print the provided input in the center of screen by appending and prepending fillers. @@ -132,7 +151,7 @@ print_as_per_screen_size() { } # Get the options -while getopts ":hbtvm:" option; do +while getopts ":hbftvcm:" option; do case $option in h) # display Help Help @@ -150,6 +169,10 @@ while getopts ":hbtvm:" option; do fi ;; v) # Verbose mode verbose=true ;; + c) # Coverage mode + coverage=true ;; + f) # Run flake8 mode + flake8=true ;; \?) # Invalid options. echo "Error: Invalid option" Help @@ -166,12 +189,21 @@ while getopts ":hbtvm:" option; do esac done -if [ "$should_build" = true ] || [ "$should_test" = true ]; then +if [ "$should_build" = true ] || [ "$should_test" = true ] || [ "$flake8" = true ]; then if [ ${#multi[@]} -eq 0 ]; then multi=("${modules[@]}") fi + paths=() + current_path="$PWD" for module in "${multi[@]}"; do run_operations "$module" + paths=( ${paths[@]} "${current_path}/${module}/.coverage") done + + if [ "$coverage" = true ]; then + echo "Paths to combine for coverage are [${paths[*]}]." + coverage combine ${paths[@]} + coverage report -m -i + fi fi diff --git a/common/requirements.txt b/common/requirements.txt index 3b2c337b..8a460676 100644 --- a/common/requirements.txt +++ b/common/requirements.txt @@ -1,15 +1,7 @@ -bump2version==0.5.11 -contextlib2==0.6.0.post1 ; python_version < '3' -enum34==1.1.6 -funcsigs==1.0.2 ; python_version < '3.0' -importlib-metadata==0.23 ; python_version < '3.8' -more-itertools==5.0.0 ; python_version <= '2.7' -packaging==19.2 -pathlib2==2.3.5 ; python_version < '3.6' -pluggy==0.13.0 -py==1.8.0 -pyparsing==2.4.5 -pytest==4.6.11 -scandir==1.10.0 ; python_version < '3.5' -six==1.13.0 -zipp==0.6.0 +bump2version==1.0.1 +packaging==22.0 +pluggy==1.0.0 +pyparsing==3.0.9 +pytest==7.2.0 +six==1.16.0 +zipp==3.11.0 diff --git a/dvp/requirements.txt b/dvp/requirements.txt index d742b1d5..8a460676 100644 --- a/dvp/requirements.txt +++ b/dvp/requirements.txt @@ -1,14 +1,7 @@ -bump2version==0.5.11 -contextlib2==0.6.0.post1 ; python_version < '3' -funcsigs==1.0.2 ; python_version < '3.0' -importlib-metadata==1.3.0 ; python_version < '3.8' -more-itertools==5.0.0 ; python_version <= '2.7' -packaging==20.0 -pathlib2==2.3.5 ; python_version < '3' -pluggy==0.13.1 -py==1.8.1 -pyparsing==2.4.6 -pytest==4.6.11 -scandir==1.10.0 ; python_version < '3.5' -six==1.13.0 -zipp==0.6.0 +bump2version==1.0.1 +packaging==22.0 +pluggy==1.0.0 +pyparsing==3.0.9 +pytest==7.2.0 +six==1.16.0 +zipp==3.11.0 diff --git a/libs/requirements.txt b/libs/requirements.txt index a8a53e05..e0baab0e 100644 --- a/libs/requirements.txt +++ b/libs/requirements.txt @@ -1,17 +1,8 @@ -./../common -bump2version==0.5.11 -contextlib2==0.6.0.post1 ; python_version < '3' -enum34==1.1.6 -funcsigs==1.0.2 ; python_version < '3.3' -importlib-metadata==1.3.0 ; python_version < '3.8' -mock==3.0.5 -more-itertools==5.0.0 ; python_version <= '2.7' -packaging==19.2 -pathlib2==2.3.5 ; python_version < '3.6' -pluggy==0.13.1 -py==1.8.1 -pyparsing==2.4.6 -pytest==4.6.11 -scandir==1.10.0 ; python_version < '3.5' -six==1.13.0 -zipp==0.6.0 +bump2version==1.0.1 +mock==4.0.3 +packaging==22.0 +pluggy==1.0.0 +pyparsing==3.0.9 +pytest==7.2.0 +six==1.16.0 +zipp==3.11.0 diff --git a/platform/requirements.txt b/platform/requirements.txt index fd57ccb7..e0baab0e 100644 --- a/platform/requirements.txt +++ b/platform/requirements.txt @@ -1,16 +1,8 @@ -./../common -bump2version==0.5.11 -contextlib2==0.6.0.post1 ; python_version < '3' -funcsigs==1.0.2 ; python_version < '3.3' -importlib-metadata==1.3.0 ; python_version < '3.8' -mock==3.0.5 -more-itertools==5.0.0 ; python_version <= '2.7' -packaging==20.0 -pathlib2==2.3.5 ; python_version < '3' -pluggy==0.13.1 -py==1.8.1 -pyparsing==2.4.6 -pytest==4.6.10 -scandir==1.10.0 ; python_version < '3.5' -six==1.13.0 -zipp==0.6.0 +bump2version==1.0.1 +mock==4.0.3 +packaging==22.0 +pluggy==1.0.0 +pyparsing==3.0.9 +pytest==7.2.0 +six==1.16.0 +zipp==3.11.0 diff --git a/platform/setup.py b/platform/setup.py index 807233d8..ee95d8da 100644 --- a/platform/setup.py +++ b/platform/setup.py @@ -9,7 +9,6 @@ install_requires = [ "dvp-api == 1.7.0", "dvp-common == {}".format(version), - "enum34;python_version < '3.4'", ] setuptools.setup(name='dvp-platform', diff --git a/tools/requirements.txt b/tools/requirements.txt index c48971c5..780e8cf5 100644 --- a/tools/requirements.txt +++ b/tools/requirements.txt @@ -1,33 +1,19 @@ -./../common -./../libs -./../platform -backports.functools-lru-cache==1.6.1 ; python_version < '3.2' -bump2version==0.5.11 -contextlib2==0.6.0.post1 ; python_version < '3' -coverage==5.0.2 -entrypoints==0.3 -enum34==1.1.6 -flake8==3.7.9 -funcsigs==1.0.2 ; python_version < '3.3' -functools32==3.2.3.post2 ; python_version < '3' -futures==3.3.0 ; python_version < '3.2' +bump2version==1.0.1 +coverage==6.5.0 +entrypoints==0.4 +flake8==6.0.0 httpretty==0.9.7 -importlib-metadata==1.3.0 ; python_version < '3.8' -isort==4.3.21 -mccabe==0.6.1 -mock==3.0.5 -more-itertools==5.0.0 -packaging==20.0 -pathlib2==2.3.5 ; python_version < '3' -pluggy==0.13.1 -py==1.8.1 -pycodestyle==2.5.0 -pyflakes==2.1.1 -pyparsing==2.4.6 -pytest-cov==2.8.1 -pytest==4.6.11 -scandir==1.10.0 ; python_version < '3.5' -six==1.13.0 -typing==3.7.4.1 ; python_version < '3.5' -yapf==0.28 -zipp==0.6.0 +isort==5.11.1 +mccabe==0.7.0 +mock==4.0.3 +more-itertools==9.0.0 +packaging==22.0 +pluggy==1.0.0 +pycodestyle==2.10.0 +pyflakes==3.0.1 +pyparsing==3.0.9 +pytest-cov==4.0.0 +pytest==7.2.0 +six==1.16.0 +yapf==0.32 +zipp==3.11.0 diff --git a/tools/setup.py b/tools/setup.py index 0e91ae4f..1585bc51 100644 --- a/tools/setup.py +++ b/tools/setup.py @@ -10,12 +10,12 @@ "click == 7.1.2", "click-configfile == 0.2.3", "dvp-platform == {}".format(version), - "enum34 >= 1.1.6", - "flake8 >= 3.6", - "jinja2 >= 2.10", - "jsonschema >= 3", - "pyyaml >= 3", - "requests >= 2.21.0", + "dvp-libs == {}".format(version), + "flake8 == 6.0.0", + "jinja2 == 3.1.2", + "jsonschema == 4.17.3", + "pyyaml == 6", + "requests == 2.28.1", "httpretty == 0.9.7", ] diff --git a/tools/src/main/python/dlpx/virtualization/_internal/plugin_validator.py b/tools/src/main/python/dlpx/virtualization/_internal/plugin_validator.py index 821b3587..f0b11d9e 100644 --- a/tools/src/main/python/dlpx/virtualization/_internal/plugin_validator.py +++ b/tools/src/main/python/dlpx/virtualization/_internal/plugin_validator.py @@ -210,15 +210,15 @@ def __check_for_undefined_names(self): exclude=[exclude_dir], quiet=1) style_guide.check_files(paths=[src_dir]) - file_checkers = style_guide._application.file_checker_manager.checkers + style_results = style_guide._application.file_checker_manager.results - for checker in file_checkers: - for result in checker.results: + for filename, results, _ in style_results: + for (error_code, line_number, _, text, _) in results: # From the api code, result is a tuple defined as: error = # (error_code, line_number, column, text, physical_line) - if result[0] == 'F821': - msg = "{} on line {} in {}".format(result[3], result[1], - checker.filename) + if error_code == 'F821': + msg = "{} on line {} in {}".format(text, line_number, + filename) warnings['exception'].append(exceptions.UserError(msg)) if warnings and len(warnings) > 0: diff --git a/tools/src/test/python/dlpx/virtualization/_internal/test_plugin_validator.py b/tools/src/test/python/dlpx/virtualization/_internal/test_plugin_validator.py index 4b419768..f826a1aa 100644 --- a/tools/src/test/python/dlpx/virtualization/_internal/test_plugin_validator.py +++ b/tools/src/test/python/dlpx/virtualization/_internal/test_plugin_validator.py @@ -3,6 +3,7 @@ # import json +import os import mock import pytest @@ -69,6 +70,7 @@ def test_plugin_missing_field(plugin_config_file, plugin_config_content): ('1.0.0_HF', None)]) def test_plugin_version_format(plugin_config_file, plugin_config_content, expected): + message = None try: validator = PluginValidator.from_config_content( plugin_config_file, plugin_config_content, @@ -76,7 +78,7 @@ def test_plugin_version_format(plugin_config_file, validator.validate_plugin_config() except exceptions.SchemaValidationError as err_info: message = err_info.message - assert expected in message + TestPluginValidator.assert_string(expected, message) @staticmethod @mock.patch('os.path.isabs', return_value=False) @@ -90,6 +92,7 @@ def test_plugin_version_format(plugin_config_file, ('staged_plugin:staged', None)]) def test_plugin_entry_point(plugin_config_file, plugin_config_content, expected): + message = None try: validator = PluginValidator.from_config_content( plugin_config_file, plugin_config_content, @@ -97,7 +100,7 @@ def test_plugin_entry_point(plugin_config_file, validator.validate_plugin_config() except exceptions.SchemaValidationError as err_info: message = err_info.message - assert expected in message + TestPluginValidator.assert_string(expected, message) @staticmethod def test_plugin_additional_properties(plugin_config_file, @@ -105,15 +108,13 @@ def test_plugin_additional_properties(plugin_config_file, # Adding an unknown key plugin_config_content['unknown_key'] = 'unknown_value' - try: + with pytest.raises(exceptions.SchemaValidationError) as err_info: validator = PluginValidator.from_config_content( plugin_config_file, plugin_config_content, const.PLUGIN_CONFIG_SCHEMA) validator.validate_plugin_config() - except exceptions.SchemaValidationError as err_info: - message = err_info.message - assert ("Additional properties are not allowed" - " ('unknown_key' was unexpected)" in message) + assert ("Additional properties are not allowed" + " ('unknown_key' was unexpected)" in err_info.value.message) @staticmethod @pytest.mark.parametrize('host_types', [['xxx']]) @@ -142,6 +143,7 @@ def test_multiple_validation_errors(plugin_config_file, ('e3b69c61-4c30-44f7-92c0-504c8388b91e', None)]) def test_plugin_id(plugin_config_file, plugin_config_content, expected): + message = None try: validator = PluginValidator.from_config_content( plugin_config_file, plugin_config_content, @@ -149,7 +151,7 @@ def test_plugin_id(plugin_config_file, validator.validate_plugin_config() except exceptions.SchemaValidationError as err_info: message = err_info.message - assert expected in message + TestPluginValidator.assert_string(expected, message) @staticmethod @mock.patch('os.path.isabs', return_value=False) @@ -165,6 +167,7 @@ def test_plugin_id(plugin_config_file, ('0.1', None)]) def test_plugin_build_number_format(plugin_config_file, plugin_config_content, expected): + message = None try: validator = PluginValidator.from_config_content( plugin_config_file, plugin_config_content, @@ -172,7 +175,7 @@ def test_plugin_build_number_format(plugin_config_file, validator.validate_plugin_config() except exceptions.SchemaValidationError as err_info: message = err_info.message - assert expected in message + TestPluginValidator.assert_string(expected, message) @staticmethod @mock.patch('os.path.isabs', return_value=False) @@ -182,14 +185,12 @@ def test_plugin_build_number_format(plugin_config_file, ('!lua#toolkit', "'!lua#toolkit' does not match")]) def test_plugin_lua_name_format(plugin_config_file, plugin_config_content, expected): - try: + with pytest.raises(exceptions.SchemaValidationError) as err_info: validator = PluginValidator.from_config_content( plugin_config_file, plugin_config_content, const.PLUGIN_CONFIG_SCHEMA) validator.validate_plugin_config() - except exceptions.SchemaValidationError as err_info: - message = err_info.message - assert expected in message + assert expected in err_info.value.message @staticmethod @mock.patch('os.path.isabs', return_value=False) @@ -200,39 +201,56 @@ def test_plugin_lua_name_format(plugin_config_file, def test_plugin_minimum_lua_version_format(plugin_config_file, plugin_config_content, expected): - try: + with pytest.raises(exceptions.SchemaValidationError) as err_info: validator = PluginValidator.from_config_content( plugin_config_file, plugin_config_content, const.PLUGIN_CONFIG_SCHEMA) validator.validate_plugin_config() - except exceptions.SchemaValidationError as err_info: - message = err_info.message - assert expected in message + assert expected in err_info.value.message @staticmethod @pytest.mark.parametrize('minimum_lua_version', [None]) def test_plugin_lua_name_without_minimum_lua_version( plugin_config_file, plugin_config_content): - try: + with pytest.raises(exceptions.ValidationFailedError) as err_info: validator = PluginValidator.from_config_content( plugin_config_file, plugin_config_content, const.PLUGIN_CONFIG_SCHEMA) validator.validate_plugin_config() - except exceptions.ValidationFailedError as err_info: - message = err_info.message - assert ('Failed to process property "luaName" without ' - '"minimumLuaVersion" set in the plugin config.' in message) + assert ('Failed to process property "luaName" without "minimumLuaVersion"' + ' set in the plugin config.' in err_info.value.message) @staticmethod @pytest.mark.parametrize('lua_name', [None]) def test_plugin_minimum_lua_version_without_lua_name( plugin_config_file, plugin_config_content): - try: + with pytest.raises(exceptions.ValidationFailedError) as err_info: validator = PluginValidator.from_config_content( plugin_config_file, plugin_config_content, const.PLUGIN_CONFIG_SCHEMA) validator.validate_plugin_config() - except exceptions.ValidationFailedError as err_info: - message = err_info.message - assert ('Failed to process property "minimumLuaVersion" without ' - '"luaName" set in the plugin config.' in message) + assert ('Failed to process property "minimumLuaVersion" without ' + '"luaName" set in the plugin config.' in err_info.value.message) + + @staticmethod + def test_undefined_name_validation(plugin_config_file, plugin_config_content): + src_dir = plugin_config_content['srcDir'] + undefined_name_file = os.path.join(src_dir, 'undefined_name.py') + with open(undefined_name_file, 'w') as f: + f.write('@directplugin.discovery.repository()' + '\ndef repository_discovery(source_connection):' + '\n\treturn None\n\n') + with pytest.raises(exceptions.ValidationFailedError) as err_info: + validator = PluginValidator.from_config_content( + plugin_config_file, plugin_config_content, + const.PLUGIN_CONFIG_SCHEMA) + validator.validate_plugin_config() + assert ('undefined name \'directplugin\' on line 1 ' + 'in {}'.format(undefined_name_file) in err_info.value.message) + + @staticmethod + def assert_string(expected_string, actual_string): + if expected_string: + assert expected_string in actual_string + else: + assert actual_string is None From 477e172698159cdfa1c7bde098e686a1ee868fb5 Mon Sep 17 00:00:00 2001 From: Sourabh Date: Wed, 14 Dec 2022 15:45:33 +0530 Subject: [PATCH 2/7] Updating help for shell script. --- bin/build_project.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/bin/build_project.sh b/bin/build_project.sh index 27242ce4..bd938694 100644 --- a/bin/build_project.sh +++ b/bin/build_project.sh @@ -47,6 +47,12 @@ Help() { echo " v${blackColor} | ${orangeColor}Verbose mode on ${blackColor} | ${greenColor}sh build_project.sh -t -v${noColor}" echo " ${blackColor} | ${orangeColor} ${blackColor} | ${greenColor}sh build_project.sh -bvt -m tools${noColor}" print_separator + echo " c${blackColor} | ${orangeColor}Test Coverage mode on ${blackColor} | ${greenColor}sh build_project.sh -t -c${noColor}" + echo " ${blackColor} | ${orangeColor} ${blackColor} | ${greenColor}sh build_project.sh -bct -m tools${noColor}" + print_separator + echo " f${blackColor} | ${orangeColor}Flake8 validation mode on ${blackColor} | ${greenColor}sh build_project.sh -f${noColor}" + echo " ${blackColor} | ${orangeColor} ${blackColor} | ${greenColor}sh build_project.sh -bft -m tools${noColor}" + print_separator echo " m${blackColor} | ${orangeColor}provide a list of modules.${blackColor} | ${greenColor}sh build_project.sh -bt -m common -m libs${noColor}" echo " ${blackColor} | ${orangeColor}Valid python modules: ${blackColor} | ${noColor}" echo " ${blackColor} | ${orangeColor} - common ${blackColor} | ${noColor}" From ae63f3b4b209b4e0a654b74a359881f8a1d43a2a Mon Sep 17 00:00:00 2001 From: Sourabh Date: Fri, 16 Dec 2022 11:47:05 +0530 Subject: [PATCH 3/7] Adding dependent packages in requirements.txt to test the changes locally. --- libs/requirements.txt | 1 + platform/requirements.txt | 1 + tools/requirements.txt | 2 ++ 3 files changed, 4 insertions(+) diff --git a/libs/requirements.txt b/libs/requirements.txt index e0baab0e..1f265b54 100644 --- a/libs/requirements.txt +++ b/libs/requirements.txt @@ -1,3 +1,4 @@ +./../common bump2version==1.0.1 mock==4.0.3 packaging==22.0 diff --git a/platform/requirements.txt b/platform/requirements.txt index e0baab0e..1f265b54 100644 --- a/platform/requirements.txt +++ b/platform/requirements.txt @@ -1,3 +1,4 @@ +./../common bump2version==1.0.1 mock==4.0.3 packaging==22.0 diff --git a/tools/requirements.txt b/tools/requirements.txt index 780e8cf5..859d86b3 100644 --- a/tools/requirements.txt +++ b/tools/requirements.txt @@ -1,3 +1,5 @@ +./../libs +./../platform bump2version==1.0.1 coverage==6.5.0 entrypoints==0.4 From 9612c9c6816f64cb61fd3bc46b6d3ca6959a7f19 Mon Sep 17 00:00:00 2001 From: Sourabh Date: Fri, 16 Dec 2022 11:48:46 +0530 Subject: [PATCH 4/7] Adding dependent packages in requirements.txt to test the changes locally. --- tools/requirements.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/requirements.txt b/tools/requirements.txt index 859d86b3..5961534e 100644 --- a/tools/requirements.txt +++ b/tools/requirements.txt @@ -1,3 +1,4 @@ +./../common ./../libs ./../platform bump2version==1.0.1 From ac511bb467f80cd250f19fdd7042c3385e5cb868 Mon Sep 17 00:00:00 2001 From: Sourabh Date: Fri, 16 Dec 2022 12:19:57 +0530 Subject: [PATCH 5/7] Updating httpretty to 1.0.5 --- tools/requirements.txt | 2 +- tools/setup.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/requirements.txt b/tools/requirements.txt index 5961534e..0ec591d7 100644 --- a/tools/requirements.txt +++ b/tools/requirements.txt @@ -5,7 +5,7 @@ bump2version==1.0.1 coverage==6.5.0 entrypoints==0.4 flake8==6.0.0 -httpretty==0.9.7 +httpretty==1.0.5 isort==5.11.1 mccabe==0.7.0 mock==4.0.3 diff --git a/tools/setup.py b/tools/setup.py index 1585bc51..b7b3b633 100644 --- a/tools/setup.py +++ b/tools/setup.py @@ -16,7 +16,7 @@ "jsonschema == 4.17.3", "pyyaml == 6", "requests == 2.28.1", - "httpretty == 0.9.7", + "httpretty == 1.0.5", ] setuptools.setup(name='dvp-tools', From d2c00fb8a1d7dbad1a84965f8f9b33a5baff64ad Mon Sep 17 00:00:00 2001 From: Sourabh Date: Wed, 4 Jan 2023 14:56:55 +0530 Subject: [PATCH 6/7] Updating setup.py to have better control over versions. --- .github/workflows/publish-python-packages.yml | 2 +- common/setup.cfg | 5 ++-- common/setup.py | 7 +++--- dvp/setup.py | 10 ++++---- libs/setup.cfg | 5 ++-- libs/setup.py | 9 +++---- platform/setup.cfg | 5 ++-- platform/setup.py | 9 +++---- tools/setup.py | 24 ++++++++++++------- 9 files changed, 42 insertions(+), 34 deletions(-) diff --git a/.github/workflows/publish-python-packages.yml b/.github/workflows/publish-python-packages.yml index 5e52bcaa..f41c0eaa 100644 --- a/.github/workflows/publish-python-packages.yml +++ b/.github/workflows/publish-python-packages.yml @@ -17,7 +17,7 @@ jobs: strategy: max-parallel: 5 matrix: - python-version: [2.7] + python-version: [3.8] package: [common, dvp, libs, platform, tools] steps: diff --git a/common/setup.cfg b/common/setup.cfg index a482f5f1..97e9bdd0 100644 --- a/common/setup.cfg +++ b/common/setup.cfg @@ -1,5 +1,5 @@ # -# Copyright (c) 2019, 2021 by Delphix. All rights reserved. +# Copyright (c) 2019, 2022 by Delphix. All rights reserved. # [metadata] @@ -12,10 +12,9 @@ long_description_content_type: text/markdown classifiers: Development Status :: 5 - Production/Stable Programming Language :: Python - Programming Language :: Python :: 2.7 Programming Language :: Python :: 3.8 License :: OSI Approved :: Apache Software License Operating System :: OS Independent [options] -requires_python: >=2.7, <=3.8, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*, !=3.5.*, !=3.6.*, !=3.7.* +requires_python: >=3.8, <3.9 diff --git a/common/setup.py b/common/setup.py index 90b26e40..8a4cf630 100644 --- a/common/setup.py +++ b/common/setup.py @@ -4,7 +4,8 @@ PYTHON_SRC = 'src/main/python' install_requires = [ - "dvp-api == 1.7.0", + "dvp-api == 1.7.0", + "six >= 1.16, < 1.17", ] with open(os.path.join(PYTHON_SRC, 'dlpx/virtualization/common/VERSION')) as version_file: @@ -15,5 +16,5 @@ install_requires=install_requires, package_dir={'': PYTHON_SRC}, packages=setuptools.find_packages(PYTHON_SRC), - python_requires='>=2.7, <3.9, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*, !=3.5.*, !=3.6.*, !=3.7.*', -) + python_requires='>=3.8, <3.9', + ) diff --git a/dvp/setup.py b/dvp/setup.py index e7f78c7b..1f53d67d 100644 --- a/dvp/setup.py +++ b/dvp/setup.py @@ -7,10 +7,10 @@ version = version_file.read().strip() install_requires = [ - "dvp-common == {}".format(version), - "dvp-libs == {}".format(version), - "dvp-platform == {}".format(version), - "dvp-tools == {}".format(version) + "dvp-common == {}".format(version), + "dvp-libs == {}".format(version), + "dvp-platform == {}".format(version), + "dvp-tools == {}".format(version) ] setuptools.setup(name='dvp', @@ -19,4 +19,4 @@ package_dir={'': PYTHON_SRC}, packages=setuptools.find_packages(PYTHON_SRC), python_requires='>=3.8, <3.9', -) + ) diff --git a/libs/setup.cfg b/libs/setup.cfg index 09cd385a..60c64d24 100644 --- a/libs/setup.cfg +++ b/libs/setup.cfg @@ -1,5 +1,5 @@ # -# Copyright (c) 2019, 2021 by Delphix. All rights reserved. +# Copyright (c) 2019, 2022 by Delphix. All rights reserved. # [metadata] @@ -13,10 +13,9 @@ long_description_content_type: text/markdown classifiers: Development Status :: 5 - Production/Stable Programming Language :: Python - Programming Language :: Python :: 2.7 Programming Language :: Python :: 3.8 License :: OSI Approved :: Apache Software License Operating System :: OS Independent [options] -requires_python: >=2.7, <=3.8, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*, !=3.5.*, !=3.6.*, !=3.7.* +requires_python: >=3.8, <3.9 diff --git a/libs/setup.py b/libs/setup.py index e98547f9..5a02a51f 100644 --- a/libs/setup.py +++ b/libs/setup.py @@ -7,8 +7,9 @@ version = version_file.read().strip() install_requires = [ - "dvp-api == 1.7.0", - "dvp-common == {}".format(version) + "dvp-api == 1.7.0", + "dvp-common == {}".format(version), + "six >= 1.16, < 1.17", ] setuptools.setup(name='dvp-libs', @@ -16,5 +17,5 @@ install_requires=install_requires, package_dir={'': PYTHON_SRC}, packages=setuptools.find_packages(PYTHON_SRC), - python_requires='>=2.7, <3.9, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*, !=3.5.*, !=3.6.*, !=3.7.*', -) + python_requires='>=3.8, <3.9', + ) diff --git a/platform/setup.cfg b/platform/setup.cfg index 5e67bf3e..dc2ea65e 100644 --- a/platform/setup.cfg +++ b/platform/setup.cfg @@ -1,5 +1,5 @@ # -# Copyright (c) 2019, 2021 by Delphix. All rights reserved. +# Copyright (c) 2019, 2022 by Delphix. All rights reserved. # [metadata] @@ -13,10 +13,9 @@ long_description_content_type: text/markdown classifiers: Development Status :: 5 - Production/Stable Programming Language :: Python - Programming Language :: Python :: 2.7 Programming Language :: Python :: 3.8 License :: OSI Approved :: Apache Software License Operating System :: OS Independent [options] -requires_python: >=2.7, <=3.8, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*, !=3.5.*, !=3.6.*, !=3.7.* +requires_python: >=3.8, <3.9 diff --git a/platform/setup.py b/platform/setup.py index ee95d8da..903b48dd 100644 --- a/platform/setup.py +++ b/platform/setup.py @@ -7,8 +7,9 @@ version = version_file.read().strip() install_requires = [ - "dvp-api == 1.7.0", - "dvp-common == {}".format(version), + "dvp-api == 1.7.0", + "dvp-common == {}".format(version), + "six >= 1.16, < 1.17", ] setuptools.setup(name='dvp-platform', @@ -16,5 +17,5 @@ install_requires=install_requires, package_dir={'': PYTHON_SRC}, packages=setuptools.find_packages(PYTHON_SRC), - python_requires='>=2.7, <3.9, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*, !=3.5.*, !=3.6.*, !=3.7.*', -) + python_requires='>=3.8, <3.9', + ) diff --git a/tools/setup.py b/tools/setup.py index b7b3b633..d7443fbb 100644 --- a/tools/setup.py +++ b/tools/setup.py @@ -7,16 +7,24 @@ version = version_file.read().strip() install_requires = [ + "attrs >= 22.2, < 22.3", + "certifi >= 2022, < 2023", "click == 7.1.2", "click-configfile == 0.2.3", - "dvp-platform == {}".format(version), + "configparser >= 5.3, < 5.4", "dvp-libs == {}".format(version), - "flake8 == 6.0.0", - "jinja2 == 3.1.2", - "jsonschema == 4.17.3", - "pyyaml == 6", - "requests == 2.28.1", - "httpretty == 1.0.5", + "dvp-platform == {}".format(version), + "flake8 >= 6.0, < 6.1", + "httpretty >= 1.0, < 1.1", + "importlib-resources >= 5.10, < 5.11", + "jinja2 >= 3.1, < 3.2", + "jsonschema >= 4.17, < 4.18", + "MarkupSafe >= 2.1, < 2.2", + "pkgutil_resolve_name == 1.3.10", + "pyyaml >= 6, < 7", + "requests >= 2.28, < 2.29", + "six >= 1.16, < 1.17", + "zipp >= 3.11, < 3.12", ] setuptools.setup(name='dvp-tools', @@ -25,4 +33,4 @@ package_dir={'': PYTHON_SRC}, packages=setuptools.find_packages(PYTHON_SRC), python_requires='>=3.8, <3.9', -) + ) From 1a5fb545bd8c75c9c85f011717a72bb966a236d9 Mon Sep 17 00:00:00 2001 From: Sourabh Date: Thu, 5 Jan 2023 10:50:09 +0530 Subject: [PATCH 7/7] adding comment for changes. --- tools/setup.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tools/setup.py b/tools/setup.py index d7443fbb..83952f48 100644 --- a/tools/setup.py +++ b/tools/setup.py @@ -6,6 +6,13 @@ with open(os.path.join(PYTHON_SRC, 'dlpx/virtualization/_internal/VERSION')) as version_file: version = version_file.read().strip() +# +# Update the dependency using below use cases +# 1. Dependency version change does not break test cases or have code issues +# - Only update the maximum version (<). +# 2. Dependency version changes break test cases or have code issues +# - Update the minimum as well as maximum version along with code changes. +# install_requires = [ "attrs >= 22.2, < 22.3", "certifi >= 2022, < 2023",