Skip to content

Commit 608f7fb

Browse files
committed
Track changes in API, etc.
Add script to check version
1 parent e89bc27 commit 608f7fb

File tree

4 files changed

+34
-7
lines changed

4 files changed

+34
-7
lines changed

admin-tools/check-versions.sh

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
#!/bin/bash
2+
function finish {
3+
cd $mathics_natlang_owd
4+
}
5+
6+
# FIXME put some of the below in a common routine
7+
mathics_natlang_owd=$(pwd)
8+
trap finish EXIT
9+
10+
cd $(dirname ${BASH_SOURCE[0]})
11+
if ! source ./pyenv-versions ; then
12+
exit $?
13+
fi
14+
15+
cd ..
16+
for version in $PYVERSIONS; do
17+
echo --- $version ---
18+
if ! pyenv local $version ; then
19+
exit $?
20+
fi
21+
make clean && pip install -e .
22+
if ! make check; then
23+
exit $?
24+
fi
25+
echo === $version ===
26+
done
27+
finish

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ def read(*rnames):
5959
"langid", # replace with a supported newer package, e.g. via spacy
6060
"llvmlite>=0.36",
6161
"nltk>=3.8.0",
62-
"pattern>=3.6.0",
62+
"pattern",
6363
"pyenchant>=3.2.0",
6464
"pycountry>=3.2.0",
6565
"spacy>=3.4",

test/consistency-and-style/test_summary_text.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@
6060
language_tool = None
6161
if CHECK_GRAMMAR:
6262
try:
63-
import language_tool_python
63+
import language_tool_python # type: ignore[import-not-found]
6464

6565
language_tool = language_tool_python.LanguageToolPublicAPI("en-US")
6666
# , config={ 'cacheSize': 1000, 'pipelineCaching': True })
@@ -95,14 +95,15 @@ def import_module(module_name: str):
9595
module_names.append(f"{subdir}.{modname}")
9696

9797

98-
modules = dict()
98+
modules: Dict[str, ModuleType] = dict()
9999
for module_name in module_names:
100100
import_module(module_name)
101101

102102
# modules = {"compilation": modules["compilation"],}
103103

104104

105105
def check_grammar(text: str):
106+
assert language_tool is not None
106107
matches = language_tool.check(text)
107108
filtered_matches = []
108109
if matches:
@@ -138,10 +139,10 @@ def check_well_formatted_docstring(docstr: str, instance: Builtin, module_name:
138139
), f"missing <dd> field {instance.get_name()} from {module_name}"
139140
assert (
140141
docstr.count("</dt>") == 0
141-
), f"unnecesary </dt> {instance.get_name()} from {module_name}"
142+
), f"unnecessary </dt> {instance.get_name()} from {module_name}"
142143
assert (
143144
docstr.count("</dd>") == 0
144-
), f"unnecesary </dd> field {instance.get_name()} from {module_name}"
145+
), f"unnecessary </dd> field {instance.get_name()} from {module_name}"
145146

146147
assert (
147148
docstr.count("<url>") > 0

test/helper.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
import time
22
from typing import Optional
33

4-
from mathics.core.load_builtin import import_and_load_builtins
5-
from mathics.session import MathicsSession
4+
from mathics.session import MathicsSession, import_and_load_builtins
65

76
import_and_load_builtins()
87

0 commit comments

Comments
 (0)