diff --git a/python-scikit-learn.spec b/python-scikit-learn.spec new file mode 100644 index 0000000000000000000000000000000000000000..6e21595c6feb533024f82310bf0dac293e3d0087 --- /dev/null +++ b/python-scikit-learn.spec @@ -0,0 +1,100 @@ +%define anolis_release 1 +%bcond_with check +%global srcname scikit-learn +%define python3_pkgversion 38 +%define python3_bin python3.8 + +%global _description %{expand: +Scikit-learn integrates machine learning algorithms in the tightly-knit +scientific Python world, building upon numpy, scipy, and matplotlib. +As a machine-learning module, it provides versatile tools for data mining +and analysis in any field of science and engineering. It strives to be +simple and efficient, accessible to everybody, and reusable +in various contexts.} + +Name: python-scikit-learn +Version: 1.0.2 +Release: %{anolis_release}%{?dist} +Summary: Machine learning in Python +# sklearn/externals/_arff.py is MIT +# sklearn/src/liblinear is BSD +# sklearn/src/libsvm is BSD +License: BSD and MIT + +URL: http://scikit-learn.org/ +Source0: %{pypi_source} + +BuildRequires: gcc +BuildRequires: gcc-c++ +BuildRequires: python%{python3_pkgversion}-devel +BuildRequires: python%{python3_pkgversion}-setuptools +BuildRequires: python%{python3_pkgversion}-rpm-macros + +%description %_description + +%package -n python%{python3_pkgversion}-%{srcname} +Summary: %{summary} +BuildRequires: python%{python3_pkgversion}-Cython +BuildRequires: python%{python3_pkgversion}-numpy >= 1.19 +BuildRequires: python%{python3_pkgversion}-scipy +# Testing +%if %{with check} +BuildRequires: python3-pytest +BuildRequires: %{py3_dist joblib} +BuildRequires: python3-threadpoolctl >= 2.0.0 +%endif + +%description -n python%{python3_pkgversion}-%{srcname} %_description + +%package -n python%{python3_pkgversion}-%{srcname}-doc +Summary: Documentation files for python%{python3_pkgversion}-%{srcname} +Requires: python%{python3_pkgversion}-%{srcname} = %{version}-%{release} +BuildArch: noarch + +%description -n python%{python3_pkgversion}-%{srcname}-doc +The python%{python3_pkgversion}-%{srcname}-doc package contains documentation files for python%{python3_pkgversion}-%{srcname}. + + +%prep +%autosetup -n %{srcname}-%{version} -p1 + +%build +%{_bindir}/%{python3_bin} setup.py build + +%install +%{_bindir}/%{python3_bin} setup.py install --root=%{buildroot} + +%if %{with check} +%check +# check collection crashes in armv7hl +# https://koji.fedoraproject.org/koji/taskinfo?taskID=74494216 +%ifarch armv7hl +%py3_check_import sklearn +%else +export PYTHONDONTWRITEBYTECODE=1 +export PYTEST_ADDOPTS='-p no:cacheprovider' +pushd %{buildroot}%{python3_sitearch} + pytest \ + --deselect "metrics/tests/test_common.py::test_not_symmetric_metric[precision_recall_curve]" \ + --deselect "metrics/tests/test_common.py::test_binary_sample_weight_invariance[precision_recall_curve]" \ + --deselect "datasets/tests/test_openml.py::test_fetch_openml_verify_checksum[True]" \ + --deselect "datasets/tests/test_openml.py::test_fetch_openml_verify_checksum[False]" \ + --deselect "cross_decomposition/tests/test_pls.py::test_loadings_converges" \ + --deselect "covariance/tests/test_graphical_lasso.py::test_graphical_lasso" \ + --deselect "gaussian_process/tests/test_gpr.py::test_lml_precomputed[kernel3]" \ + --deselect "gaussian_process/tests/test_gpr.py::test_lml_precomputed[kernel4]" \ + sklearn +popd +%endif + +%endif + +%files -n python%{python3_pkgversion}-%{srcname} +%doc examples/ +%license COPYING sklearn/svm/src/liblinear/COPYRIGHT +%{python3_sitearch}/sklearn +%{python3_sitearch}/scikit_learn-*.egg-info + +%changelog +* Fri Nov 25 2022 happy_orange - 1.0.2-1 +- Init pacakge from upstream diff --git a/scikit-learn-1.0.2.tar.gz b/scikit-learn-1.0.2.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..d2a51948810abffdfa1e40ab4b69810a5e29ae0e Binary files /dev/null and b/scikit-learn-1.0.2.tar.gz differ