2017-12-18 08:30:55 +00:00
#
2024-04-10 08:04:14 +00:00
# spec file for package python-Mathics
2017-12-18 08:30:55 +00:00
#
2025-02-05 06:01:58 +00:00
# Copyright (c) 2025 SUSE LLC
2017-12-18 08:30:55 +00:00
#
# 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.
2020-03-17 13:46:29 +00:00
# Please submit bugfixes or comments via https://bugs.opensuse.org/
2017-12-18 08:30:55 +00:00
#
2020-03-17 13:46:29 +00:00
2022-02-03 19:25:15 +00:00
%global flavor @BUILD_FLAVOR@%{nil}
%if "%{flavor}" == "test"
%bcond_without test
%define psuffix -test
%else
%bcond_with test
%define psuffix %{nil}
%endif
2025-02-05 06:01:58 +00:00
%define skip_python313 1
2020-11-19 16:31:45 +00:00
%define pyname Mathics3
2025-02-09 17:25:23 +00:00
%define src_ver 8.0.1
2022-02-03 19:25:15 +00:00
Name : python-Mathics%{psuffix}
2025-02-09 17:25:23 +00:00
Version : 8.0.1
2017-12-18 08:30:55 +00:00
Release : 0
Summary : A general-purpose computer algebra system
2017-12-20 15:25:13 +00:00
# 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
2021-04-24 07:52:52 +00:00
License : Apache-2.0 AND BSD-3-Clause AND GPL-3.0-only AND MIT
2020-03-17 13:46:29 +00:00
URL : https://mathics.github.io/
2022-08-05 21:16:05 +00:00
Source0 : https://github.com/Mathics3/mathics-core/releases/download/%{version} /%{pyname} -%{version} .tar.gz
2025-02-09 17:25:23 +00:00
BuildRequires : %{python_module Mathics-Scanner >= 1.4.1}
2017-12-18 08:30:55 +00:00
BuildRequires : %{python_module colorama}
BuildRequires : %{python_module devel}
BuildRequires : %{python_module mpmath >= 0.19}
2025-02-09 17:25:23 +00:00
BuildRequires : %{python_module numpy}
2017-12-18 08:30:55 +00:00
BuildRequires : %{python_module pexpect}
2025-02-05 06:01:58 +00:00
BuildRequires : %{python_module pip}
2017-12-18 08:30:55 +00:00
BuildRequires : %{python_module python-dateutil}
BuildRequires : %{python_module setuptools}
2025-02-09 17:25:23 +00:00
BuildRequires : %{python_module sympy >= 1.13.0}
2025-02-05 06:01:58 +00:00
BuildRequires : %{python_module wheel}
2020-03-17 13:46:29 +00:00
BuildRequires : fdupes
BuildRequires : python-rpm-macros
2025-02-09 17:25:23 +00:00
Requires : python-Mathics-Scanner >= 1.4.1
2022-02-03 19:25:15 +00:00
Requires : python-Pint
2025-02-09 17:25:23 +00:00
Requires : python-Pympler
2017-12-18 08:30:55 +00:00
Requires : python-mpmath >= 0.19
2025-02-09 17:25:23 +00:00
Requires : python-numpy
2022-02-03 19:25:15 +00:00
Requires : python-palettable
2017-12-18 08:30:55 +00:00
Requires : python-python-dateutil
2023-04-18 03:11:21 +00:00
Requires : python-requests
2025-02-09 17:25:23 +00:00
Requires : python-scipy
Requires : python-stopit
Requires : python-sympy >= 1.13.0
2023-04-18 03:11:21 +00:00
Requires : (python-Pillow >= 9.2 if python-base >= 3.7)
2022-02-03 19:25:15 +00:00
Requires(post) : update-alternatives
2025-02-05 06:01:58 +00:00
Requires(postun) : update-alternatives
2023-07-23 13:10:03 +00:00
Recommends: python-scikit-image >= 0.17
2025-02-09 17:25:23 +00:00
BuildArch : noarch
2022-02-03 19:25:15 +00:00
%if %{with test}
2020-11-19 16:31:45 +00:00
# SECTION For tests
2025-02-05 06:01:58 +00:00
BuildRequires : %{python_module Mathics = %{version} }
2023-04-18 03:11:21 +00:00
BuildRequires : %{python_module Pillow >= 9.2 if %python-base >= 3.7}
2020-11-19 16:31:45 +00:00
BuildRequires : %{python_module Pint}
BuildRequires : %{python_module chardet}
2022-02-03 19:25:15 +00:00
BuildRequires : %{python_module llvmlite}
2020-11-19 16:31:45 +00:00
BuildRequires : %{python_module palettable}
BuildRequires : %{python_module pytest}
2023-07-23 13:10:03 +00:00
BuildRequires : %{python_module scikit-image >= 0.17}
2025-02-09 17:25:23 +00:00
BuildRequires : %{python_module stopit}
2024-10-02 11:01:45 +00:00
BuildRequires : %{python_module testsuite}
2020-11-19 16:31:45 +00:00
# /SECTION
2022-02-03 19:25:15 +00:00
%endif
2022-03-19 20:42:55 +00:00
Provides : python-Mathics3 = %{version}
2017-12-18 08:30:55 +00:00
%python_subpackages
%description
2024-10-02 11:01:45 +00:00
Mathics is a general-purpose computer algebra system (CAS). It is meant to be a
free, lightweight alternative to Mathematica.
2017-12-18 08:30:55 +00:00
%prep
2025-02-09 17:25:23 +00:00
%autosetup -p1 -n mathics3-%{version}
2022-08-05 21:16:05 +00:00
2017-12-18 08:30:55 +00:00
# REMOVE SHEBANGS FROM FILES INSTALLED TO NON-EXEC LOCATIONS
pushd mathics
for d in `find ./ -prune -type d`
do
find ${d} -name " * . p y " -exec sed -i " 1 , 4 { / \ / u s r \ / b i n \ / e n v / d } " '{}' \;
done
popd
2025-02-09 17:25:23 +00:00
# Unnecessary exec perms
chmod -x ./mathics/Packages/Rubi/Show{StepFormatting,StepRoutines}.m
2017-12-18 08:30:55 +00:00
%build
2022-02-03 19:25:15 +00:00
%if %{without test}
2023-09-05 10:00:48 +00:00
export USE_CYTHON=0
2025-02-05 06:01:58 +00:00
%pyproject_wheel
2022-02-03 19:25:15 +00:00
%endif
2017-12-18 08:30:55 +00:00
%install
2022-02-03 19:25:15 +00:00
%if %{without test}
2023-09-05 10:00:48 +00:00
export USE_CYTHON=0
2025-02-05 06:01:58 +00:00
%pyproject_install
2020-05-25 12:16:19 +00:00
%python_clone -a %{buildroot} %{_bindir} /mathics
2023-09-05 10:00:48 +00:00
%python_expand %fdupes %{buildroot} %{$python_sitelib}
2022-02-03 19:25:15 +00:00
%endif
2017-12-18 08:30:55 +00:00
2022-02-03 19:25:15 +00:00
%if %{with test}
2020-03-17 13:46:29 +00:00
%check
2025-02-09 17:25:23 +00:00
export MATHICS_CHARACTER_ENCODING=" A S C I I "
2025-02-05 06:01:58 +00:00
export USE_CYTHON=0
2025-02-09 17:25:23 +00:00
%pytest ./test
2022-02-03 19:25:15 +00:00
%endif
2017-12-18 08:30:55 +00:00
2022-02-03 19:25:15 +00:00
%if %{without test}
2020-05-25 12:16:19 +00:00
%post
%python_install_alternative mathics
%postun
2022-02-03 19:25:15 +00:00
%python_uninstall_alternative mathics
2020-05-25 12:16:19 +00:00
2020-03-17 13:46:29 +00:00
%files %{python_files}
%license COPYING.txt
%doc README.rst AUTHORS.txt
2020-05-25 12:16:19 +00:00
%python_alternative %{_bindir} /mathics
2023-09-05 10:00:48 +00:00
%{python_sitelib} /mathics/
2025-02-05 06:01:58 +00:00
%{python_sitelib} /%{pyname} -%{version} *.*-info/
2022-02-03 19:25:15 +00:00
%endif
2017-12-18 08:30:55 +00:00
%changelog