From 4f7035490239e6c8b98e2b6c6375cb50ba339d23edf9817680882a7592df419d Mon Sep 17 00:00:00 2001 From: Dmitry Roshchin Date: Wed, 2 Oct 2024 11:01:45 +0000 Subject: [PATCH] * Add python-testsuite as BuildRequires for test flavor. * Add source dir into PYTHONPATH to allow importing of test helper modules. OBS-URL: https://build.opensuse.org/package/show/science/python-Mathics?expand=0&rev=40 --- .gitattributes | 23 ++ .gitignore | 1 + Mathics3-6.0.4.tar.gz | 3 + _multibuild | 3 + python-Mathics-relax-numpy-versions.patch | 13 ++ python-Mathics.changes | 254 ++++++++++++++++++++++ python-Mathics.spec | 143 ++++++++++++ 7 files changed, 440 insertions(+) create mode 100644 .gitattributes create mode 100644 .gitignore create mode 100644 Mathics3-6.0.4.tar.gz create mode 100644 _multibuild create mode 100644 python-Mathics-relax-numpy-versions.patch create mode 100644 python-Mathics.changes create mode 100644 python-Mathics.spec diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..9b03811 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,23 @@ +## Default LFS +*.7z filter=lfs diff=lfs merge=lfs -text +*.bsp filter=lfs diff=lfs merge=lfs -text +*.bz2 filter=lfs diff=lfs merge=lfs -text +*.gem filter=lfs diff=lfs merge=lfs -text +*.gz filter=lfs diff=lfs merge=lfs -text +*.jar filter=lfs diff=lfs merge=lfs -text +*.lz filter=lfs diff=lfs merge=lfs -text +*.lzma filter=lfs diff=lfs merge=lfs -text +*.obscpio filter=lfs diff=lfs merge=lfs -text +*.oxt filter=lfs diff=lfs merge=lfs -text +*.pdf filter=lfs diff=lfs merge=lfs -text +*.png filter=lfs diff=lfs merge=lfs -text +*.rpm filter=lfs diff=lfs merge=lfs -text +*.tbz filter=lfs diff=lfs merge=lfs -text +*.tbz2 filter=lfs diff=lfs merge=lfs -text +*.tgz filter=lfs diff=lfs merge=lfs -text +*.ttf filter=lfs diff=lfs merge=lfs -text +*.txz filter=lfs diff=lfs merge=lfs -text +*.whl filter=lfs diff=lfs merge=lfs -text +*.xz filter=lfs diff=lfs merge=lfs -text +*.zip filter=lfs diff=lfs merge=lfs -text +*.zst filter=lfs diff=lfs merge=lfs -text diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..57affb6 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.osc diff --git a/Mathics3-6.0.4.tar.gz b/Mathics3-6.0.4.tar.gz new file mode 100644 index 0000000..8155e58 --- /dev/null +++ b/Mathics3-6.0.4.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b2d4e41008fb92c6ca00cfb345bbeca14b2ac1b447ae592254f48aba56e91d70 +size 2974339 diff --git a/_multibuild b/_multibuild new file mode 100644 index 0000000..fcc7b97 --- /dev/null +++ b/_multibuild @@ -0,0 +1,3 @@ + + test + diff --git a/python-Mathics-relax-numpy-versions.patch b/python-Mathics-relax-numpy-versions.patch new file mode 100644 index 0000000..37d76fb --- /dev/null +++ b/python-Mathics-relax-numpy-versions.patch @@ -0,0 +1,13 @@ +Index: Mathics3-6.0.4/setup.py +=================================================================== +--- Mathics3-6.0.4.orig/setup.py ++++ Mathics3-6.0.4/setup.py +@@ -65,7 +65,7 @@ elif sys.version_info[:2] == (3, 6): + sys.exit(-1) + else: + INSTALL_REQUIRES += [ +- "numpy<1.25", ++ "numpy", + "llvmlite", + "sympy>=1.8", + "pillow >= 9.2", diff --git a/python-Mathics.changes b/python-Mathics.changes new file mode 100644 index 0000000..d0c5fdd --- /dev/null +++ b/python-Mathics.changes @@ -0,0 +1,254 @@ +------------------------------------------------------------------- +Tue Oct 1 23:18:32 UTC 2024 - Atri Bhattacharya + +- Add python-testsuite as BuildRequires for test flavor. +- Add source dir into PYTHONPATH to allow importing of test helper + modules. + +------------------------------------------------------------------- +Mon Apr 8 05:16:21 UTC 2024 - Atri Bhattacharya + +- Disable python 3.12 as it is unsupported: + https://github.com/Mathics3/mathics-core/issues/932 + +------------------------------------------------------------------- +Fri Dec 1 07:07:18 UTC 2023 - Atri Bhattacharya + +- Update to version 6.0.4: + * Correct type annotation in mathics.session.MathicsSession + (gh#Mathics3/mathics-core#934). + +------------------------------------------------------------------- +Fri Sep 1 18:15:06 UTC 2023 - Atri Bhattacharya + +- Disable cython-ised builds: not compatible with Cython 3+. +- Add python-Mathics-relax-numpy-versions.patch to drop the upper + limit on numpy versions. + +------------------------------------------------------------------- +Wed Jul 26 15:24:55 UTC 2023 - Atri Bhattacharya + +- Update to version 6.0.2: + * Change testing to facilitate openSUSE Tumbleweed distribution + which uses Sympy 1.12 (gh#Mathics3/mathics-core#881). +- Drop python-Mathics-relax-module-versions.patch: No longer + required as upstream has removed numpy and scipy upper limits + from requirements. +- Re-enable test_calculus. + +------------------------------------------------------------------- +Tue Apr 11 07:11:25 UTC 2023 - Atri Bhattacharya + +- Drop some unnecessary Requires: python-recordclass, + python-scipy. +- Add necessary Requires: python-requests, python-Cython, + python-Pillow. +- Add python-Mathics-relax-module-versions.patch: relax sympy and + numpy upper limits on requirements as the otherwise unsupported + sympy 1.12 and numpy 1.24.2 are in Tumbleweed. + +------------------------------------------------------------------- +Tue Mar 14 10:37:24 UTC 2023 - Atri Bhattacharya + +- Update to version 6.0.1: + * Some Pattern-matching code gone over to add type annotations + and to start documenting its behavior and characteristics. + * Combinatorica version upgraded from 0.9 (circa 1992) to 0.91 + (circa 1995) which closer matches the published book. + * Random Builtin function documentation gone over to conform to + current documentation style. + * Pillow 9.2 dependency added for Python 3.7+. +- Drop python-Mathics-relax-sympy-version.patch: No longer needed + as upstream setup.py now allows sympy >= 1.11. +- Disable building for python3.11, unsupported + [gh#Mathics3/mathics-core#743]. +- python-Mathics-Scanner >= 1.3.0 now required. + +------------------------------------------------------------------- +Sun Oct 23 04:51:56 UTC 2022 - Atri Bhattacharya + +- Add python-Mathics-relax-sympy-version.patch: Relax sympy + requirement to allow sympy >= 1.11. + +------------------------------------------------------------------- +Mon Sep 19 12:47:11 UTC 2022 - pgajdos@suse.com + +- does not require python-six + https://trello.com/c/MO53MocR/143-remove-python3-six + +------------------------------------------------------------------- +Wed Aug 10 19:32:00 UTC 2022 - Atri Bhattacharya + +- Update to version 5.0.2: + * Rerelease to get requirements-cython.txt into tarball. +- Changes from version 5.0.1: + * format and do_format methods were removed from the interface + of BaseElement, becoming non-member functions. + * The class BoxElement was introduced as a base for boxing + elements. + * New Builtin 'Inverse Gudermannian'. + * Documentation Hyperbolic functions were split off form + trigonometry and exponential functions. More url links were + added. + * Bugs *r Creating a complex number from Infinity no longer + crashes and returns 'I * Infinity' +- Drop requirements-cython.txt as additional source: now included + in source tarball. + +------------------------------------------------------------------- +Sun Jul 31 20:48:13 UTC 2022 - Atri Bhattacharya + +- Update to version 5.0.0: + * Many changes, see + https://github.com/Mathics3/mathics-core/releases/tag/5.0.0 +- Add requirements-cython.txt as Source since it is missing from + the tagged source tarball. +- Drop upstream incorporated patches: + * python-Mathics-relax-sympy-versions.patch + * 41dee8c9dd7b979a4d77d38a1e8fe8dc75b7638c.patch +- Export USE_CYTHON env variable to allow cythonised builds. +- New BuildRequires (for tests) and Requires: python-recordclass. +- Fix up some new spurious file permissions and EOF encodings. + +------------------------------------------------------------------- +Sun Jul 17 00:51:00 UTC 2022 - Atri Bhattacharya + +- Add python-Mathics-relax-sympy-versions.patch -- Relax required + sympy versions, to enable tests to run on openSUSE >= 1550 where + python-sympy is at version 1.10.x already. + +------------------------------------------------------------------- +Tue Mar 22 19:41:00 UTC 2022 - Atri Bhattacharya + +- Refresh sources: 41dee8c9dd7b979a4d77d38a1e8fe8dc75b7638c.patch + from upstream changed in its indexing a little bit. + +------------------------------------------------------------------- +Wed Mar 16 22:31:06 UTC 2022 - Atri Bhattacharya + +- Add Provides: python-Mathics3 to aid packaging using py2pack + other python module packages dependent on this. + +------------------------------------------------------------------- +Sat Jan 29 19:13:15 UTC 2022 - Atri Bhattacharya + +- Update to version 4.0.0: + * Enhancements + - Introduce a Graphics3D protocol. + - mathics.setting have been gone over to simplify. + - A rudimentary and crude SVG Density Plot was added. + * Bug fixes: + - A small SVGTransform bug was fixed. + - Elliptic arcs are now supported in Asymptote. + - A bug in image decoding introduced in 3.1.0 or so was fixed. + - A bug SVG LineBoxes was fixed. + - SVG and Asymptote drawing now includes inline comments + indicating which Box Structures are being implemented in + code. + * Documentation updates. +- New BuildRequires: python-Cython (to use cython-ised builds), + python-Mathics-Scanner (also Requires), python-scipy (for some + tests). +- Add more Requires according to setup.py. +- Add 41dee8c9dd7b979a4d77d38a1e8fe8dc75b7638c.patch: git commit + from upstream that made version incorrect before tagged release; + apply with -R to revert. +- Drop binaries no longer installed by upstream. +- Enable multibuild: Split out tests into its own flavour, since + some tests require the binary installed with update-alternative + magic. + +------------------------------------------------------------------- +Tue Apr 20 04:19:34 UTC 2021 - Steve Kowalik + +- Don't build for Python 3.6, due to no NumPy. + +------------------------------------------------------------------- +Mon Dec 28 01:52:38 UTC 2020 - Atri Bhattacharya + +- Update to version 1.1.1: + * Mathics Packages added: + - DiscreteMath`CombinatoricaV0.9 (preferred) + - DiscreteMath`CombinatoricaV0.6. + * New builtins: + - StirlingS1, StirlingS2 (not all WL variations handled) + - MapAt (not all WL variations handled) + - PythonForm, SympyForm: these is not in WL. It simply will + show a crude translation to sympy or python. + - Throw and Catch + - With + - FileNameTake + * Enhancements and Bug fixes: + - Workaround for Compile so it accepts functions + (gh#mathics/Mathics#1026) + - Add Trace option to Get. Get["fn", Trace->True] will show + lines as they are read. + - Convert to/from Boolean types properly in from_python, + to_python. Previously they were 0, and 1. + - Extend DeleteCases to accept a levelspec parameter. + - Set Evaluation#exc_result to capture Aborted, Timeout, + Overflow1`, etc. + - ImageData changed to get bits {0,1}, not booleans as + previously. + - Add tokenizer symbols for <-> and -> and the unicode + versions of those. + - Small corrections to Needs, e.g check if already loaded, + correct a typo, etc. + - System`$InputFileName is now set inside Needs and Get + - Install shell scripts dmathicserver, dmathicsscript, and + dmathics to simplify running docker + - Adjust $InputFileName inside Get and Needs. +- Adapt file list to the renaming of mathicsscript to + dmathicsscript and the addition of dmathicserver. + +------------------------------------------------------------------- +Sat Nov 14 22:17:20 UTC 2020 - Atri Bhattacharya + +- Update to version 1.1.0: + * Add Symbolic Comparisons [gh#mathics/Mathics#1000]. + * Support for externally PyPI-packagable builtin modules - + PyMathics. + * SetDirectory fixes [gh#mathics/Mathics#994]. + * Catch `PatternError Exceptions. + * Fix formatting of .. and ... (RepeatAll) + * tokenization of \. without a following space (ReplaceAll) + [gh#mathics/Mathics#992]. + * Support for assignments to named `Pattern` + * Improving support for `Names [gh#mathics/Mathics#1003]. + * Adding a MathicsSession class to simplify running Mathics from + Python [gh#mathics/Mathics#1001]. + * Improving support for `Protect` and `Unprotect` list + of symbols and regular expressions [gh#mathics/Mathics#1003]. +- Updated source URL. +- Disable python2 as it is not supported any more by upstream. +- Run tests: + * Omit home_page tests as they require a running django server + set up first. + * Add additional BuildRequires needed for tests: python-Pint, + python-chardet, python-palettable, python-pytest, + python-requests. +- Sympy >= 1.6 is now required. + +------------------------------------------------------------------- +Mon May 25 06:50:45 UTC 2020 - Petr Gajdos + +- %python3_only -> %python_alternative + +------------------------------------------------------------------- +Sun Mar 15 07:58:36 UTC 2020 - Tomáš Chvátal + +- Fix build without python2 + +------------------------------------------------------------------- +Tue Dec 19 10:56:27 UTC 2017 - badshah400@gmail.com + +- Correct License: Includes software licensed as BSD-3-Clause, + MIT, and Apache-2.0, and data licensed under CC-by-SA-3.0 and/or + GFDL. +- Use python_expand to run fdupes for both python 2 and 3. + +------------------------------------------------------------------- +Mon Dec 18 07:34:29 UTC 2017 - badshah400@gmail.com + +- Initial package. + diff --git a/python-Mathics.spec b/python-Mathics.spec new file mode 100644 index 0000000..d938dc4 --- /dev/null +++ b/python-Mathics.spec @@ -0,0 +1,143 @@ +# +# spec file for package python-Mathics +# +# Copyright (c) 2024 SUSE LLC +# +# All modifications and additions to the file contributed by third parties +# remain the property of their copyright owners, unless otherwise agreed +# upon. The license for this file, and modifications and additions to the +# file, is the same license as for the pristine package itself (unless the +# license for the pristine package is not an Open Source License, in which +# case the license is the MIT License). An "Open Source License" is a +# license that conforms to the Open Source Definition (Version 1.9) +# published by the Open Source Initiative. + +# Please submit bugfixes or comments via https://bugs.opensuse.org/ +# + + +%global flavor @BUILD_FLAVOR@%{nil} + +%if "%{flavor}" == "test" +%bcond_without test +%define psuffix -test +%else +%bcond_with test +%define psuffix %{nil} +%endif + +%{?!python_module:%define python_module() python-%{**} python3-%{**}} +# Upstream no longer supports python2 +%define skip_python2 1 +# https://github.com/Mathics3/mathics-core/issues/743 +%define skip_python311 1 +# https://github.com/Mathics3/mathics-core/issues/932 +%define skip_python312 1 +%define pyname Mathics3 +Name: python-Mathics%{psuffix} +Version: 6.0.4 +Release: 0 +Summary: A general-purpose computer algebra system +# Mathics itself is licensed as GPL-3.0 but it includes third-party software with MIT, BSD-3-Clause, and Apache-2.0 Licensing; also includes data from wikipedia licensed under CC-BY-SA-3.0 and GFDL-1.3 +License: Apache-2.0 AND BSD-3-Clause AND GPL-3.0-only AND MIT +URL: https://mathics.github.io/ +Source0: https://github.com/Mathics3/mathics-core/releases/download/%{version}/%{pyname}-%{version}.tar.gz +# PATCH-FEATURE-OPENSUSE python-Mathics-relax-numpy-versions.patch badshah400@gmail.com -- Drop upper limit on required numpy version +Patch0: python-Mathics-relax-numpy-versions.patch +BuildRequires: %{python_module Django >= 1.8} +BuildRequires: %{python_module colorama} +BuildRequires: %{python_module devel} +BuildRequires: %{python_module mpmath >= 0.19} +BuildRequires: %{python_module numpy} +BuildRequires: %{python_module pexpect} +BuildRequires: %{python_module python-dateutil} +BuildRequires: %{python_module setuptools} +BuildRequires: %{python_module sympy >= 1.10.1} +BuildRequires: fdupes +BuildRequires: python-rpm-macros +Requires: python-Django >= 1.8 +Requires: python-Mathics-Scanner >= 1.3.0 +Requires: python-Pint +Requires: python-llvmlite +Requires: python-mpmath >= 0.19 +Requires: python-numpy +Requires: python-palettable +Requires: python-python-dateutil +Requires: python-requests +Requires: python-sympy >= 1.10.1 +Requires: (python-Pillow >= 9.2 if python-base >= 3.7) +Requires(post): update-alternatives +Requires(postun):update-alternatives +Recommends: python-scikit-image >= 0.17 +%if %{with test} +# SECTION For tests +BuildRequires: %{python_module Mathics} +BuildRequires: %{python_module Mathics-Scanner >= 1.3.0} +BuildRequires: %{python_module Pillow >= 9.2 if %python-base >= 3.7} +BuildRequires: %{python_module Pint} +BuildRequires: %{python_module chardet} +BuildRequires: %{python_module llvmlite} +BuildRequires: %{python_module palettable} +BuildRequires: %{python_module pytest} +BuildRequires: %{python_module requests} +BuildRequires: %{python_module scikit-image >= 0.17} +BuildRequires: %{python_module testsuite} +BuildRequires: %{python_module typing-extensions} +# /SECTION +%endif +Provides: python-Mathics3 = %{version} +%python_subpackages + +%description +Mathics is a general-purpose computer algebra system (CAS). It is meant to be a +free, lightweight alternative to Mathematica. + +%prep +%autosetup -p1 -n %{pyname}-%{version} + +# REMOVE SHEBANGS FROM FILES INSTALLED TO NON-EXEC LOCATIONS +pushd mathics +for d in `find ./ -prune -type d` +do + find ${d} -name "*.py" -exec sed -i "1,4{/\/usr\/bin\/env/d}" '{}' \; +done +popd + +%build +%if %{without test} +export USE_CYTHON=0 +%python_build +%endif + +%install +%if %{without test} +export USE_CYTHON=0 +%python_install +%python_clone -a %{buildroot}%{_bindir}/mathics +%python_expand %fdupes %{buildroot}%{$python_sitelib} +%endif + +%if %{with test} +%check +# Home page tests require django server up and running, test_gudermannian needs network access +# test_image: https://github.com/Mathics3/mathics-core/issues/837 +PYTHONPATH+=:${PWD} +%pytest -k 'not (test_home_page or test_gudermannian or test_image)' +%endif + +%if %{without test} +%post +%python_install_alternative mathics + +%postun +%python_uninstall_alternative mathics + +%files %{python_files} +%license COPYING.txt +%doc README.rst AUTHORS.txt +%python_alternative %{_bindir}/mathics +%{python_sitelib}/mathics/ +%{python_sitelib}/%{pyname}-%{version}-py%{python_version}.egg-info/ +%endif + +%changelog