2017-12-18 08:30:55 +00:00
#
2022-10-26 16:09:20 +00:00
# spec file for package python-Mathics
2017-12-18 08:30:55 +00:00
#
2023-04-18 03:11:21 +00:00
# Copyright (c) 2023 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
2017-12-18 08:30:55 +00:00
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
2020-11-19 16:31:45 +00:00
# Upstream no longer supports python2
%define skip_python2 1
2023-04-18 03:11:21 +00:00
%define skip_python311 1
2020-11-19 16:31:45 +00:00
%define pyname Mathics3
2022-02-03 19:25:15 +00:00
Name : python-Mathics%{psuffix}
2023-07-29 19:34:06 +00:00
Version : 6.0.2
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
2022-02-03 19:25:15 +00:00
BuildRequires : %{python_module Cython}
2020-03-17 13:46:29 +00:00
BuildRequires : %{python_module Django >= 1.8}
2017-12-18 08:30:55 +00:00
BuildRequires : %{python_module colorama}
BuildRequires : %{python_module devel}
BuildRequires : %{python_module mpmath >= 0.19}
2020-03-17 13:46:29 +00:00
BuildRequires : %{python_module numpy}
2017-12-18 08:30:55 +00:00
BuildRequires : %{python_module pexpect}
BuildRequires : %{python_module python-dateutil}
BuildRequires : %{python_module setuptools}
2022-08-05 21:16:05 +00:00
BuildRequires : %{python_module sympy >= 1.10.1}
2020-03-17 13:46:29 +00:00
BuildRequires : fdupes
BuildRequires : python-rpm-macros
2023-04-18 03:11:21 +00:00
Requires : python-Cython
2017-12-18 08:30:55 +00:00
Requires : python-Django >= 1.8
2023-04-18 03:11:21 +00:00
Requires : python-Mathics-Scanner >= 1.3.0
2022-02-03 19:25:15 +00:00
Requires : python-Pint
Requires : python-llvmlite
2017-12-18 08:30:55 +00:00
Requires : python-mpmath >= 0.19
2023-04-18 03:11:21 +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
2022-08-05 21:16:05 +00:00
Requires : python-sympy >= 1.10.1
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
Requires(postun) : update-alternatives
2023-07-23 13:10:03 +00:00
Recommends: python-scikit-image >= 0.17
2022-02-03 19:25:15 +00:00
%if %{with test}
2020-11-19 16:31:45 +00:00
# SECTION For tests
2022-02-03 19:25:15 +00:00
BuildRequires : %{python_module Mathics}
2023-04-18 03:11:21 +00:00
BuildRequires : %{python_module Mathics-Scanner >= 1.3.0}
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}
BuildRequires : %{python_module requests}
2023-07-23 13:10:03 +00:00
BuildRequires : %{python_module scikit-image >= 0.17}
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
Mathics is a general-purpose computer algebra system (CAS). It is meant to be a free, lightweight alternative to Mathematica.
%prep
2022-10-26 16:09:20 +00:00
%autosetup -p1 -n %{pyname} -%{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
%build
2022-02-03 19:25:15 +00:00
%if %{without test}
2022-08-05 21:16:05 +00:00
export USE_CYTHON=1
2017-12-18 08:30:55 +00:00
%python_build
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}
2022-08-05 21:16:05 +00:00
export USE_CYTHON=1
2017-12-18 08:30:55 +00:00
%python_install
2020-05-25 12:16:19 +00:00
%python_clone -a %{buildroot} %{_bindir} /mathics
2022-02-03 19:25:15 +00:00
%python_expand %fdupes %{buildroot} %{$python_sitearch}
%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
2022-08-05 21:16:05 +00:00
# Home page tests require django server up and running, test_gudermannian needs network access
2023-04-18 03:11:21 +00:00
# test_image: https://github.com/Mathics3/mathics-core/issues/837
2023-07-29 19:34:06 +00:00
%pytest_arch -k 'not (test_home_page or test_gudermannian or test_image)'
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
2022-02-03 19:25:15 +00:00
%{python_sitearch} /mathics/
%{python_sitearch} /%{pyname} -%{version} -py%{python_version} .egg-info/
%endif
2017-12-18 08:30:55 +00:00
%changelog