10BC0 Bump dependencies by diraol · Pull Request #1170 · python-mode/python-mode · GitHub
[go: up one dir, main page]

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion .bumpversion.cfg
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
[bumpversion]
commit = True
current_version = 0.13.0
current_version = 0.14.0
files = plugin/pymode.vim
tag = True
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}
38 changes: 36 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,38 @@

## TODO

## 2023-07-02 0.14.0

- 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
Expand All @@ -16,6 +44,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
Expand Down
12 changes: 6 additions & 6 deletions doc/pymode.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
(__) (__) (__) (_) (_)(_____)(_)\_) (_/\/\_)(_____)(____/(____) ~


Version: 0.13.0
Version: 0.14.0

===============================================================================
CONTENTS *pymode-contents*
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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
Expand Down
10 changes: 5 additions & 5 deletions plugin/pymode.vim
Original file line number Diff line number Diff line change
@@ -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 :)
Expand Down Expand Up @@ -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", [])
Expand Down Expand Up @@ -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",
Expand Down
30 changes: 21 additions & 9 deletions pymode/lint.py
6E5B
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -35,13 +35,19 @@ 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')
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,
Expand All @@ -65,7 +71,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
9D65 LOGGER.setLevel(logging.DEBUG)

errors = run(path, code='\n'.join(env.curbuf) + '\n', options=options)
Expand All @@ -83,11 +90,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
2 changes: 1 addition & 1 deletion submodules/astroid
2 changes: 1 addition & 1 deletion submodules/mccabe
Submodule mccabe updated 5 files
+2 −0 .gitignore
+9 −0 README.rst
+5 −2 mccabe.py
+30 −34 setup.py
+1 −1 tox.ini
2 changes: 1 addition & 1 deletion submodules/pylama
Submodule pylama updated 63 files D429
+1 −2 .bumpversion.cfg
+0 −4 .coveragerc
+15 −0 .github/dependabot.yml
+18 −0 .github/workflows/docs.yml
+50 −0 .github/workflows/release.yml
+39 −0 .github/workflows/tests.yml
+11 −0 .pre-commit-hooks.yaml
+0 −30 .travis.yml
+0 −26 AUTHORS
+120 −0 Changelog
+0 −1 DESCRIPTION
+10 −0 Dockerfile
+23 −165 LICENSE
+2 −1 MANIFEST.in
+25 −11 Makefile
+184 −102 README.rst
+54 −22 docs/conf.py
+0 −12 docs/index.html
+ docs/index.html.zip
+1 −1 docs/index.rst
+4 −0 docs/requirements.txt
+1 −0 dummy.py
+8 −5 pylama/__init__.py
+2 −2 pylama/__main__.py
+23 −54 pylama/check_async.py
+203 −166 pylama/config.py
+31 −0 pylama/config_toml.py
+197 −0 pylama/context.py
+38 −211 pylama/core.py
+109 −98 pylama/errors.py
+59 −56 pylama/hook.py
+0 −38 pylama/libs/importlib.py
+2 −46 pylama/libs/inirama.py
+57 −10 pylama/lint/__init__.py
+0 −65 pylama/lint/extensions.py
+16 −24 pylama/lint/pylama_eradicate.py
+17 −0 pylama/lint/pylama_fake.py
+36 −15 pylama/lint/pylama_mccabe.py
+39 −64 pylama/lint/pylama_mypy.py
+33 −54 pylama/lint/pylama_pycodestyle.py
+38 −29 pylama/lint/pylama_pydocstyle.py
+40 −35 pylama/lint/pylama_pyflakes.py
+63 −57 pylama/lint/pylama_pylint.py
+58 −19 pylama/lint/pylama_radon.py
+64 −0 pylama/lint/pylama_vulture.py
+95 −59 pylama/main.py
+31 −23 pylama/pytest.py
+22 −0 pylama/utils.py
+0 −7 requirements-test.txt
+0 −6 requirements.txt
+12 −0 requirements/requirements-tests.txt
+6 −0 requirements/requirements.txt
+66 −12 setup.cfg
+14 −56 setup.py
+47 −0 tests/conftest.py
+17 −51 tests/test_config.py
+74 −0 tests/test_config_toml.py
+90 −0 tests/test_context.py
+23 −56 tests/test_core.py
+219 −61 tests/test_linters.py
+70 −0 tests/test_shell.py
+13 −0 tests/test_vcs.py
+0 −21 tox.ini
2 changes: 1 addition & 1 deletion submodules/pylint
2 changes: 1 addition & 1 deletion submodules/rope
43 changes: 21 additions & 22 deletions tests/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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" >> $VIM_OUTPUT_FILE
bash -x "$ONE_TEST"
echo -e "\n$ONE_TEST: Return code: $?" >> $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 :
12 changes: 8 additions & 4 deletions tests/test_bash/test_autocommands.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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" >> $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" >> $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 :
5 changes: 3 additions & 2 deletions tests/test_bash/test_autopep8.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 :
47 changes: 18 additions & 29 deletions tests/test_bash/test_folding.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 :
Loading
0