From 8f9f6866c2ace2f57c973ab0191ac2bc59b9ba33 Mon Sep 17 00:00:00 2001 From: rocky Date: Fri, 28 May 2021 09:24:16 -0400 Subject: [PATCH 1/2] Administriva: fix up optional package requirements --- .github/workflows/osx.yml | 4 ++-- .github/workflows/ubuntu.yml | 5 ++--- MANIFEST.in | 1 - Makefile | 8 +++++++- requirements-dev.txt | 5 ----- requirements-extra.txt | 4 ++++ setup.py | 15 +++++++++++++++ 7 files changed, 30 insertions(+), 12 deletions(-) create mode 100644 requirements-extra.txt diff --git a/.github/workflows/osx.yml b/.github/workflows/osx.yml index 22d1241842..2be1735a89 100644 --- a/.github/workflows/osx.yml +++ b/.github/workflows/osx.yml @@ -24,9 +24,9 @@ jobs: brew install llvm@11 python -m pip install --upgrade pip LLVM_CONFIG=/usr/local/Cellar/llvm@11/11.1.0/bin/llvm-config pip install llvmlite - - name: Install Mathics + - name: Install Mathics with full dependencies run: | - make develop + make develop-full - name: Test Mathics run: | pip install -r requirements-dev.txt diff --git a/.github/workflows/ubuntu.yml b/.github/workflows/ubuntu.yml index 921bb8f1ab..db89856e75 100644 --- a/.github/workflows/ubuntu.yml +++ b/.github/workflows/ubuntu.yml @@ -22,10 +22,9 @@ jobs: run: | sudo apt-get update -qq && sudo apt-get install -qq liblapack-dev llvm-dev python -m pip install --upgrade pip - - name: Install Mathics + - name: Install Mathics with full dependencies run: | - sed -i "s/'sympy==[0-9]\.[0-9]\.[0-9]', //" setup.py - make develop + make develop-full - name: Test Mathics run: | pip install -r requirements-dev.txt diff --git a/MANIFEST.in b/MANIFEST.in index 59806c3627..c628ba3a39 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -4,6 +4,5 @@ include ChangeLog include COPYING.txt include FUTURE.rst include Makefile -include mathics/Makefile recursive-include mathics *.py recursive-include test *.py *.m diff --git a/Makefile b/Makefile index 607d3162e1..966dcf573c 100644 --- a/Makefile +++ b/Makefile @@ -37,11 +37,17 @@ build: develop: $(PIP) install -e . +#: Set up to run from the source tree with full dependencies +develop-full: + $(PIP) install -e . + $(PIP) install -r requirements-extra.txt + + #: Make distirbution: wheels, eggs, tarball dist: ./admin-tools/make-dist.sh -#: Install mathics +#: Install Mathics install: $(PYTHON) setup.py install diff --git a/requirements-dev.txt b/requirements-dev.txt index e62f1fefab..63b622214c 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -1,8 +1,3 @@ -# Optional packages which add functionality or speed things up -scikit-image # FindMinimum can use this -lxml # for HTML parsing used in builtin/fileformats/html -wordcloud # Used in builtin/image.py by WordCloud() - # Additional packages used in testing pytest pytest-xdist diff --git a/requirements-extra.txt b/requirements-extra.txt new file mode 100644 index 0000000000..d64e48c13d --- /dev/null +++ b/requirements-extra.txt @@ -0,0 +1,4 @@ +# Optional packages which add functionality or speed things up +scikit-image # FindMinimum can use this +lxml # for HTML parsing used in builtin/fileformats/html +wordcloud # Used in builtin/image.py by WordCloud() diff --git a/setup.py b/setup.py index cbd91af3d4..9aef158f1b 100644 --- a/setup.py +++ b/setup.py @@ -22,6 +22,7 @@ """ +import re import sys import os.path as osp import platform @@ -52,6 +53,19 @@ def read(*rnames): is_PyPy = platform.python_implementation() == "PyPy" INSTALL_REQUIRES = [] +# stores __version__ in the current namespace +exec(compile(open("mathics/version.py").read(), "mathics/version.py", "exec")) + +extra_requires = [] +for line in open("requirements-extra.txt").read().split("\n"): + if line and not line.startswith("#"): + requires = re.sub(r"([^#]+)(\s*#.*$)?", r"\1", line) + extra_requires.append(requires) + +EXTRA_REQUIRES = { + "full": extra_requires +} + DEPENDENCY_LINKS = [ "http://github.com/Mathics3/mathics-scanner/tarball/master#egg=Mathics_Scanner-1.0.0.dev" ] @@ -137,6 +151,7 @@ def subdirs(root, file="*.*", depth=10): "mathics.formatter", ], install_requires=INSTALL_REQUIRES, + extra_requires=EXTRA_REQUIRES, dependency_links=DEPENDENCY_LINKS, package_data={ "mathics": [ From a44aac4ed936c727ecfe6a2c1df1a7905e79d3d5 Mon Sep 17 00:00:00 2001 From: rocky Date: Fri, 28 May 2021 11:54:03 -0400 Subject: [PATCH 2/2] Windows CI - we need all of the extras? --- .github/workflows/windows.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 869d75d03c..49b1ebd94b 100755 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -31,6 +31,7 @@ jobs: python setup.py install - name: Test Mathics run: | + pip install -r requirements-extra.txt pip install -r requirements-dev.txt set PYTEST_WORKERS="-n3" make check