From 240ffa98959f4cb8410aaeba32d9c86d51c5cd98 Mon Sep 17 00:00:00 2001 From: rocky Date: Sun, 16 Jul 2023 00:18:44 -0400 Subject: [PATCH 1/2] Adjust for Mathics-core 7.0.0 --- .editorconfig | 2 +- .gitignore | 1 + mathicsscript/settings.py | 7 +++++++ mathicsscript/version.py | 2 +- setup.py | 10 +++++----- 5 files changed, 15 insertions(+), 7 deletions(-) diff --git a/.editorconfig b/.editorconfig index c521b5a..441520c 100644 --- a/.editorconfig +++ b/.editorconfig @@ -1,4 +1,4 @@ -# THis is an EditorConfig file +# This is an EditorConfig file # https://EditorConfig.org root = true diff --git a/.gitignore b/.gitignore index 4230c06..39c04fc 100644 --- a/.gitignore +++ b/.gitignore @@ -21,6 +21,7 @@ /.cache /.coverage /.eggs +./hypothesis ./mathicsscript/inputrc-no-unicode ./mathicsscript/inputrc-unicode /.mypy_cache diff --git a/mathicsscript/settings.py b/mathicsscript/settings.py index 829290c..c0f59ef 100644 --- a/mathicsscript/settings.py +++ b/mathicsscript/settings.py @@ -1,11 +1,18 @@ # -*- coding: utf-8 -*- from mathics.core.definitions import Definitions +from mathics.core.load_builtin import import_and_load_builtins from mathics.settings import default_pymathics_modules # Initialize definitions extension_modules = default_pymathics_modules +# from mathics.timing import TimeitContextManager +# with TimeitContextManager("import_and_load_builtins()"): +# import_and_load_builtins() + +import_and_load_builtins() + definitions = Definitions(add_builtin=True, extension_modules=extension_modules) pass diff --git a/mathicsscript/version.py b/mathicsscript/version.py index 50c3323..f571532 100644 --- a/mathicsscript/version.py +++ b/mathicsscript/version.py @@ -4,4 +4,4 @@ # well as importing into Python. That's why there is no # space around "=" below. # fmt: off -__version__="6.0.0" # noqa +__version__="7.0.0.dev0" # noqa diff --git a/setup.py b/setup.py index 4e207e2..f347f10 100644 --- a/setup.py +++ b/setup.py @@ -13,6 +13,9 @@ python setup.py --help install """ +import sys +import platform + import os.path as osp import re from setuptools import setup, find_packages @@ -25,9 +28,6 @@ def get_srcdir(): srcdir = get_srcdir() -import sys -import platform - # Ensure user has the correct Python version if sys.version_info < (3, 6): print("mathicsscript does not support Python %d.%d" % sys.version_info[:2]) @@ -75,7 +75,7 @@ def read(*rnames): }, install_requires=[ "Mathics_Scanner>=1.3.0", - "Mathics3 >= 6.0.0,<6.1.0", + "Mathics3 >= 6.2.0,<7.1.0", "click", "colorama", "columnize", @@ -105,11 +105,11 @@ def read(*rnames): "Intended Audience :: Science/Research", "License :: OSI Approved :: GNU General Public License v3 (GPLv3)", "Programming Language :: Python", - "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", "Programming Language :: Python :: Implementation :: CPython", "Programming Language :: Python :: Implementation :: PyPy", "Topic :: Scientific/Engineering", From c34b1967ba6fc2f311568b25b97e355a6f451377 Mon Sep 17 00:00:00 2001 From: rocky Date: Sun, 16 Jul 2023 00:48:03 -0400 Subject: [PATCH 2/2] CI building --- .github/workflows/{osx.yml => osx.yaml} | 13 ++++++++----- .github/workflows/ubuntu.yml | 16 +++++++++------- .github/workflows/windows.yml | 18 +++++++++--------- .gitignore | 6 +++--- 4 files changed, 29 insertions(+), 24 deletions(-) rename .github/workflows/{osx.yml => osx.yaml} (62%) diff --git a/.github/workflows/osx.yml b/.github/workflows/osx.yaml similarity index 62% rename from .github/workflows/osx.yml rename to .github/workflows/osx.yaml index bbd47ff..2d4ee33 100644 --- a/.github/workflows/osx.yml +++ b/.github/workflows/osx.yaml @@ -12,7 +12,7 @@ jobs: strategy: matrix: os: [macOS] - python-version: ['3.6', '3.7', '3.8', '3.9'] + python-version: ['3.8', '3.9', '3.10'] steps: - uses: actions/checkout@v3 - name: Set up Python ${{ matrix.python-version }} @@ -22,15 +22,18 @@ jobs: - name: Install dependencies run: | brew install asymptote - python -m pip install --upgrade pip + python3 -m pip install --upgrade pip # Can comment out when next Mathics core and Mathics-scanner are released - # python -m pip install -e git+https://github.com/Mathics3/mathics-scanner#egg=Mathics-Scanner[full] + # python3 -m pip install -e git+https://github.com/Mathics3/mathics-scanner#egg=Mathics-Scanner[full] # python -m pip install -e git+https://github.com/Mathics3/mathics-core#egg=Mathics3[full] - python -m pip install Mathics3[full] + git clone https://github.com/Mathics3/mathics-core + (cd mathics-core && pip3 install -e .[full]) + (cd mathics-core && bash ./admin-tools/make-op-tables.sh) + # python -m pip install Mathics3[full] - name: Install mathicsscript run: | make - name: Test mathicsscript run: | - pip install -r requirements-dev.txt + pip3 install -r requirements-dev.txt make check diff --git a/.github/workflows/ubuntu.yml b/.github/workflows/ubuntu.yml index 52a98f7..4469579 100644 --- a/.github/workflows/ubuntu.yml +++ b/.github/workflows/ubuntu.yml @@ -8,29 +8,31 @@ on: jobs: build: - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 strategy: matrix: - python-version: ['3.6', '3.7', '3.8', '3.9'] + python-version: ['3.7', '3.8', '3.9', '3.10'] steps: - uses: actions/checkout@v3 - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v3 + uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} - name: Install dependencies run: | sudo apt-get update -qq && sudo apt-get install -qq liblapack-dev llvm-dev asymptote - python -m pip install --upgrade pip + python3 -m pip install --upgrade pip # Can comment out when next Mathics core and Mathics-scanner are released # python -m pip install -e git+https://github.com/Mathics3/mathics-scanner#egg=Mathics-Scanner[full] # python -m pip install -e git+https://github.com/Mathics3/mathics-core#egg=Mathics3[full] - python -m pip install Mathics3[full] - python -m pip install -e . + git clone https://github.com/Mathics3/mathics-core + (cd mathics-core && pip3 install -e .[full]) + (cd mathics-core && bash ./admin-tools/make-op-tables.sh) + # python -m pip install Mathics3[full] - name: Install mathicsscript run: | make - name: Test mathicsscript run: | - pip install pytest + pip3 install pytest make check diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 9d245e7..892a32c 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -12,28 +12,28 @@ jobs: strategy: matrix: os: [windows] - python-version: ['3.7', '3.8'] + python-version: ['3.8', '3.9'] steps: - uses: actions/checkout@v3 - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v3 + uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} - name: Install dependencies run: | - python -m pip install --upgrade pip - python -m pip install wheel - choco install llvm --force + python3 -m pip install --upgrade pip + python3 -m pip install wheel set LLVM_DIR="C:\Program Files\LLVM" # Can comment out when next Mathics core and Mathics-scanner are released - python -m pip install -e git+https://github.com/Mathics3/mathics-scanner#egg=Mathics-Scanner[full] - python -m pip install -e git+https://github.com/Mathics3/mathics-core#egg=Mathics3[full] - (cd src/mathics3 && bash ./admin-tools/make-op-tables.sh) + # python -m pip install -e git+https://github.com/Mathics3/mathics-scanner#egg=Mathics-Scanner[full] + git clone https://github.com/Mathics3/mathics-core + bash -c '(cd mathics-core && pip3 install -e .[full])' + bash -c '(cd mathics-core && bash ./admin-tools/make-op-tables.sh)' # python -m pip install Mathic3[full] - name: Install mathicsscript run: | make - name: Test mathicsscript run: | - pip install -r requirements-dev.txt + pip3 install -r requirements-dev.txt make check diff --git a/.gitignore b/.gitignore index 39c04fc..bea9f1d 100644 --- a/.gitignore +++ b/.gitignore @@ -4,6 +4,8 @@ *.pyc *_dis *~ +./mathicsscript/inputrc-no-unicode +./mathicsscript/inputrc-unicode .idea* .idea/**/dataSources.ids .idea/**/dataSources.local.xml @@ -21,9 +23,7 @@ /.cache /.coverage /.eggs -./hypothesis -./mathicsscript/inputrc-no-unicode -./mathicsscript/inputrc-unicode +/.hypothesis /.mypy_cache /.pytest_cache /.python-version