From 0c47c692fa3f8ae2c360c63d59b91d1beeca4087 Mon Sep 17 00:00:00 2001 From: Lie Ryan Date: Thu, 2 Sep 2021 22:22:28 +1000 Subject: [PATCH 01/20] Fix MoveRefactoring Global and Module Move refactoring requires that `dest` be a rope module, while Method Move refactoring requires that `dest` be an attribute name. --- pymode/rope.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/pymode/rope.py b/pymode/rope.py index ba5f55b2..fc567a12 100644 --- a/pymode/rope.py +++ b/pymode/rope.py @@ -701,6 +701,15 @@ def get_refactor(ctx): offset = None return move.create_move(ctx.project, ctx.resource, offset) + @staticmethod + def get_changes(refactor, input_str, in_hierarchy=False): + with RopeContext() as ctx: + if isinstance(refactor, (move.MoveGlobal, move.MoveModule)): + dest = ctx.project.pycore.find_module(input_str) + else: + dest = input_str + return super(MoveRefactoring, MoveRefactoring).get_changes(refactor, dest, in_hierarchy=in_hierarchy) + class ChangeSignatureRefactoring(Refactoring): From 724d2c4dfeacfdf66e2bde60bac3d4f8bcce76df Mon Sep 17 00:00:00 2001 From: Lie Ryan Date: Thu, 2 Sep 2021 23:12:32 +1000 Subject: [PATCH 02/20] Document how to use Global Move refactoring --- doc/pymode.txt | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/doc/pymode.txt b/doc/pymode.txt index 6d047698..cf5688ab 100644 --- a/doc/pymode.txt +++ b/doc/pymode.txt @@ -613,14 +613,24 @@ code to call it instead. let g:pymode_rope_use_function_bind = 'ru' -Move method/fields ~ +Move refactoring ~ *pymode-rope-move* +Moving method/fields + It happens when you perform move refactoring on a method of a class. In this refactoring, a method of a class is moved to the class of one of its attributes. The old method will call the new method. If you want to change all of the occurrences of the old method to use the new method you can inline it afterwards. + +Moving global variable/class/function into another module + +It happens when you perform move refactoring on global variable/class/function. +In this refactoring, the object being refactored will be moved to a destination +module. All references to the object being moved will be updated to point to +the new location. + > let g:pymode_rope_move_bind = 'rv' From b70ec576e97ff509dd13981ef74383074e906de8 Mon Sep 17 00:00:00 2001 From: Lie Ryan Date: Thu, 2 Sep 2021 23:22:32 +1000 Subject: [PATCH 03/20] Document how to use Module Move refactoring --- doc/pymode.txt | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/doc/pymode.txt b/doc/pymode.txt index cf5688ab..33b2bfa8 100644 --- a/doc/pymode.txt +++ b/doc/pymode.txt @@ -631,6 +631,13 @@ In this refactoring, the object being refactored will be moved to a destination module. All references to the object being moved will be updated to point to the new location. +Moving module variable/class/function into a package + +It happens when you perform move refactoring on a name referencing a module. +In this refactoring, the module being refactored will be moved to a destination +package. All references to the object being moved will be updated to point to +the new location. + > let g:pymode_rope_move_bind = 'rv' From 6c51814bfe723d0bfb2994f4ebd728026f944785 Mon Sep 17 00:00:00 2001 From: Lie Ryan Date: Mon, 20 Sep 2021 03:10:54 +1000 Subject: [PATCH 04/20] Refactor extract get_code_actions() --- pymode/rope.py | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/pymode/rope.py b/pymode/rope.py index ba5f55b2..c15a0018 100644 --- a/pymode/rope.py +++ b/pymode/rope.py @@ -463,10 +463,11 @@ def run(self): if not input_str: return False + code_actions = self.get_code_actions() action = env.user_input_choices( - 'Choose what to do:', 'perform', 'preview', - 'perform in class hierarchy', - 'preview in class hierarchy') + 'Choose what to do:', + *code_actions, + ) in_hierarchy = action.endswith("in class hierarchy") @@ -492,6 +493,14 @@ def run(self): except Exception as e: # noqa env.error('Unhandled exception in Pymode: %s' % e) + def get_code_actions(self): + return [ + 'perform', + 'preview', + 'perform in class hierarchy', + 'preview in class hierarchy', + ] + @staticmethod def get_refactor(ctx): """ Get refactor object. """ From 41ed4df22ba41ed01d15b19bfe2ade0770b95cbb Mon Sep 17 00:00:00 2001 From: Lie Ryan Date: Mon, 20 Sep 2021 03:37:31 +1000 Subject: [PATCH 05/20] Don't present irrelevant in_hierarchy options --- pymode/rope.py | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/pymode/rope.py b/pymode/rope.py index c15a0018..3c0d16ac 100644 --- a/pymode/rope.py +++ b/pymode/rope.py @@ -497,8 +497,6 @@ def get_code_actions(self): return [ 'perform', 'preview', - 'perform in class hierarchy', - 'preview in class hierarchy', ] @staticmethod @@ -555,6 +553,14 @@ def get_input_str(self, refactor, ctx): return newname + def get_code_actions(self): + return [ + 'perform', + 'preview', + 'perform in class hierarchy', + 'preview in class hierarchy', + ] + @staticmethod def get_changes(refactor, input_str, in_hierarchy=False): """ Get changes. @@ -710,6 +716,14 @@ def get_refactor(ctx): offset = None return move.create_move(ctx.project, ctx.resource, offset) + def get_code_actions(self): + return [ + 'perform', + 'preview', + 'perform in class hierarchy', + 'preview in class hierarchy', + ] + class ChangeSignatureRefactoring(Refactoring): @@ -737,6 +751,14 @@ def get_refactor(ctx): return change_signature.ChangeSignature( ctx.project, ctx.resource, offset) + def get_code_actions(self): + return [ + 'perform', + 'preview', + 'perform in class hierarchy', + 'preview in class hierarchy', + ] + def get_changes(self, refactor, input_string, in_hierarchy=False): """ Function description. From 3dc75c2a97e729dc89a9ea3c4b61a9097d1810bf Mon Sep 17 00:00:00 2001 From: Lie Ryan Date: Fri, 25 Nov 2022 17:05:13 +1100 Subject: [PATCH 06/20] Update rope==1.5.1 --- .gitmodules | 9 +++++++++ pymode/libs/appdirs.py | 1 + pymode/libs/pytoolconfig | 1 + pymode/libs/tomli | 1 + submodules/appdirs | 1 + submodules/pytoolconfig | 1 + submodules/rope | 2 +- submodules/tomli | 1 + 8 files changed, 16 insertions(+), 1 deletion(-) create mode 120000 pymode/libs/appdirs.py create mode 120000 pymode/libs/pytoolconfig create mode 120000 pymode/libs/tomli create mode 160000 submodules/appdirs create mode 160000 submodules/pytoolconfig create mode 160000 submodules/tomli diff --git a/.gitmodules b/.gitmodules index 4874edc5..1ef5f423 100644 --- a/.gitmodules +++ b/.gitmodules @@ -48,3 +48,12 @@ [submodule "submodules/toml"] path = submodules/toml url = https://github.com/uiri/toml.git +[submodule "submodules/pytoolconfig"] + path = submodules/pytoolconfig + url = git@github.com:bagel897/pytoolconfig.git +[submodule "submodules/tomli"] + path = submodules/tomli + url = git@github.com:hukkin/tomli.git +[submodule "submodules/appdirs"] + path = submodules/appdirs + url = git@github.com:ActiveState/appdirs.git diff --git a/pymode/libs/appdirs.py b/pymode/libs/appdirs.py new file mode 120000 index 00000000..da7cbf20 --- /dev/null +++ b/pymode/libs/appdirs.py @@ -0,0 +1 @@ +../../submodules/appdirs/appdirs.py \ No newline at end of file diff --git a/pymode/libs/pytoolconfig b/pymode/libs/pytoolconfig new file mode 120000 index 00000000..0a2d520c --- /dev/null +++ b/pymode/libs/pytoolconfig @@ -0,0 +1 @@ +../../submodules/pytoolconfig/pytoolconfig/ \ No newline at end of file diff --git a/pymode/libs/tomli b/pymode/libs/tomli new file mode 120000 index 00000000..2413e2b5 --- /dev/null +++ b/pymode/libs/tomli @@ -0,0 +1 @@ +../../submodules/tomli/src/tomli \ No newline at end of file diff --git a/submodules/appdirs b/submodules/appdirs new file mode 160000 index 00000000..193a2cbb --- /dev/null +++ b/submodules/appdirs @@ -0,0 +1 @@ +Subproject commit 193a2cbba58cce2542882fcedd0e49f6763672ed diff --git a/submodules/pytoolconfig b/submodules/pytoolconfig new file mode 160000 index 00000000..549787fa --- /dev/null +++ b/submodules/pytoolconfig @@ -0,0 +1 @@ +Subproject commit 549787fa7d100c93333f48aaa9b07619f171736e diff --git a/submodules/rope b/submodules/rope index 62af070a..c0433a82 160000 --- a/submodules/rope +++ b/submodules/rope @@ -1 +1 @@ -Subproject commit 62af070aa5ed3505a2629a76778003ce7fd383f0 +Subproject commit c0433a82503ab4f8103f53d82655a004c6f9a93b diff --git a/submodules/tomli b/submodules/tomli new file mode 160000 index 00000000..7e563eed --- /dev/null +++ b/submodules/tomli @@ -0,0 +1 @@ +Subproject commit 7e563eed5286b5d46b8290a9f56a86d955b23a9a From 149ccf7c5be0753f5e9872c023ab2eeec3442105 Mon Sep 17 00:00:00 2001 From: Diego Rabatone Oliveira Date: Fri, 25 Nov 2022 09:28:37 -0300 Subject: [PATCH 07/20] Update git submodule reference to use https instead of git@ --- .gitmodules | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.gitmodules b/.gitmodules index 1ef5f423..59d00541 100644 --- a/.gitmodules +++ b/.gitmodules @@ -50,10 +50,10 @@ url = https://github.com/uiri/toml.git [submodule "submodules/pytoolconfig"] path = submodules/pytoolconfig - url = git@github.com:bagel897/pytoolconfig.git + url = https://github.com/bagel897/pytoolconfig.git [submodule "submodules/tomli"] path = submodules/tomli - url = git@github.com:hukkin/tomli.git + url = https://github.com/hukkin/tomli.git [submodule "submodules/appdirs"] path = submodules/appdirs - url = git@github.com:ActiveState/appdirs.git + url = https://github.com/ActiveState/appdirs.git From dedf83eb162f5ba91ed0cbd176fa69625af24859 Mon Sep 17 00:00:00 2001 From: Diego Rabatone Oliveira Date: Fri, 23 Jun 2023 23:41:26 -0300 Subject: [PATCH 08/20] Bump dependencies --- submodules/astroid | 2 +- submodules/autopep8 | 2 +- submodules/mccabe | 2 +- submodules/pycodestyle | 2 +- submodules/pyflakes | 2 +- submodules/pylama | 2 +- submodules/pylint | 2 +- submodules/rope | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) diff --git a/submodules/astroid b/submodules/astroid index 36dda3fc..8523ba82 160000 --- a/submodules/astroid +++ b/submodules/astroid @@ -1 +1 @@ -Subproject commit 36dda3fc8a5826b19a33a0ff29402b61d6a64fc2 +Subproject commit 8523ba827006d56a770a1f6efa77215718ef26c0 diff --git a/submodules/autopep8 b/submodules/autopep8 index 32c78a3a..6e6d4ba4 160000 --- a/submodules/autopep8 +++ b/submodules/autopep8 @@ -1 +1 @@ -Subproject commit 32c78a3a07d7ee35500e6f20bfcd621f3132c42e +Subproject commit 6e6d4ba4a043da1a56ca0ec7280a7d4f40283215 diff --git a/submodules/mccabe b/submodules/mccabe index 2d4dd943..85185224 160000 --- a/submodules/mccabe +++ b/submodules/mccabe @@ -1 +1 @@ -Subproject commit 2d4dd9435fcb05aaa89ba0392a84cb1d30a87dc9 +Subproject commit 851852240f2fa4453c226ccc5ae88bc03b467388 diff --git a/submodules/pycodestyle b/submodules/pycodestyle index 930e2cad..1063db87 160000 --- a/submodules/pycodestyle +++ b/submodules/pycodestyle @@ -1 +1 @@ -Subproject commit 930e2cad15df3661306740c30a892a6f1902ef1d +Subproject commit 1063db8747e7d4e213160458aa3792e5ec05bc10 diff --git a/submodules/pyflakes b/submodules/pyflakes index 95fe313b..b37f91a1 160000 --- a/submodules/pyflakes +++ b/submodules/pyflakes @@ -1 +1 @@ -Subproject commit 95fe313ba5ca384041472cd171ea60fad910c207 +Subproject commit b37f91a1ae25cfc242d5043985b05159e152091a diff --git a/submodules/pylama b/submodules/pylama index f436ccc6..53ad214d 160000 --- a/submodules/pylama +++ b/submodules/pylama @@ -1 +1 @@ -Subproject commit f436ccc6b55b33381a295ded753e467953cf4379 +Subproject commit 53ad214de0aa9534e59bcd5f97d9d723d16cfdb8 diff --git a/submodules/pylint b/submodules/pylint index 3eb0362d..fc34a4b6 160000 --- a/submodules/pylint +++ b/submodules/pylint @@ -1 +1 @@ -Subproject commit 3eb0362dc42642e3e2774d7523a1e73d71394064 +Subproject commit fc34a4b6abe56f3ac07ca15d846b1c1955545f85 diff --git a/submodules/rope b/submodules/rope index c0433a82..b0c8a5fc 160000 --- a/submodules/rope +++ b/submodules/rope @@ -1 +1 @@ -Subproject commit c0433a82503ab4f8103f53d82655a004c6f9a93b +Subproject commit b0c8a5fc03ecbc94bd85dff46fc8b3f98f26a91e From 25b30ced6e9545a53a6bceb3bde3c5d95630f649 Mon Sep 17 00:00:00 2001 From: Diego Rabatone Oliveira Date: Fri, 23 Jun 2023 23:49:23 -0300 Subject: [PATCH 09/20] Fix pylama import --- pymode/lint.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pymode/lint.py b/pymode/lint.py index ba187558..c03bd255 100644 --- a/pymode/lint.py +++ b/pymode/lint.py @@ -6,7 +6,7 @@ import os.path -from pylama.lint.extensions import LINTERS +from pylama.lint import LINTERS try: from pylama.lint.pylama_pylint import Linter @@ -35,11 +35,11 @@ def code_check(): # Fixed in v0.9.3: these two parameters may be passed as strings. # DEPRECATE: v:0.10.0: need to be set as lists. if isinstance(env.var('g:pymode_lint_ignore'), str): - raise ValueError ('g:pymode_lint_ignore should have a list type') + raise ValueError('g:pymode_lint_ignore should have a list type') else: ignore = env.var('g:pymode_lint_ignore') if isinstance(env.var('g:pymode_lint_select'), str): - raise ValueError ('g:pymode_lint_select should have a list type') + raise ValueError('g:pymode_lint_select should have a list type') else: select = env.var('g:pymode_lint_select') options = parse_options( From 4ad80be8bb9a0e55422ac0ee9654e9506be00e4a Mon Sep 17 00:00:00 2001 From: Diego Rabatone Oliveira Date: Sat, 24 Jun 2023 00:16:57 -0300 Subject: [PATCH 10/20] Fix shellcheck in test --- tests/test.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/test.sh b/tests/test.sh index fe9fcae1..48345ad5 100755 --- a/tests/test.sh +++ b/tests/test.sh @@ -4,7 +4,7 @@ set -e which vim 1>/dev/null 2>/dev/null -cd $(dirname $0) +cd "$(dirname "$0")" # Source common variables. source ./test_helpers_bash/test_variables.sh @@ -49,7 +49,7 @@ RETURN_CODES=$(cat $VIM_OUTPUT_FILE | grep -i "Return code") echo -e "${RETURN_CODES}" # Exit the script with error if there are any return codes different from 0. -if echo $RETURN_CODES | grep -E "Return code: [1-9]" 1>/dev/null 2>/dev/null +if echo "${RETURN_CODES}" | grep -E "Return code: [1-9]" 1>/dev/null 2>/dev/null then exit 1 else From 74a7c7bf17fa48d46f4265be55ea6bf0e99bfc55 Mon Sep 17 00:00:00 2001 From: Diego Rabatone Oliveira Date: Sat, 24 Jun 2023 00:32:49 -0300 Subject: [PATCH 11/20] Fix import error --- pymode/lint.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pymode/lint.py b/pymode/lint.py index c03bd255..d7d24449 100644 --- a/pymode/lint.py +++ b/pymode/lint.py @@ -65,7 +65,8 @@ def code_check(): return env.stop() if env.options.get('debug'): - from pylama.core import LOGGER, logging + import logging + from pylama.core import LOGGER LOGGER.setLevel(logging.DEBUG) errors = run(path, code='\n'.join(env.curbuf) + '\n', options=options) From d89385a205c23670456723a7f57cdb5e1b1e2acd Mon Sep 17 00:00:00 2001 From: Diego Rabatone Oliveira Date: Sat, 24 Jun 2023 01:23:32 -0300 Subject: [PATCH 12/20] Fix erros due to pylama Erro class changes --- pymode/lint.py | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/pymode/lint.py b/pymode/lint.py index d7d24449..c5304043 100644 --- a/pymode/lint.py +++ b/pymode/lint.py @@ -84,11 +84,16 @@ def __sort(e): env.debug("Find sorting: ", sort_rules) errors = sorted(errors, key=__sort) + errors_list = [] for e in errors: - e._info['bufnr'] = env.curbuf.number - if e._info['col'] is None: - e._info['col'] = 1 - - env.run('g:PymodeLocList.current().extend', [e._info for e in errors]) + if e.col is None: + e.col = 1 + err_dict = e.to_dict() + err_dict['bufnr'] = env.curbuf.number + err_dict['type'] = e.etype + err_dict['text'] = e.message + errors_list.append(err_dict) + + env.run('g:PymodeLocList.current().extend', errors_list) # pylama:ignore=W0212,E1103 From d44851ce678d53832f5fc021e1f845eb5290645a Mon Sep 17 00:00:00 2001 From: Diego Rabatone Oliveira Date: Sat, 24 Jun 2023 10:18:06 -0300 Subject: [PATCH 13/20] Improve tests outputs --- tests/test.sh | 6 +++--- tests/test_bash/test_autocommands.sh | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/test.sh b/tests/test.sh index 48345ad5..acf75076 100755 --- a/tests/test.sh +++ b/tests/test.sh @@ -26,9 +26,9 @@ declare -a TEST_ARRAY=( set +e for ONE_TEST in "${TEST_ARRAY[@]}" do - echo "Starting test: $ONE_TEST" >> $VIM_OUTPUT_FILE - bash -x "$ONE_TEST" - echo -e "\n$ONE_TEST: Return code: $?" >> $VIM_OUTPUT_FILE + echo "Starting test: $ONE_TEST" | tee $VIM_OUTPUT_FILE + bash "$ONE_TEST" + echo -e "\n$ONE_TEST: Return code: $?" | tee $VIM_OUTPUT_FILE bash ./test_helpers_bash/test_prepare_between_tests.sh done diff --git a/tests/test_bash/test_autocommands.sh b/tests/test_bash/test_autocommands.sh index bc46b9d5..9fabebfd 100644 --- a/tests/test_bash/test_autocommands.sh +++ b/tests/test_bash/test_autocommands.sh @@ -19,7 +19,7 @@ declare -a TEST_PYMODE_COMMANDS_ARRAY=( set +e for ONE_PYMODE_COMMANDS_TEST in "${TEST_PYMODE_COMMANDS_ARRAY[@]}" do - echo "Starting test: $0:$ONE_PYMODE_COMMANDS_TEST" >> $VIM_OUTPUT_FILE + echo "Starting test: $0:$ONE_PYMODE_COMMANDS_TEST" | tee $VIM_OUTPUT_FILE RETURN_CODE=$(vim --clean -i NONE -u $VIM_TEST_VIMRC -c "source $ONE_PYMODE_COMMANDS_TEST" $VIM_DISPOSABLE_PYFILE > /dev/null 2>&1) ### Enable the following to execute one test at a time. @@ -27,7 +27,7 @@ do ### FOR PINPOINT TESTING ### exit 1 RETURN_CODE=$? - echo -e "\n$0:$ONE_PYMODE_COMMANDS_TEST: Return code: $RETURN_CODE" >> $VIM_OUTPUT_FILE + echo -e "\n$0:$ONE_PYMODE_COMMANDS_TEST: Return code: $RETURN_CODE" | tee $VIM_OUTPUT_FILE bash ./test_helpers_bash/test_prepare_between_tests.sh done From a4731b47b1847bbf80eb7c5d5a6cee50a2b42b48 Mon Sep 17 00:00:00 2001 From: Diego Rabatone Oliveira Date: Sat, 24 Jun 2023 15:54:15 -0300 Subject: [PATCH 14/20] [Tests] apply shellcheck on shell test files and import tests outputs --- tests/test.sh | 41 ++++++++-------- tests/test_bash/test_autocommands.sh | 12 +++-- tests/test_bash/test_autopep8.sh | 5 +- tests/test_bash/test_folding.sh | 47 +++++++------------ tests/test_bash/test_pymodelint.sh | 9 ++-- tests/test_bash/test_textobject.sh | 12 ++--- tests/test_helpers_bash/test_createvimrc.sh | 45 +++++++++--------- .../test_prepare_between_tests.sh | 9 ++-- tests/test_helpers_bash/test_prepare_once.sh | 4 +- tests/test_helpers_bash/test_variables.sh | 12 +++-- 10 files changed, 97 insertions(+), 99 deletions(-) diff --git a/tests/test.sh b/tests/test.sh index acf75076..eb4ec018 100755 --- a/tests/test.sh +++ b/tests/test.sh @@ -22,38 +22,37 @@ declare -a TEST_ARRAY=( "./test_bash/test_folding.sh" "./test_bash/test_textobject.sh" ) +MAIN_RETURN=0 ## now loop through the above array set +e -for ONE_TEST in "${TEST_ARRAY[@]}" +for TEST in "${TEST_ARRAY[@]}" do - echo "Starting test: $ONE_TEST" | tee $VIM_OUTPUT_FILE - bash "$ONE_TEST" - echo -e "\n$ONE_TEST: Return code: $?" | tee $VIM_OUTPUT_FILE + echo "Starting test: ${TEST}" | tee -a "${VIM_OUTPUT_FILE}" + bash "${TEST}" + R=$? + MAIN_RETURN=$(( MAIN_RETURN + R )) + echo -e "${TEST}: Return code: ${R}\n" | tee -a "${VIM_OUTPUT_FILE}" bash ./test_helpers_bash/test_prepare_between_tests.sh done -# Show errors: -E1=$(grep -E "^E[0-9]+:" $VIM_OUTPUT_FILE) -E2=$(grep -E "^Error" $VIM_OUTPUT_FILE) -E3="$E1\n$E2" -if [ "$E3" = "\n" ] -then - echo "No errors." -else - echo "Errors:" - echo -e "$E3\n" -fi +echo "=========================================================================" +echo " RESULTS" +echo "=========================================================================" # Show return codes. -RETURN_CODES=$(cat $VIM_OUTPUT_FILE | grep -i "Return code") +RETURN_CODES=$(grep -i "Return code" < "${VIM_OUTPUT_FILE}" | grep -v "Return code: 0") echo -e "${RETURN_CODES}" -# Exit the script with error if there are any return codes different from 0. -if echo "${RETURN_CODES}" | grep -E "Return code: [1-9]" 1>/dev/null 2>/dev/null -then - exit 1 +# Show errors: +E1=$(grep -E "^E[0-9]+:" "${VIM_OUTPUT_FILE}") +E2=$(grep -Ei "^Error" "${VIM_OUTPUT_FILE}") +if [[ "${MAIN_RETURN}" == "0" ]]; then + echo "No errors." else - exit 0 + echo "Errors:" + echo -e "${E1}\n${E2}" fi +# Exit the script with error if there are any return codes different from 0. +exit ${MAIN_RETURN} # vim: set fileformat=unix filetype=sh wrap tw=0 : diff --git a/tests/test_bash/test_autocommands.sh b/tests/test_bash/test_autocommands.sh index 9fabebfd..89d8a70d 100644 --- a/tests/test_bash/test_autocommands.sh +++ b/tests/test_bash/test_autocommands.sh @@ -15,20 +15,24 @@ declare -a TEST_PYMODE_COMMANDS_ARRAY=( ### FOR PINPOINT TESTING ### "./test_procedures_vimscript/pymoderun.vim" ### FOR PINPOINT TESTING ### ) +RETURN_CODE=0 + ## now loop through the above array set +e for ONE_PYMODE_COMMANDS_TEST in "${TEST_PYMODE_COMMANDS_ARRAY[@]}" do - echo "Starting test: $0:$ONE_PYMODE_COMMANDS_TEST" | tee $VIM_OUTPUT_FILE - RETURN_CODE=$(vim --clean -i NONE -u $VIM_TEST_VIMRC -c "source $ONE_PYMODE_COMMANDS_TEST" $VIM_DISPOSABLE_PYFILE > /dev/null 2>&1) + CONTENT="$(vim --clean -i NONE -u "${VIM_TEST_VIMRC}" -c "source ${ONE_PYMODE_COMMANDS_TEST}" "${VIM_DISPOSABLE_PYFILE}" 2>&1)" ### Enable the following to execute one test at a time. ### FOR PINPOINT TESTING ### vim --clean -i NONE -u $VIM_TEST_VIMRC -c "source $ONE_PYMODE_COMMANDS_TEST" $VIM_DISPOSABLE_PYFILE ### FOR PINPOINT TESTING ### exit 1 - RETURN_CODE=$? - echo -e "\n$0:$ONE_PYMODE_COMMANDS_TEST: Return code: $RETURN_CODE" | tee $VIM_OUTPUT_FILE + SUB_TEST_RETURN_CODE=$? + echo -e "${CONTENT}" >> "${VIM_OUTPUT_FILE}" + RETURN_CODE=$(( RETURN_CODE + SUB_TEST_RETURN_CODE )) + echo -e "\tSubTest: $0:${ONE_PYMODE_COMMANDS_TEST}: Return code: ${SUB_TEST_RETURN_CODE}" | tee -a "${VIM_OUTPUT_FILE}" bash ./test_helpers_bash/test_prepare_between_tests.sh done +exit ${RETURN_CODE} # vim: set fileformat=unix filetype=sh wrap tw=0 : diff --git a/tests/test_bash/test_autopep8.sh b/tests/test_bash/test_autopep8.sh index 05585725..2a70072a 100644 --- a/tests/test_bash/test_autopep8.sh +++ b/tests/test_bash/test_autopep8.sh @@ -2,9 +2,10 @@ # Source file. set +e -RETURN_CODE=$(vim --clean -i NONE -u $VIM_TEST_VIMRC -c "source ./test_procedures_vimscript/autopep8.vim" $VIM_DISPOSABLE_PYFILE > /dev/null 2>&1) +CONTENT="$(vim --clean -i NONE -u "${VIM_TEST_VIMRC}" -c "source ./test_procedures_vimscript/autopep8.vim" "${VIM_DISPOSABLE_PYFILE}" 2>&1)" RETURN_CODE=$? +echo -e "${CONTENT}" >> "${VIM_OUTPUT_FILE}" set -e -exit $RETURN_CODE +exit ${RETURN_CODE} # vim: set fileformat=unix filetype=sh wrap tw=0 : diff --git a/tests/test_bash/test_folding.sh b/tests/test_bash/test_folding.sh index d0ac884a..60e60c42 100644 --- a/tests/test_bash/test_folding.sh +++ b/tests/test_bash/test_folding.sh @@ -2,35 +2,24 @@ # Note: a solution with unix 'timeout' program was tried but it was unsuccessful. The problem with folding 4 is that in the case of a crash one expects the folding to just stay in an infinite loop, thus never existing with error. An improvement is suggested to this case. -# Source file. -set +e -source ./test_helpers_bash/test_prepare_between_tests.sh -vim --clean -i NONE -u $VIM_TEST_VIMRC -c "source ./test_procedures_vimscript/folding1.vim" $VIM_DISPOSABLE_PYFILE > /dev/null -R1=$? -source ./test_helpers_bash/test_prepare_between_tests.sh -vim --clean -i NONE -u $VIM_TEST_VIMRC -c "source ./test_procedures_vimscript/folding2.vim" $VIM_DISPOSABLE_PYFILE > /dev/null -R2=$? -source ./test_helpers_bash/test_prepare_between_tests.sh -# TODO: enable folding3.vim script back. -# vim --clean -i NONE -u $VIM_TEST_VIMRC -c "source ./test_procedures_vimscript/folding3.vim" $VIM_DISPOSABLE_PYFILE > /dev/null -# R3=$? -source ./test_helpers_bash/test_prepare_between_tests.sh -vim --clean -i NONE -u $VIM_TEST_VIMRC -c "source ./test_procedures_vimscript/folding4.vim" $VIM_DISPOSABLE_PYFILE > /dev/null -R4=$? -set -e +declare -a TEST_PYMODE_FOLDING_TESTS_ARRAY=( + "./test_procedures_vimscript/folding1.vim" + "./test_procedures_vimscript/folding2.vim" + # "./test_procedures_vimscript/folding3.vim" + "./test_procedures_vimscript/folding4.vim" + ) + +RETURN_CODE=0 -if [[ "$R1" -ne 0 ]] -then - exit 1 -elif [[ "$R2" -ne 0 ]] -then - exit 2 -# elif [[ "$R3" -ne 0 ]] -# then -# exit 3 -elif [[ "$R4" -ne 0 ]] -then - exit 4 -fi +set +e +for SUB_TEST in "${TEST_PYMODE_FOLDING_TESTS_ARRAY[@]}"; do + CONTENT="$(vim --clean -i NONE -u "${VIM_TEST_VIMRC}" -c "source ${SUB_TEST}" "${VIM_DISPOSABLE_PYFILE}" 2>&1)" + SUB_TEST_RETURN_CODE=$? + echo -e "${CONTENT}" >> "${VIM_OUTPUT_FILE}" + RETURN_CODE=$(( RETURN_CODE + SUB_TEST_RETURN_CODE )) + echo -e "\tSubTest: $0:${SUB_TEST}: Return code: ${SUB_TEST_RETURN_CODE}" | tee -a "${VIM_OUTPUT_FILE}" + bash ./test_helpers_bash/test_prepare_between_tests.sh +done +exit ${RETURN_CODE} # vim: set fileformat=unix filetype=sh wrap tw=0 : diff --git a/tests/test_bash/test_pymodelint.sh b/tests/test_bash/test_pymodelint.sh index 583d0774..9f903955 100644 --- a/tests/test_bash/test_pymodelint.sh +++ b/tests/test_bash/test_pymodelint.sh @@ -5,10 +5,11 @@ # Source file. set +e -vim --clean -i NONE -u $VIM_TEST_VIMRC -c "source ./test_procedures_vimscript/pymodelint.vim" $VIM_DISPOSABLE_PYFILE -# RETURN_CODE=$(vim --clean -i NONE -u $VIM_TEST_VIMRC -c "source ./test_procedures_vimscript/pymodeversion.vim" $VIM_DISPOSABLE_PYFILE > /dev/null 2>&1) -# RETURN_CODE=$? +# vim --clean -i NONE -u "${VIM_TEST_VIMRC}" -c "source ./test_procedures_vimscript/pymodelint.vim" "${VIM_DISPOSABLE_PYFILE}" >> "${VIM_OUTPUT_FILE}" 2>&1 +CONTENT="$(vim --clean -i NONE -u "${VIM_TEST_VIMRC}" -c "source ./test_procedures_vimscript/pymodeversion.vim" "${VIM_DISPOSABLE_PYFILE}" 2>&1)" +RETURN_CODE=$? +echo -e "${CONTENT}" >> "${VIM_OUTPUT_FILE}" set -e -# exit $RETURN_CODE +exit ${RETURN_CODE} # vim: set fileformat=unix filetype=sh wrap tw=0 : diff --git a/tests/test_bash/test_textobject.sh b/tests/test_bash/test_textobject.sh index 43a799f9..cf90c87a 100644 --- a/tests/test_bash/test_textobject.sh +++ b/tests/test_bash/test_textobject.sh @@ -2,14 +2,12 @@ # Source file. set +e +# shellcheck source=../test_helpers_bash/test_prepare_between_tests.sh source ./test_helpers_bash/test_prepare_between_tests.sh -vim --clean -i NONE -u $VIM_TEST_VIMRC -c "source ./test_procedures_vimscript/textobject.vim" $VIM_DISPOSABLE_PYFILE > /dev/null -R1=$? +CONTENT="$(vim --clean -i NONE -u "${VIM_TEST_VIMRC}" -c "source ./test_procedures_vimscript/textobject.vim" "${VIM_DISPOSABLE_PYFILE}" 2>&1)" +RETURN_CODE=$? +echo -e "${CONTENT}" >> "${VIM_OUTPUT_FILE}" set -e -if [[ "$R1" -ne 0 ]] -then - exit 1 -fi - +exit ${RETURN_CODE} # vim: set fileformat=unix filetype=sh wrap tw=0 : diff --git a/tests/test_helpers_bash/test_createvimrc.sh b/tests/test_helpers_bash/test_createvimrc.sh index ae763b95..d816df98 100644 --- a/tests/test_helpers_bash/test_createvimrc.sh +++ b/tests/test_helpers_bash/test_createvimrc.sh @@ -1,26 +1,27 @@ #! /bin/bash # Create minimal vimrc. -echo -e "syntax on\nfiletype plugin indent on\nset nocompatible" >> $VIM_TEST_VIMRC -echo "call has('python3')" >> $VIM_TEST_VIMRC -echo "set paste" >> $VIM_TEST_VIMRC -echo "set shortmess=at" >> $VIM_TEST_VIMRC -echo "set cmdheight=10" >> $VIM_TEST_VIMRC -echo "set ft=python" >> $VIM_TEST_VIMRC -echo "set shell=bash" >> $VIM_TEST_VIMRC -echo "set noswapfile" >> $VIM_TEST_VIMRC -echo "set backupdir=" >> $VIM_TEST_VIMRC -echo "set undodir=" >> $VIM_TEST_VIMRC -echo "set viewdir=" >> $VIM_TEST_VIMRC -echo "set directory=" >> $VIM_TEST_VIMRC -echo -e "set runtimepath=" >> $VIM_TEST_VIMRC -echo -e "set runtimepath+=$(dirname $PWD)\n" >> $VIM_TEST_VIMRC -echo -e "set packpath+=/tmp\n" >> $VIM_TEST_VIMRC -# echo -e "redir! >> $VIM_OUTPUT_FILE\n" >> $VIM_TEST_VIMRC -echo -e "set verbosefile=$VIM_OUTPUT_FILE\n" >> $VIM_TEST_VIMRC -echo -e "let g:pymode_debug = 1" >> $VIM_TEST_VIMRC - -echo "set nomore" >> $VIM_TEST_VIMRC - - +cat <<-EOF >> "${VIM_TEST_VIMRC}" + syntax on + filetype plugin indent on + set nocompatible + call has('python3') + set paste + set shortmess=at + set cmdheight=10 + set ft=python + set shell=bash + set noswapfile + set backupdir= + set undodir= + set viewdir= + set directory= + set runtimepath= + set runtimepath+="$(dirname "${PWD}")" + set packpath+=/tmp + " redir! >> "${VIM_OUTPUT_FILE}" + set verbosefile="${VIM_OUTPUT_FILE}" + let g:pymode_debug = 1 + set nomore +EOF # vim: set fileformat=unix filetype=sh wrap tw=0 : diff --git a/tests/test_helpers_bash/test_prepare_between_tests.sh b/tests/test_helpers_bash/test_prepare_between_tests.sh index cdce9869..7a8f52e7 100644 --- a/tests/test_helpers_bash/test_prepare_between_tests.sh +++ b/tests/test_helpers_bash/test_prepare_between_tests.sh @@ -2,11 +2,12 @@ # Prepare tests. set +e -if [ -f $VIM_DISPOSABLE_PYFILE ]; then - rm $VIM_DISPOSABLE_PYFILE +if [ -f "${VIM_DISPOSABLE_PYFILE}" ]; then + rm "${VIM_DISPOSABLE_PYFILE}" fi -export VIM_DISPOSABLE_PYFILE=`mktemp /tmp/pymode.tmpfile.XXXXXXXXXX.py` +VIM_DISPOSABLE_PYFILE="$(mktemp /tmp/pymode.tmpfile.XXXXXXXXXX.py)" +export VIM_DISPOSABLE_PYFILE set -e -touch $VIM_DISPOSABLE_PYFILE +touch "${VIM_DISPOSABLE_PYFILE}" # vim: set fileformat=unix filetype=sh wrap tw=0 : diff --git a/tests/test_helpers_bash/test_prepare_once.sh b/tests/test_helpers_bash/test_prepare_once.sh index dad77182..da986b53 100644 --- a/tests/test_helpers_bash/test_prepare_once.sh +++ b/tests/test_helpers_bash/test_prepare_once.sh @@ -2,11 +2,11 @@ # Prepare tests. set +e -rm $VIM_OUTPUT_FILE $VIM_TEST_VIMRC $VIM_TEST_PYMODECOMMANDS $VIM_DISPOSABLE_PYFILE 2&>/dev/null +rm "${VIM_OUTPUT_FILE}" "${VIM_TEST_VIMRC}" "${VIM_TEST_PYMODECOMMANDS}" "${VIM_DISPOSABLE_PYFILE}" 2&>/dev/null rm /tmp/*pymode* 2&>/dev/null rm -rf /tmp/pack mkdir -p /tmp/pack/test_plugins/start -ln -s $(dirname $(pwd)) /tmp/pack/test_plugins/start/ +ln -s "$(dirname "$(pwd)")" /tmp/pack/test_plugins/start/ set -e # vim: set fileformat=unix filetype=sh wrap tw=0 : diff --git a/tests/test_helpers_bash/test_variables.sh b/tests/test_helpers_bash/test_variables.sh index 53edb5e5..f1995022 100644 --- a/tests/test_helpers_bash/test_variables.sh +++ b/tests/test_helpers_bash/test_variables.sh @@ -3,9 +3,13 @@ # Define variables for common test scripts. # Set variables. -export VIM_DISPOSABLE_PYFILE=`mktemp /tmp/pymode.tmpfile.XXXXXXXXXX.py` -export VIM_OUTPUT_FILE=/tmp/pymode.out -export VIM_TEST_VIMRC=/tmp/pymode_vimrc -export VIM_TEST_PYMODECOMMANDS=/tmp/pymode_commands.txt +VIM_DISPOSABLE_PYFILE="$(mktemp /tmp/pymode.tmpfile.XXXXXXXXXX.py)" +export VIM_DISPOSABLE_PYFILE +VIM_OUTPUT_FILE=/tmp/pymode.out +export VIM_OUTPUT_FILE +VIM_TEST_VIMRC=/tmp/pymode_vimrc +export VIM_TEST_VIMRC +VIM_TEST_PYMODECOMMANDS=/tmp/pymode_commands.txt +export VIM_TEST_PYMODECOMMANDS # vim: set fileformat=unix filetype=sh wrap tw=0 : From a87f7896ea847c91f3b08ea1c95bf0f1043ebaf3 Mon Sep 17 00:00:00 2001 From: Diego Rabatone Oliveira Date: Sun, 2 Jul 2023 22:17:01 -0300 Subject: [PATCH 15/20] Replace pep8 with pycodestyle For more info see: https://github.com/python-mode/python-mode/pull/1170#issuecomment-1610771071 --- doc/pymode.txt | 10 +++++----- plugin/pymode.vim | 8 ++++---- pymode/lint.py | 6 ++++++ tests/utils/pymoderc | 4 ++-- 4 files changed, 17 insertions(+), 11 deletions(-) diff --git a/doc/pymode.txt b/doc/pymode.txt index c8f9dd2b..3565a4c3 100644 --- a/doc/pymode.txt +++ b/doc/pymode.txt @@ -293,7 +293,7 @@ Manually set breakpoint command (leave empty for automatic detection) 3. Code checking ~ *pymode-lint* -Pymode supports `pylint`, `pep257`, `pep8`, `pyflakes`, `mccabe` code +Pymode supports `pylint`, `pep257`, `pycodestyle`, `pyflakes`, `mccabe` code checkers. You could run several similar checkers. Pymode uses Pylama library for code checking. Many options like skip @@ -330,9 +330,9 @@ Show error message if cursor placed at the error line *'g:pymode_lint_message' Default code checkers (you could set several) *'g:pymode_lint_checkers'* > - let g:pymode_lint_checkers = ['pyflakes', 'pep8', 'mccabe'] + let g:pymode_lint_checkers = ['pyflakes', 'pycodestyle', 'mccabe'] -Values may be chosen from: `pylint`, `pep8`, `mccabe`, `pep257`, `pyflakes`. +Values may be chosen from: `pylint`, `pycodestyle`, `mccabe`, `pep257`, `pyflakes`. Skip errors and warnings *'g:pymode_lint_ignore'* E.g. ["W", "E2"] (Skip all Warnings and the Errors starting with E2) etc. @@ -376,9 +376,9 @@ Definitions for |signs| Pymode has the ability to set code checkers options from pymode variables: -Set PEP8 options *'g:pymode_lint_options_pep8'* +Set PEP8 options *'g:pymode_lint_options_pycodestyle'* > - let g:pymode_lint_options_pep8 = + let g:pymode_lint_options_pycodestyle = \ {'max_line_length': g:pymode_options_max_line_length} See https://pep8.readthedocs.org/en/1.4.6/intro.html#configuration for more diff --git a/plugin/pymode.vim b/plugin/pymode.vim index 232dc2af..82ab95ff 100644 --- a/plugin/pymode.vim +++ b/plugin/pymode.vim @@ -122,8 +122,8 @@ call pymode#default("g:pymode_lint_on_fly", 0) " Show message about error in command line call pymode#default("g:pymode_lint_message", 1) -" Choices are: pylint, pyflakes, pep8, mccabe and pep257 -call pymode#default("g:pymode_lint_checkers", ['pyflakes', 'pep8', 'mccabe']) +" Choices are: pylint, pyflakes, pycodestyle, mccabe and pep257 +call pymode#default("g:pymode_lint_checkers", ['pyflakes', 'pycodestyle', 'mccabe']) " Skip errors and warnings (e.g. E4,W) call pymode#default("g:pymode_lint_ignore", []) @@ -152,8 +152,8 @@ call pymode#default("g:pymode_lint_info_symbol", "II") call pymode#default("g:pymode_lint_pyflakes_symbol", "FF") " Code checkers options -" TODO: check if most adequate name name is pep8 or pycodestyle. -call pymode#default("g:pymode_lint_options_pep8", +" TODO: check if most adequate name name is pycodestyle. +call pymode#default("g:pymode_lint_options_pycodestyle", \ {'max_line_length': g:pymode_options_max_line_length}) call pymode#default("g:pymode_lint_options_pylint", diff --git a/pymode/lint.py b/pymode/lint.py index c5304043..b0103a50 100644 --- a/pymode/lint.py +++ b/pymode/lint.py @@ -42,6 +42,12 @@ def code_check(): raise ValueError('g:pymode_lint_select should have a list type') else: select = env.var('g:pymode_lint_select') + if 'pep8' in linters: + # TODO: Add a user visible deprecation warning here + env.message('pep8 linter is deprecated, please use pycodestyle.') + linters.remove('pep8') + linters.append('pycodestyle') + options = parse_options( linters=linters, force=1, ignore=ignore, diff --git a/tests/utils/pymoderc b/tests/utils/pymoderc index 222c6ceb..3a8477ea 100644 --- a/tests/utils/pymoderc +++ b/tests/utils/pymoderc @@ -25,7 +25,7 @@ let g:pymode_lint_on_write = 1 let g:pymode_lint_unmodified = 0 let g:pymode_lint_on_fly = 0 let g:pymode_lint_message = 1 -let g:pymode_lint_checkers = ['pyflakes', 'pep8', 'mccabe'] +let g:pymode_lint_checkers = ['pyflakes', 'pycodestyle', 'mccabe'] let g:pymode_lint_ignore = ["E501", "W",] let g:pymode_lint_select = ["E501", "W0011", "W430"] let g:pymode_lint_sort = [] @@ -37,7 +37,7 @@ let g:pymode_lint_visual_symbol = 'RR' let g:pymode_lint_error_symbol = 'EE' let g:pymode_lint_info_symbol = 'II' let g:pymode_lint_pyflakes_symbol = 'FF' -let g:pymode_lint_options_pep8 = +let g:pymode_lint_options_pycodestyle = \ {'max_line_length': g:pymode_options_max_line_length} let g:pymode_lint_options_pyflakes = { 'builtins': '_' } let g:pymode_lint_options_mccabe = { 'complexity': 12 } From a28ace5bee0ea292be9f979f3c651c47cc39b284 Mon Sep 17 00:00:00 2001 From: Diego Rabatone Oliveira Date: Sun, 2 Jul 2023 22:20:11 -0300 Subject: [PATCH 16/20] Update changelog --- CHANGELOG.md | 36 ++++++++++++++++++++++++++++++++++-- 1 file changed, 34 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 001a9194..f8e3dbf7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,10 +2,36 @@ ## TODO +- Update submodules + - Fix Errors related to these updates +- Improve tests outputs +- Fix Global and Module MoveRefactoring (#1141) Thanks to @lieryan +- Text object/operator/motion mapping to select logical line (#1145). Thanks to + @lieryan +- Remove dead keywords and builtins; add match, case (#1149). Thanks to + @NeilGirdhar +- Add syntax highlight for walrus (#1147) Thanks to @fpob +- Add configurable prefix for rope commands (#1137) TThanks to @NathanTP +- Add option g:pymode_indent_hanging_width for different hanging indentation + width (#1138). Thanks to @wookayin + +## 2020-10-08 0.13.0 + +- Add toml submodule + +## 2020-10-08 0.12.0 + +- Improve breakpoint feature +- Improve debugging script +- Update submodules +- Improve tests + +## 2020-05-28 0.11.0 + - Move changelog rst syntax to markdown - `pymode_rope`: check disables -- Remove supoort for python 2. From 0.11.0 on we will focus on supporting - python 3+ (probably 3.5+). +- BREAKING CHANGE: Remove supoort for python 2. From 0.11.0 on we will focus on + supporting python 3+ (probably 3.5+). - Inspect why files starting with the following code do not get loaded: ```python @@ -16,6 +42,12 @@ main() ``` +- added github actions test suit and remove travis +- improved submodules cloning (shallow) +- Removes `six` submodule +- Fix motion mapping +- Fix breakpoint feature + ## 2019-05-11 0.10.0 After many changes, including moving most of our dependencies from copied From aee5c38a63b5d191ca1e0304903f1aa57256d5a5 Mon Sep 17 00:00:00 2001 From: Diego Rabatone Oliveira Date: Sun, 2 Jul 2023 22:22:56 -0300 Subject: [PATCH 17/20] Update bumpversion --- .bumpversion.cfg | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.bumpversion.cfg b/.bumpversion.cfg index 613addba..0eda784d 100644 --- a/.bumpversion.cfg +++ b/.bumpversion.cfg @@ -8,3 +8,7 @@ tag_name = {new_version} [bumpversion:file:doc/pymode.txt] search = Version: {current_version} replace = Version: {new_version} + +[bumpversion:file:CHANGELOG.md] +search = Version: {current_version} +replace = Version: {new_version} From d69efa5624a60244b94d47d09e7309e0ac04b8e9 Mon Sep 17 00:00:00 2001 From: Diego Rabatone Oliveira Date: Sun, 2 Jul 2023 22:20:47 -0300 Subject: [PATCH 18/20] =?UTF-8?q?Bump=20version:=200.13.0=20=E2=86=92=200.?= =?UTF-8?q?14.0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .bumpversion.cfg | 2 +- CHANGELOG.md | 2 ++ doc/pymode.txt | 2 +- plugin/pymode.vim | 2 +- 4 files changed, 5 insertions(+), 3 deletions(-) diff --git a/.bumpversion.cfg b/.bumpversion.cfg index 0eda784d..84607ec8 100644 --- a/.bumpversion.cfg +++ b/.bumpversion.cfg @@ -1,6 +1,6 @@ [bumpversion] commit = True -current_version = 0.13.0 +current_version = 0.14.0 files = plugin/pymode.vim tag = True tag_name = {new_version} diff --git a/CHANGELOG.md b/CHANGELOG.md index f8e3dbf7..4e7668dd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,8 @@ ## TODO +## 2023-07-02 0.14.0 + - Update submodules - Fix Errors related to these updates - Improve tests outputs diff --git a/doc/pymode.txt b/doc/pymode.txt index 3565a4c3..7235b5d5 100644 --- a/doc/pymode.txt +++ b/doc/pymode.txt @@ -6,7 +6,7 @@ (__) (__) (__) (_) (_)(_____)(_)\_) (_/\/\_)(_____)(____/(____) ~ - Version: 0.13.0 + Version: 0.14.0 =============================================================================== CONTENTS *pymode-contents* diff --git a/plugin/pymode.vim b/plugin/pymode.vim index 82ab95ff..b0d99270 100644 --- a/plugin/pymode.vim +++ b/plugin/pymode.vim @@ -1,5 +1,5 @@ " vi: fdl=1 -let g:pymode_version = "0.13.0" +let g:pymode_version = "0.14.0" " Enable pymode by default :) From afc201a3e7416d95fb3238558b589223ffc0b07f Mon Sep 17 00:00:00 2001 From: Jongwook Choi Date: Thu, 21 Sep 2023 22:45:53 -0400 Subject: [PATCH 19/20] Fix PathFinder.find_module AttributeError for Python 3.12 PathFinder.find_module() has been deprecated since Python 3.4 in favor of find_spec(), and it's finally removed in Python 3.12. This line will throw an AttributeError which makes pymode completely unusable with python 3.12. It was a hacky workaround introduced in #1028. Maybe we can completely remove this workaround because it's 4 years ago and the minimum supported python version is now 3.6+. --- pymode/__init__.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/pymode/__init__.py b/pymode/__init__.py index aba22870..906d7059 100644 --- a/pymode/__init__.py +++ b/pymode/__init__.py @@ -6,7 +6,13 @@ import vim # noqa if not hasattr(vim, 'find_module'): - vim.find_module = _PathFinder.find_module + try: + vim.find_module = _PathFinder.find_module # deprecated + except AttributeError: + def _find_module(package_name): + spec = _PathFinder.find_spec(package_name) + return spec.loader if spec else None + vim.find_module = _find_module def auto(): From d43292ed5edfd19beea41b1b6ca8b69275bd1c38 Mon Sep 17 00:00:00 2001 From: "Sean M. Collins" Date: Thu, 16 May 2024 12:20:30 -0400 Subject: [PATCH 20/20] Move to pycodestyle 2.11.0 https://github.com/PyCQA/flake8/issues/1845#issuecomment-1766073353 --- submodules/pycodestyle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/submodules/pycodestyle b/submodules/pycodestyle index 1063db87..21abd9b6 160000 --- a/submodules/pycodestyle +++ b/submodules/pycodestyle @@ -1 +1 @@ -Subproject commit 1063db8747e7d4e213160458aa3792e5ec05bc10 +Subproject commit 21abd9b6dcbfa38635bc85a2c2327ec11ad91ffc