8000 Merge pull request #1170 from python-mode/dro/bump_dependencies · python-mode/python-mode@57384b9 · GitHub
[go: up one dir, main page]

Skip to content

Commit 57384b9

Browse files
authored
Merge pull request #1170 from python-mode/dro/bump_dependencies
Bump dependencies
2 parents c86c4db + d69efa5 commit 57384b9

24 files changed

+181
-133
lines changed

.bumpversion.cfg

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,14 @@
11
[bumpversion]
22
commit = True
3-
current_version = 0.13.0
3+
current_version = 0.14.0
44
files = plugin/pymode.vim
55
tag = True
66
tag_name = {new_version}
77

88
[bumpversion:file:doc/pymode.txt]
99
search = Version: {current_version}
1010
replace = Version: {new_version}
11+
12+
[bumpversion:file:CHANGELOG.md]
13+
search = Version: {current_version}
14+
replace = Version: {new_version}

CHANGELOG.md

Lines changed: 36 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,38 @@
22

33
## TODO
44

5+
## 2023-07-02 0.14.0
6+
7+
- Update submodules
8+
- Fix Errors related to these updates
9+
- Improve tests outputs
10+
- Fix Global and Module MoveRefactoring (#1141) Thanks to @lieryan
11+
- Text object/operator/motion mapping to select logical line (#1145). Thanks to
12+
@lieryan
13+
- Remove dead keywords and builtins; add match, case (#1149). Thanks to
14+
@NeilGirdhar
15+
- Add syntax highlight for walrus (#1147) Thanks to @fpob
16+
- Add configurable prefix for rope commands (#1137) TThanks to @NathanTP
17+
- Add option g:pymode_indent_hanging_width for different hanging indentation
18+
width (#1138). Thanks to @wookayin
19+
20+
## 2020-10-08 0.13.0
21+
22+
- Add toml submodule
23+
24+
## 2020-10-08 0.12.0
25+
26+
- Improve breakpoint feature
27+
- Improve debugging script
28+
- Update submodules
29+
- Improve tests
30+
31+
## 2020-05-28 0.11.0
32+
533
- Move changelog rst syntax to markdown
634
- `pymode_rope`: check disables
7-
- Remove supoort for python 2. From 0.11.0 on we will focus on supporting
8-
python 3+ (probably 3.5+).
35+
- BREAKING CHANGE: Remove supoort for python 2. From 0.11.0 on we will focus on
36+
supporting python 3+ (probably 3.5+).
937
- Inspect why files starting with the following code do not get loaded:
1038

1139
```python
@@ -16,6 +44,12 @@
1644
main()
1745
```
1846

47+
- added github actions test suit and remove travis
48+
- improved submodules cloning (shallow)
49+
- Removes `six` submodule
50+
- Fix motion mapping
51+
- Fix breakpoint feature
52+
1953
## 2019-05-11 0.10.0
2054

2155
After many changes, including moving most of our dependencies from copied

doc/pymode.txt

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
(__) (__) (__) (_) (_)(_____)(_)\_) (_/\/\_)(_____)(____/(____) ~
77

88

9-
Version: 0.13.0
9+
Version: 0.14.0
1010

1111
===============================================================================
1212
CONTENTS *pymode-contents*
@@ -293,7 +293,7 @@ Manually set breakpoint command (leave empty for automatic detection)
293293
3. Code checking ~
294294
*pymode-lint*
295295

296-
Pymode supports `pylint`, `pep257`, `pep8`, `pyflakes`, `mccabe` code
296+
Pymode supports `pylint`, `pep257`, `pycodestyle`, `pyflakes`, `mccabe` code
297297
checkers. You could run several similar checkers.
298298

299299
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'
330330
331331
Default code checkers (you could set several) *'g:pymode_lint_checkers'*
332332
>
333-
let g:pymode_lint_checkers = ['pyflakes', 'pep8', 'mccabe']
333+
let g:pymode_lint_checkers = ['pyflakes', 'pycodestyle', 'mccabe']
334334
335-
Values may be chosen from: `pylint`, `pep8`, `mccabe`, `pep257`, `pyflakes`.
335+
Values may be chosen from: `pylint`, `pycodestyle`, `mccabe`, `pep257`, `pyflakes`.
336336

337337
Skip errors and warnings *'g:pymode_lint_ignore'*
338338
E.g. ["W", "E2"] (Skip all Warnings and the Errors starting with E2) etc.
@@ -376,9 +376,9 @@ Definitions for |signs|
376376

377377
Pymode has the ability to set code checkers options from pymode variables:
378378

379-
Set PEP8 options *'g:pymode_lint_options_pep8'*
379+
Set PEP8 options *'g:pymode_lint_options_pycodestyle'*
380380
>
381-
let g:pymode_lint_options_pep8 =
381+
let g:pymode_lint_options_pycodestyle =
382382
\ {'max_line_length': g:pymode_options_max_line_length}
383383
384384
See https://pep8.readthedocs.org/en/1.4.6/intro.html#configuration for more

plugin/pymode.vim

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
" vi: fdl=1
2-
let g:pymode_version = "0.13.0"
2+
let g:pymode_version = "0.14.0"
33

44

55
" Enable pymode by default :)
@@ -122,8 +122,8 @@ call pymode#default("g:pymode_lint_on_fly", 0)
122122
" Show message about error in command line
123123
call pymode#default("g:pymode_lint_message", 1)
124124

125-
" Choices are: pylint, pyflakes, pep8, mccabe and pep257
126-
call pymode#default("g:pymode_lint_checkers", ['pyflakes', 'pep8', 'mccabe'])
125+
" Choices are: pylint, pyflakes, pycodestyle, mccabe and pep257
126+
call pymode#default("g:pymode_lint_checkers", ['pyflakes', 'pycodestyle', 'mccabe'])
127127

128128
" Skip errors and warnings (e.g. E4,W)
129129
call pymode#default("g:pymode_lint_ignore", [])
@@ -152,8 +152,8 @@ call pymode#default("g:pymode_lint_info_symbol", "II")
152152
call pymode#default("g:pymode_lint_pyflakes_symbol", "FF")
153153

154154
" Code checkers options
155-
" TODO: check if most adequate name name is pep8 or pycodestyle.
156-
call pymode#default("g:pymode_lint_options_pep8",
155+
" TODO: check if most adequate name name is pycodestyle.
156+
call pymode#default("g:pymode_lint_options_pycodestyle",
157157
\ {'max_line_length': g:pymode_options_max_line_length})
158158

159159
call pymode#default("g:pymode_lint_options_pylint",

pymode/lint.py

Lines changed: 21 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
import os.path
77

88

9-
from pylama.lint.extensions import LINTERS
9+
from pylama.lint import LINTERS
1010

1111
try:
1212
from pylama.lint.pylama_pylint import Linter
@@ -35,13 +35,19 @@ def code_check():
3535
# Fixed in v0.9.3: these two parameters may be passed as strings.
3636
# DEPRECATE: v:0.10.0: need to be set as lists.
3737
if isinstance(env.var('g:pymode_lint_ignore'), str):
38-
raise ValueError ('g:pymode_lint_ignore should have a list type')
38+
raise ValueError('g:pymode_lint_ignore should have a list type')
3939
else:
4040
ignore = env.var('g:pymode_lint_ignore')
4141
if isinstance(env.var('g:pymode_lint_select'), str):
42-
raise ValueError ('g:pymode_lint_select should have a li 10000 st type')
42+
raise ValueError('g:pymode_lint_select should have a list type')
4343
else:
4444
select = env.var('g:pymode_lint_select')
45+
if 'pep8' in linters:
46+
# TODO: Add a user visible deprecation warning here
47+
env.message('pep8 linter is deprecated, please use pycodestyle.')
48+
linters.remove('pep8')
49+
linters.append('pycodestyle')
50+
4551
options = parse_options(
4652
linters=linters, force=1,
4753
ignore=ignore,
@@ -65,7 +71,8 @@ def code_check():
6571
return env.stop()
6672

6773
if env.options.get('debug'):
68-
from pylama.core import LOGGER, logging
74+
import logging
75+
from pylama.core import LOGGER
6976
LOGGER.setLevel(logging.DEBUG)
7077

7178
errors = run(path, code='\n'.join(env.curbuf) + '\n', options=options)
@@ -83,11 +90,16 @@ def __sort(e):
8390
env.debug("Find sorting: ", sort_rules)
8491
errors = sorted(errors, key=__sort)
8592

93+
errors_list = []
8694
for e in errors:
87-
e._info['bufnr'] = env.curbuf.number
88-
if e._info['col'] is None:
89-
e._info['col'] = 1
90-
91-
env.run('g:PymodeLocList.current().extend', [e._info for e in errors])
95+
if e.col is None:
96+
e.col = 1
97+
err_dict = e.to_dict()
98+
err_dict['bufnr'] = env.curbuf.number
99+
err_dict['type'] = e.etype
100+
err_dict['text'] = e.message
101+
errors_list.append(err_dict)
102+
103+
env.run('g:PymodeLocList.current().extend', errors_list)
92104

93105
# pylama:ignore=W0212,E1103

submodules/astroid

submodules/pylama

submodules/pylint

submodules/rope

Submodule rope updated 145 files

tests/test.sh

Lines changed: 21 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
set -e
55
which vim 1>/dev/null 2>/dev/null
66

7-
cd $(dirname $0)
7+
cd "$(dirname "$0")"
88

99
# Source common variables.
1010
source ./test_helpers_bash/test_variables.sh
@@ -22,38 +22,37 @@ declare -a TEST_ARRAY=(
2222
"./test_bash/test_folding.sh"
2323
"./test_bash/test_textobject.sh"
2424
)
25+
MAIN_RETURN=0
2526
## now loop through the above array
2627
set +e
27-
for ONE_TEST in "${TEST_ARRAY[@]}"
28+
for TEST in "${TEST_ARRAY[@]}"
2829
do
29-
echo "Starting test: $ONE_TEST" >> $VIM_OUTPUT_FILE
30-
bash -x "$ONE_TEST"
31-
echo -e "\n$ONE_TEST: Return code: $?" >> $VIM_OUTPUT_FILE
30+
echo "Starting test: ${TEST}" | tee -a "${VIM_OUTPUT_FILE}"
31+
bash "${TEST}"
32+
R=$?
33+
MAIN_RETURN=$(( MAIN_RETURN + R ))
34+
echo -e "${TEST}: Return code: ${R}\n" | tee -a "${VIM_OUTPUT_FILE}"
3235
bash ./test_helpers_bash/test_prepare_between_tests.sh
3336
done
3437

35-
# Show errors:
36-
E1=$(grep -E "^E[0-9]+:" $VIM_OUTPUT_FILE)
37-
E2=$(grep -E "^Error" $VIM_OUTPUT_FILE)
38-
E3="$E1\n$E2"
39-
if [ "$E3" = "\n" ]
40-
then
41-
echo "No errors."
42-
else
43-
echo "Errors:"
44-
echo -e "$E3\n"
45-
fi
38+
echo "========================================================================="
39+
echo " RESULTS"
40+
echo "========================================================================="
4641

4742
# Show return codes.
48-
RETURN_CODES=$(cat $VIM_OUTPUT_FILE | grep -i "Return code")
43+
RETURN_CODES=$(grep -i "Return code" < "${VIM_OUTPUT_FILE}" | grep -v "Return code: 0")
4944
echo -e "${RETURN_CODES}"
5045

51-
# Exit the script with error if there are any return codes different from 0.
52-
if echo $RETURN_CODES | grep -E "Return code: [1-9]" 1>/dev/null 2>/dev/null
53-
then
54-
exit 1
46+
# Show errors:
47+
E1=$(grep -E "^E[0-9]+:" "${VIM_OUTPUT_FILE}")
48+
E2=$(grep -Ei "^Error" "${VIM_OUTPUT_FILE}")
49+
if [[ "${MAIN_RETURN}" == "0" ]]; then
50+
echo "No errors."
5551
else
56-
exit 0
52+
echo "Errors:"
53+
echo -e "${E1}\n${E2}"
5754
fi
5855

56+
# Exit the script with error if there are any return codes different from 0.
57+
exit ${MAIN_RETURN}
5958
# vim: set fileformat=unix filetype=sh wrap tw=0 :

tests/test_bash/test_autocommands.sh

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,20 +15,24 @@ declare -a TEST_PYMODE_COMMANDS_ARRAY=(
1515
### FOR PINPOINT TESTING ### "./test_procedures_vimscript/pymoderun.vim"
1616
### FOR PINPOINT TESTING ### )
1717

18+
RETURN_CODE=0
19+
1820
## now loop through the above array
1921
set +e
2022
for ONE_PYMODE_COMMANDS_TEST in "${TEST_PYMODE_COMMANDS_ARRAY[@]}"
2123
do
22-
echo "Starting test: $0:$ONE_PYMODE_COMMANDS_TEST" >> $VIM_OUTPUT_FILE
23-
RETURN_CODE=$(vim --clean -i NONE -u $VIM_TEST_VIMRC -c "source $ONE_PYMODE_COMMANDS_TEST" $VIM_DISPOSABLE_PYFILE > /dev/null 2>&1)
24+
CONTENT="$(vim --clean -i NONE -u "${VIM_TEST_VIMRC}" -c "source ${ONE_PYMODE_COMMANDS_TEST}" "${VIM_DISPOSABLE_PYFILE}" 2>&1)"
2425

2526
### Enable the following to execute one test at a time.
2627
### FOR PINPOINT TESTING ### vim --clean -i NONE -u $VIM_TEST_VIMRC -c "source $ONE_PYMODE_COMMANDS_TEST" $VIM_DISPOSABLE_PYFILE
2728
### FOR PINPOINT TESTING ### exit 1
2829

29-
RETURN_CODE=$?
30-
echo -e "\n$0:$ONE_PYMODE_COMMANDS_TEST: Return code: $RETURN_CODE" >> $VIM_OUTPUT_FILE
30+
SUB_TEST_RETURN_CODE=$?
31+
echo -e "${CONTENT}" >> "${VIM_OUTPUT_FILE}"
32+
RETURN_CODE=$(( RETURN_CODE + SUB_TEST_RETURN_CODE ))
33+
echo -e "\tSubTest: $0:${ONE_PYMODE_COMMANDS_TEST}: Return code: ${SUB_TEST_RETURN_CODE}" | tee -a "${VIM_OUTPUT_FILE}"
3134
bash ./test_helpers_bash/test_prepare_between_tests.sh
3235
done
3336

37+
exit ${RETURN_CODE}
3438
# vim: set fileformat=unix filetype=sh wrap tw=0 :

tests/test_bash/test_autopep8.sh

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,10 @@
22

33
# Source file.
44
set +e
5-
RETURN_CODE=$(vim --clean -i NONE -u $VIM_TEST_VIMRC -c "source ./test_procedures_vimscript/autopep8.vim" $VIM_DISPOSABLE_PYFILE > /dev/null 2>&1)
5+
CONTENT="$(vim --clean -i NONE -u "${VIM_TEST_VIMRC}" -c "source ./test_procedures_vimscript/autopep8.vim" "${VIM_DISPOSABLE_PYFILE}" 2>&1)"
66
RETURN_CODE=$?
7+
echo -e "${CONTENT}" >> "${VIM_OUTPUT_FILE}"
78
set -e
8-
exit $RETURN_CODE
99

10+
exit ${RETURN_CODE}
1011
# vim: set fileformat=unix filetype=sh wrap tw=0 :

tests/test_bash/test_folding.sh

Lines changed: 18 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -2,35 +2,24 @@
22

33
# 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.
44

5-
# Source file.
6-
set +e
7-
source ./test_helpers_bash/test_prepare_between_tests.sh
8-
vim --clean -i NONE -u $VIM_TEST_VIMRC -c "source ./test_procedures_vimscript/folding1.vim" $VIM_DISPOSABLE_PYFILE > /dev/null
9-
R1=$?
10-
source ./test_helpers_bash/test_prepare_between_tests.sh
11-
vim --clean -i NONE -u $VIM_TEST_VIMRC -c "source ./test_procedures_vimscript/folding2.vim" $VIM_DISPOSABLE_PYFILE > /dev/null
12-
R2=$?
13-
source ./test_helpers_bash/test_prepare_between_tests.sh
14-
# TODO: enable folding3.vim script back.
15-
# vim --clean -i NONE -u $VIM_TEST_VIMRC -c "source ./test_procedures_vimscript/folding3.vim" $VIM_DISPOSABLE_PYFILE > /dev/null
16-
# R3=$?
17-
source ./test_helpers_bash/test_prepare_between_tests.sh
18-
vim --clean -i NONE -u $VIM_TEST_VIMRC -c "source ./test_procedures_vimscript/folding4.vim" $VIM_DISPOSABLE_PYFILE > /dev/null
19-
R4=$?
20-
set -e
5+
declare -a TEST_PYMODE_FOLDING_TESTS_ARRAY=(
6+
"./test_procedures_vimscript/folding1.vim"
7+
"./test_procedures_vimscript/folding2.vim"
8+
# "./test_procedures_vimscript/folding3.vim"
9+
"./test_procedures_vimscript/folding4.vim"
10+
)
11+
12+
RETURN_CODE=0
2113

22-
if [[ "$R1" -ne 0 ]]
23-
then
24-
exit 1
25-
elif [[ "$R2" -ne 0 ]]
26-
then
27-
exit 2
28-
# elif [[ "$R3" -ne 0 ]]
29-
# then
30-
# exit 3
31-
elif [[ "$R4" -ne 0 ]]
32-
then
33-
exit 4
34-
fi
14+
set +e
15+
for SUB_TEST in "${TEST_PYMODE_FOLDING_TESTS_ARRAY[@]}"; do
16+
CONTENT="$(vim --clean -i NONE -u "${VIM_TEST_VIMRC}" -c "source ${SUB_TEST}" "${VIM_DISPOSABLE_PYFILE}" 2>&1)"
17+
SUB_TEST_RETURN_CODE=$?
18+
echo -e "${CONTENT}" >> "${VIM_OUTPUT_FILE}"
19+
RETURN_CODE=$(( RETURN_CODE + SUB_TEST_RETURN_CODE ))
20+
echo -e "\tSubTest: $0:${SUB_TEST}: Return code: ${SUB_TEST_RETURN_CODE}" | tee -a "${VIM_OUTPUT_FILE}"
21+
bash ./test_helpers_bash/test_prepare_between_tests.sh
22+
done
3523

24+
exit ${RETURN_CODE}
3625
# vim: set fileformat=unix filetype=sh wrap tw=0 :

0 commit comments

Comments
 (0)
0