Skip to content

Commit

Permalink
language-check changed to language-tool-python
Browse files Browse the repository at this point in the history
  • Loading branch information
anshalshukla committed Jul 11, 2021
1 parent 7d21a59 commit 6de2c62
Show file tree
Hide file tree
Showing 12 changed files with 24 additions and 25 deletions.
2 changes: 1 addition & 1 deletion .ci/get_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down
2 changes: 1 addition & 1 deletion .moban.dt/bears-setup.py.jj2
Original file line number Diff line number Diff line change
Expand Up @@ -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)]
Expand Down
8 changes: 4 additions & 4 deletions bear-metadata.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion bear-requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions bear-requirements.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
6 changes: 3 additions & 3 deletions bears/documentation/DocGrammarBear.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {'[email protected]'}
LICENSE = 'AGPL-3.0'
Expand All @@ -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,
Expand Down
6 changes: 3 additions & 3 deletions bears/natural_language/LanguageToolBear.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {'[email protected]'}
LICENSE = 'AGPL-3.0'
Expand All @@ -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,
Expand Down
1 change: 0 additions & 1 deletion ignore.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
language-check
lxml
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)]
Expand Down
6 changes: 3 additions & 3 deletions tests/documentation/DocGrammarBearTest.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down Expand Up @@ -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'),
Expand Down
8 changes: 4 additions & 4 deletions tests/natural_language/LanguageToolBearTest.py
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down Expand Up @@ -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.')
2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 6de2c62

Please sign in to comment.