diff --git a/.gitignore b/.gitignore index a4711a0..38c4549 100644 --- a/.gitignore +++ b/.gitignore @@ -12,3 +12,4 @@ /scikit-learn-0.18.tar.gz /scikit-learn-0.18.1.tar.gz /scikit-learn-0.19.1.tar.gz +/scikit-learn-0.21.3.tar.gz diff --git a/blas-name.patch b/blas-name.patch deleted file mode 100644 index c393296..0000000 --- a/blas-name.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/sklearn/_build_utils/__init__..py~ b/sklearn/_build_utils/__init__.py -index 166f46f382..ee69ee81c1 100644 ---- python3-python-scikit-learn-0.16.1-3.fc24/sklearn/_build_utils/__init__.py~ -+++ python3-python-scikit-learn-0.16.1-3.fc24/sklearn/_build_utils/__init__.py -@@ -24,7 +24,7 @@ def get_blas_info(): - - blas_info = get_info('blas_opt', 0) - if (not blas_info) or atlas_not_found(blas_info): -- cblas_libs = ['cblas'] -+ cblas_libs = ['satlas'] - blas_info.pop('libraries', None) - else: - cblas_libs = blas_info.pop('libraries', []) diff --git a/cython-module-name-error.patch b/cython-module-name-error.patch deleted file mode 100644 index d3e3926..0000000 --- a/cython-module-name-error.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/sklearn/metrics/cluster/setup.py b/sklearn/metrics/cluster/setup.py -index 910cc82..2707839 100644 ---- a/sklearn/metrics/cluster/setup.py -+++ b/sklearn/metrics/cluster/setup.py -@@ -5,7 +5,7 @@ from numpy.distutils.misc_util import Configuration - - - def configuration(parent_package="", top_path=None): -- config = Configuration("metrics/cluster", parent_package, top_path) -+ config = Configuration("metrics.cluster", parent_package, top_path) - libraries = [] - if os.name == 'posix': - libraries.append('m') diff --git a/python-scikit-learn.spec b/python-scikit-learn.spec index 43c987b..1a3284f 100644 --- a/python-scikit-learn.spec +++ b/python-scikit-learn.spec @@ -10,44 +10,36 @@ simple and efficient, accessible to everybody, and reusable \ in various contexts. Name: python-scikit-learn -Version: 0.19.1 -Release: 8%{?dist} +Version: 0.21.3 +Release: 1%{?dist} Summary: %{sum} -License: BSD +# sklearn/externals/_arff.py is MIT +License: BSD and MIT URL: http://scikit-learn.org/ -Source0: https://pypi.io/packages/source/s/scikit-learn/%{srcname}-%{version}.tar.gz -Source1: system-six.py -Source2: system-joblib.py -Patch0: sklearn-unbundle-joblib.patch -Patch1: blas-name.patch - -# https://patch-diff.githubusercontent.com/raw/scikit-learn/scikit-learn/pull/10343 -Patch2: cython-module-name-error.patch +Source0: %{pypi_source} +# There is a problem detecting openmp +Patch0: scikit-learn-fixopenmp.patch BuildRequires: gcc BuildRequires: gcc-c++ BuildRequires: python3-devel -BuildRequires: atlas-devel -BuildRequires: blas-devel - -# we don't want to provide private python extension libs -%global __provides_exclude_from ^%{python3_sitearch}/.*\\.so$ %description %{common_description} +%global __provides_exclude_from ^(%{python3_sitearch})/.*\\.so$ + %package -n python3-%{srcname} Summary: %{sum} -BuildRequires: python3-nose -BuildRequires: python3-numpy -BuildRequires: python3-scipy -BuildRequires: python3-matplotlib -BuildRequires: python3-joblib -BuildRequires: python3-six >= 1.4.1 +BuildRequires: python3-numpy >= 1.11 +BuildRequires: python3-scipy >= 0.17 +BuildRequires: python3-joblib >= 0.11 BuildRequires: python3-Cython -BuildRequires: python3-pillow -Requires: python3-numpy python3-scipy python3-joblib + +Requires: python3-numpy >= 1.11 +Requires: python3-scipy >= 0.17 +Requires: python3-joblib >= 0.11 %{?python_provide:%python_provide python3-%{srcname}} %{?python_provide:%python_provide python3-sklearn} @@ -58,42 +50,23 @@ Requires: python3-numpy python3-scipy python3-joblib %prep %autosetup -n %{srcname}-%{version} -p1 -# there is check for this file that will prevent cythonizing the files -rm PKG-INFO - -# Code to load system six and joblib at runtime -mkdir sklearn/externals/bundled -touch sklearn/externals/bundled/__init__.py -mv sklearn/externals/six.py sklearn/externals/bundled -mv sklearn/externals/joblib sklearn/externals/bundled -mv sklearn/externals/test_externals_setup.py sklearn/externals/bundled -cp %{SOURCE1} sklearn/externals/six.py -cp %{SOURCE2} sklearn/externals/joblib.py - -# Remove the source code of the bundled blas library -rm -rf sklearn/src/cblas/* - -#chmod -x examples/decomposition/plot_pca_vs_fa_model_selection.py -#sed -i -e "1d" examples/decomposition/plot_pca_vs_fa_model_selection.py - %build %py3_build %install %py3_install -%check -pushd %{buildroot}/%{python3_sitearch} -# nosetests-%{python3_version} -x sklearn -popd - %files -n python3-%{srcname} -%doc examples/ AUTHORS.rst README.rst +%doc examples/ %license COPYING %{python3_sitearch}/sklearn %{python3_sitearch}/scikit_learn-*.egg-info %changelog +* Thu Aug 01 2019 Sergio Pascual - 0.21.3-1 +- New upstream source (0.21.3) +- Add a patch to fix detection of openmp + * Fri Jul 26 2019 Fedora Release Engineering - 0.19.1-8 - Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild diff --git a/sklearn-unbundle-joblib.patch b/sklearn-unbundle-joblib.patch deleted file mode 100644 index 35083b6..0000000 --- a/sklearn-unbundle-joblib.patch +++ /dev/null @@ -1,11 +0,0 @@ -diff -ur scikit-learn-0.16.0/sklearn/externals/setup.py scikit-learn-0.16.0.joblib/sklearn/externals/setup.py ---- scikit-learn-0.16.0/sklearn/externals/setup.py 2015-04-09 12:33:08.302385298 +0200 -+++ scikit-learn-0.16.0.joblib/sklearn/externals/setup.py 2015-04-09 12:34:03.614850166 +0200 -@@ -4,6 +4,6 @@ - def configuration(parent_package='', top_path=None): - from numpy.distutils.misc_util import Configuration - config = Configuration('externals', parent_package, top_path) -- config.add_subpackage('joblib') -+ config.add_subpackage('bundled/joblib') - - return config diff --git a/sources b/sources index e590a43..1fcfef6 100644 --- a/sources +++ b/sources @@ -1,2 +1 @@ -SHA512 (scikit-learn-0.18.1.tar.gz) = 7149e683424351a28c19501302ece147cb03d4d12b08822eb2b1898a4978b96803323778fbba628008dd7a7c85daea4e9b550a71ee76851f9a09b2baac18a799 -SHA512 (scikit-learn-0.19.1.tar.gz) = a783067d8b69c8720d00b443d985c32ab366c14e49184ebc4b73d8a8bfd28311461013b17c221a9b64d3a3faa2e46ce1badf77e340f8ae3b2bf08d95ecce0b2c +SHA512 (scikit-learn-0.21.3.tar.gz) = f010f36a36ebe50db1c53ab8452098ea8206075b2e700dd253d4d3470b44b58c49f22c0a6139cec387c473c784c73c038633e333e3e79f84434e0ee6c365dd6a diff --git a/system-joblib.py b/system-joblib.py deleted file mode 100644 index 4c2fe45..0000000 --- a/system-joblib.py +++ /dev/null @@ -1,44 +0,0 @@ -# Licensed under a 3-clause BSD style license - see README.rst -""" -Handle loading joblib package from system or from the bundled copy - -""" -import sys - -_dest_root = 'sklearn.externals.joblib' -# Trying to load alternate packages -sys.modules[_dest_root] = None - -# We have removed everything we already imported -# Importing again -import sys - -_system_package = False -_dest_root = 'sklearn.externals.joblib' - -try: - import joblib - _system_package = True -except ImportError: - _system_package = False - -if _system_package: - # Check version - from distutils.version import StrictVersion - _valid_version = False - if StrictVersion(joblib.__version__) >= StrictVersion('0.8.0'): - _valid_version = True - - if _valid_version: - joblib.system_package = True - joblib.bundled_package = False - sys.modules[_dest_root] = joblib - else: - _system_package = False - -if not _system_package: - import sklearn.externals.bundled.joblib as joblib - joblib.system_package = False - joblib.bundled_package = True - sys.modules[_dest_root] = joblib - diff --git a/system-six.py b/system-six.py deleted file mode 100644 index 4888620..0000000 --- a/system-six.py +++ /dev/null @@ -1,56 +0,0 @@ -# Licensed under a 3-clause BSD style license - see README.rst - -""" -Handle loading six package from system or from the bundled copy -""" - -import imp -from distutils.version import StrictVersion - - -_SIX_MIN_VERSION = StrictVersion('1.5.0') - -# Update this to prevent Astropy from using its bundled copy of six -# (but only if some other version of at least _SIX_MIN_VERSION can -# be provided) -_SIX_SEARCH_PATH = ['six', 'sklearn.externals.bundled.six'] - - -def _find_module(name, path=None): - """ - Alternative to `imp.find_module` that can also search in subpackages. - """ - - parts = name.split('.') - - for part in parts: - if path is not None: - path = [path] - - fh, path, descr = imp.find_module(part, path) - - return fh, path, descr - - -for mod_name in _SIX_SEARCH_PATH: - try: - mod_info = _find_module(mod_name) - except ImportError: - continue - - mod = imp.load_module(__name__, *mod_info) - - try: - if StrictVersion(mod.__version__) >= _SIX_MIN_VERSION: - break - except (AttributeError, ValueError): - # Attribute error if the six module isn't what it should be and doesn't - # have a .__version__; ValueError if the version string exists but is - # somehow bogus/unparseable - continue -else: - raise ImportError( - "sklearn requires the 'six' module of minimum version {0}; " - "normally this is bundled with the astropy package so if you get " - "this warning consult the packager of your sklearn " - "distribution.".format(_SIX_MIN_VERSION)) diff --git a/unbundle-joblib.sh b/unbundle-joblib.sh deleted file mode 100644 index c0e83f5..0000000 --- a/unbundle-joblib.sh +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/sh - -# Changes all these joblib imports to imports of the system package - -for i in $(find -name "*.py"); do - sed -i -e "s/from .externals import joblib/import joblib/" $i - sed -i -e "s/from ..externals import joblib/import joblib/" $i - sed -i -e "s/from ..externals.joblib import/from joblib import/" $i - sed -i -e "s/from .externals.joblib import/from joblib import/" $i - sed -i -e "s/from ..externals.joblib.parallel import/from joblib.parallel import/" $i - sed -i -e "s/from sklearn.externals import joblib/import joblib/" $i - sed -i -e "s/from sklearn.externals.joblib import/from joblib import/" $i - sed -i -e "s/import sklearn.externals.joblib.parallel/import joblib.parallel/" $i -done diff --git a/unbundle-six.sh b/unbundle-six.sh deleted file mode 100644 index c6cd933..0000000 --- a/unbundle-six.sh +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/sh - -# Changes all these six imports to imports of the system package - -cd scikit-learn-0.15.0b1.six - -for i in $(find -name "*.py"); do - sed -i -e "s/from .externals import six/import six/" $i - sed -i -e "s/from ..externals import six/import six/" $i - sed -i -e "s/from ..externals.six import/from six import/" $i - sed -i -e "s/from .externals.six import/from six import/" $i - sed -i -e "s/from sklearn.externals import six/import six/" $i - sed -i -e "s/from sklearn.externals.six/from six/" $i - sed -i -e "s/from ..externals.six.moves import/from six.moves import/" $i - sed -i -e "s/from .externals.six.moves import/from six.moves import/" $i -done - -cd -