From 6de2c62f29c6e1c30b7e9708d477e5f316a98cd1 Mon Sep 17 00:00:00 2001 From: Anshal Shukla Date: Mon, 12 Jul 2021 01:20:41 +0530 Subject: [PATCH] language-check changed to language-tool-python --- .ci/get_tests.py | 2 +- .moban.dt/bears-setup.py.jj2 | 2 +- bear-metadata.yaml | 8 ++++---- bear-requirements.txt | 2 +- bear-requirements.yaml | 4 ++-- bears/documentation/DocGrammarBear.py | 6 +++--- bears/natural_language/LanguageToolBear.py | 6 +++--- ignore.txt | 1 - setup.py | 2 +- tests/documentation/DocGrammarBearTest.py | 6 +++--- tests/natural_language/LanguageToolBearTest.py | 8 ++++---- tox.ini | 2 +- 12 files changed, 24 insertions(+), 25 deletions(-) diff --git a/.ci/get_tests.py b/.ci/get_tests.py index 097f096aba..389f66b524 100755 --- a/.ci/get_tests.py +++ b/.ci/get_tests.py @@ -125,7 +125,7 @@ def get_tests(bears): def get_pytest_deselected_tests(args, tests): not_list = [] - # language-check fails for different locale on windows + # language-tool-python fails for different locale on windows if 'tests/documentation/DocGrammarBearTest.py' in tests: if 'win' in args: not_list.append('test_language_french') diff --git a/.moban.dt/bears-setup.py.jj2 b/.moban.dt/bears-setup.py.jj2 index 98a6ae6473..995d685a40 100755 --- a/.moban.dt/bears-setup.py.jj2 +++ b/.moban.dt/bears-setup.py.jj2 @@ -12,7 +12,7 @@ extras_require = { } # For the average user we leave out some of the more complicated requirements, -# e.g. language-check (needs java). +# e.g. language-tool-python (needs java). required += [req for req in bear_required if not any(req.startswith(ignore) for ignore in ignore_requirements)] diff --git a/bear-metadata.yaml b/bear-metadata.yaml index e28fb24bcb..8f6c91b1a8 100644 --- a/bear-metadata.yaml +++ b/bear-metadata.yaml @@ -575,8 +575,8 @@ bear_metadata: filename: DocGrammarBear.py requirements: pip: - language-check: - version: ~=1.0 + language-tool-python: + version: ~=1.1 languages: - c - cpp @@ -1257,8 +1257,8 @@ bear_metadata: filename: LanguageToolBear.py requirements: pip: - language-check: - version: ~=1.0 + language-tool-python: + version: ~=1.1 guess-language-spirit: version: ~=0.5.2 languages: diff --git a/bear-requirements.txt b/bear-requirements.txt index 5052a0cff6..c93e8f8a34 100644 --- a/bear-requirements.txt +++ b/bear-requirements.txt @@ -15,7 +15,7 @@ git-url-parse~=1.1 guess-language-spirit~=0.5.2 html-linter~=0.4.0 isort~=4.2 -language-check~=1.0 +language-tool-python~=1.1 libclang-py3~=3.4.0 lxml>=1.0,<4.4.0 memento-client~=0.6.1 diff --git a/bear-requirements.yaml b/bear-requirements.yaml index d168d4535c..523f345778 100644 --- a/bear-requirements.yaml +++ b/bear-requirements.yaml @@ -36,8 +36,8 @@ pip_requirements: version: ~=0.4.0 isort: version: ~=4.2 - language-check: - version: ~=1.0 + language-tool-python: + version: ~=1.1 libclang-py3: version: ~=3.4.0 lxml: diff --git a/bears/documentation/DocGrammarBear.py b/bears/documentation/DocGrammarBear.py index f9a18de158..283955290c 100644 --- a/bears/documentation/DocGrammarBear.py +++ b/bears/documentation/DocGrammarBear.py @@ -15,7 +15,7 @@ class DocGrammarBear(DocBaseClass, LocalBear): LANGUAGES = {language for docstyle, language in DocstyleDefinition.get_available_definitions()} - REQUIREMENTS = {PipRequirement('language-check', '1.0')} + REQUIREMENTS = {PipRequirement('language-tool-python', '1.1')} AUTHORS = {'The coala developers'} AUTHORS_EMAILS = {'coala-devel@googlegroups.com'} LICENSE = 'AGPL-3.0' @@ -28,12 +28,12 @@ def check_prerequisites(cls): return 'java is not installed.' else: try: - from language_check import LanguageTool, correct + from language_tool_python import LanguageTool, correct LanguageTool correct return True except ImportError: - return 'Please install the `language-check` pip package.' + return 'Please install the `language-tool-python` pip package.' def process_documentation(self, parsed, diff --git a/bears/natural_language/LanguageToolBear.py b/bears/natural_language/LanguageToolBear.py index a7168b455e..adef01066c 100644 --- a/bears/natural_language/LanguageToolBear.py +++ b/bears/natural_language/LanguageToolBear.py @@ -15,7 +15,7 @@ class LanguageToolBear(LocalBear): LANGUAGES = {'Natural Language'} REQUIREMENTS = {PipRequirement('guess-language-spirit', '0.5.2'), - PipRequirement('language-check', '1.0')} + PipRequirement('language-tool-python', '1.1')} AUTHORS = {'The coala developers'} AUTHORS_EMAILS = {'coala-devel@googlegroups.com'} LICENSE = 'AGPL-3.0' @@ -27,12 +27,12 @@ def check_prerequisites(cls): return 'java is not installed.' else: try: - from language_check import LanguageTool, correct + from language_tool_python import LanguageTool, correct LanguageTool correct return True except ImportError: - return 'Please install the `language-check` pip package.' + return 'Please install the `language-tool-python` pip package.' @deprecate_settings(natural_language=('language', 'locale')) def run(self, diff --git a/ignore.txt b/ignore.txt index 9351542bb5..ab90481d5d 100644 --- a/ignore.txt +++ b/ignore.txt @@ -1,2 +1 @@ -language-check lxml diff --git a/setup.py b/setup.py index 281fe35641..3da5f8e9f6 100755 --- a/setup.py +++ b/setup.py @@ -408,7 +408,7 @@ def read_requirements(filename): } # For the average user we leave out some of the more complicated requirements, -# e.g. language-check (needs java). +# e.g. language-tool-python (needs java). required += [req for req in bear_required if not any(req.startswith(ignore) for ignore in ignore_requirements)] diff --git a/tests/documentation/DocGrammarBearTest.py b/tests/documentation/DocGrammarBearTest.py index a9eaf62695..2387905819 100644 --- a/tests/documentation/DocGrammarBearTest.py +++ b/tests/documentation/DocGrammarBearTest.py @@ -85,10 +85,10 @@ def test_check_prerequisites(self): finally: shutil.which = _shutil_which - with mock.patch.dict(sys.modules, {'language_check': None}): + with mock.patch.dict(sys.modules, {'language-tool-python': None}): assert DocGrammarBear.check_prerequisites() == ('Please ' 'install the ' - '`language-check` ' + '`language-tool-python` ' 'pip package.') test_spelling = gen_check( @@ -128,7 +128,7 @@ def test_check_prerequisites(self): # which was breaking this test case. test_language_french = unittest.skipIf( platform.system() == 'Windows', - 'language-check fails for different locale on windows')( + 'language-tool-python fails for different locale on windows')( gen_check( make_docstring(main_desc='il monte en haut si il veut.\n'), make_docstring(main_desc='Il monte s’il veut.\n'), diff --git a/tests/natural_language/LanguageToolBearTest.py b/tests/natural_language/LanguageToolBearTest.py index 66e1b2de93..289c76e3e3 100644 --- a/tests/natural_language/LanguageToolBearTest.py +++ b/tests/natural_language/LanguageToolBearTest.py @@ -8,9 +8,9 @@ from coalib.testing.LocalBearTestHelper import verify_local_bear try: - import language_check + import language_tool_python import guess_language - language_check + language_tool_python guess_language except ImportError as err: raise unittest.SkipTest(str(err)) @@ -69,8 +69,8 @@ def test_check_prerequisites(self): finally: shutil.which = _shutil_which - with mock.patch.dict(sys.modules, {'language_check': None}): + with mock.patch.dict(sys.modules, {'language-tool-python': None}): assert LanguageToolBear.check_prerequisites() == ('Please ' 'install the ' - '`language-check`' + '`language-tool-python`' ' pip package.') diff --git a/tox.ini b/tox.ini index a94d8b655e..c9f0a932bf 100644 --- a/tox.ini +++ b/tox.ini @@ -88,7 +88,7 @@ deps = npm-!pip: docutils-ast-writer~=0.1.2 {apt_get,clang,mono,adhoc}-!pip: libclang-py3~=3.4.0 clang-!pip: munkres3~=1.0 - java{7,8}-!pip: language-check~=1.0 + java{7,8}-!pip: language-tool-python~=1.1 java{7,8}-!pip: guess-language-spirit~=0.5.2 -rtest-requirements.txt # pytest-cov-threshold is incompatible with py34