From 2d9381e5e8ea56dfe77f14149c381052ed5f3dd1 Mon Sep 17 00:00:00 2001 From: Juan Mauricio Matera Date: Mon, 15 Jan 2024 23:01:29 -0300 Subject: [PATCH] upgrade Mathics 7 (#18) * upgrade Mathics 7 * Try 3.11 for Ubuntu CI testing --------- Co-authored-by: rocky --- .github/workflows/ubuntu.yml | 2 +- pymathics/natlang/linguistic_data.py | 2 +- pymathics/natlang/manipulate.py | 3 ++- pymathics/natlang/nltk.py | 2 +- pymathics/natlang/spacy.py | 3 ++- pymathics/natlang/textual_analysis.py | 3 ++- pymathics/natlang/translation.py | 2 +- setup.py | 2 +- test/consistency-and-style/test_summary_text.py | 3 ++- 9 files changed, 13 insertions(+), 9 deletions(-) diff --git a/.github/workflows/ubuntu.yml b/.github/workflows/ubuntu.yml index 52c1715..ab9e360 100644 --- a/.github/workflows/ubuntu.yml +++ b/.github/workflows/ubuntu.yml @@ -12,7 +12,7 @@ jobs: strategy: matrix: # python-version: ['3.9', '3.10'] # Figure out what's wrong here. - python-version: ['3.10'] + python-version: ['3.11'] steps: - uses: actions/checkout@v3 - name: Set up Python ${{ matrix.python-version }} diff --git a/pymathics/natlang/linguistic_data.py b/pymathics/natlang/linguistic_data.py index e3dd0d3..865c755 100644 --- a/pymathics/natlang/linguistic_data.py +++ b/pymathics/natlang/linguistic_data.py @@ -21,9 +21,9 @@ from typing import Optional from mathics.builtin.atomic.strings import anchor_pattern, to_regex -from mathics.builtin.base import MessageException from mathics.builtin.numbers.randomnumbers import RandomEnv from mathics.core.atoms import String +from mathics.core.builtin import MessageException from mathics.core.convert.expression import Expression, to_expression from mathics.core.element import ElementsProperties from mathics.core.evaluation import Evaluation diff --git a/pymathics/natlang/manipulate.py b/pymathics/natlang/manipulate.py index 7d1f7e9..207208a 100644 --- a/pymathics/natlang/manipulate.py +++ b/pymathics/natlang/manipulate.py @@ -5,8 +5,9 @@ This module uses pattern.en to change the form of a word. """ -from mathics.builtin.base import Builtin + from mathics.core.atoms import String +from mathics.core.builtin import Builtin from mathics.core.evaluation import Evaluation from pattern.en import pluralize diff --git a/pymathics/natlang/nltk.py b/pymathics/natlang/nltk.py index 919f75c..01dd3c2 100644 --- a/pymathics/natlang/nltk.py +++ b/pymathics/natlang/nltk.py @@ -7,9 +7,9 @@ from itertools import chain import nltk -from mathics.builtin.base import Builtin, MessageException from mathics.builtin.codetables import iso639_3 from mathics.core.atoms import String +from mathics.core.builtin import Builtin, MessageException from mathics.core.evaluation import Evaluation from mathics.core.symbols import strip_context diff --git a/pymathics/natlang/spacy.py b/pymathics/natlang/spacy.py index b87b814..36c2403 100644 --- a/pymathics/natlang/spacy.py +++ b/pymathics/natlang/spacy.py @@ -12,8 +12,9 @@ from typing import Optional import spacy -from mathics.builtin.base import Builtin + from mathics.core.atoms import String +from mathics.core.builtin import Builtin from mathics.core.evaluation import Evaluation from mathics.core.symbols import strip_context from mathics.core.systemsymbols import SymbolAlternatives diff --git a/pymathics/natlang/textual_analysis.py b/pymathics/natlang/textual_analysis.py index 01300d2..985f664 100644 --- a/pymathics/natlang/textual_analysis.py +++ b/pymathics/natlang/textual_analysis.py @@ -13,8 +13,9 @@ import enchant import nltk import spacy -from mathics.builtin.base import Builtin + from mathics.core.atoms import Integer, Real, String +from mathics.core.builtin import Builtin from mathics.core.evaluation import Evaluation from mathics.core.expression import Expression from mathics.core.list import ListExpression diff --git a/pymathics/natlang/translation.py b/pymathics/natlang/translation.py index a3aecd1..3bc6c5b 100644 --- a/pymathics/natlang/translation.py +++ b/pymathics/natlang/translation.py @@ -17,8 +17,8 @@ import langid # see https://github.com/saffsd/langid.py import pycountry -from mathics.builtin.base import Builtin from mathics.core.atoms import String +from mathics.core.builtin import Builtin from mathics.core.evaluation import Evaluation from mathics.core.symbols import Symbol from mathics.core.systemsymbols import SymbolFailed diff --git a/setup.py b/setup.py index cc2624d..fabde4a 100644 --- a/setup.py +++ b/setup.py @@ -53,7 +53,7 @@ def read(*rnames): version=__version__, packages=find_namespace_packages(include=["pymathics.*"]), install_requires=[ - "Mathics3 >=6.1.0,<7.1.0", + "Mathics3>=7.0.0.dev0", "click>=8.0", "joblib>=1.0.1", "langid", # replace with a supported newer package, e.g. via spacy diff --git a/test/consistency-and-style/test_summary_text.py b/test/consistency-and-style/test_summary_text.py index bac9790..53bbced 100644 --- a/test/consistency-and-style/test_summary_text.py +++ b/test/consistency-and-style/test_summary_text.py @@ -5,8 +5,9 @@ import pkgutil import pytest -from mathics.builtin.base import Builtin + from mathics.core.load_builtin import name_is_builtin_symbol +from mathics.core.builtin import Builtin from mathics.doc.common_doc import skip_doc from pymathics.natlang import __file__ as module_initfile_path