{% set version = "1.2.1" %} package: name: scikit-learn version: {{ version }} source: url: https://github.com/scikit-learn/scikit-learn/archive/{{ version }}.tar.gz sha256: 50613365b0c118b07ad51902d46b9f7779b8f81ea932a205bd12e64b829eea9a patches: - patches/0001-ignore-errors-when-tearing-down-modules.patch build: number: 0 skip: true # [py<38] script: - rm $PREFIX/include/cblas.h # [not win] - del /f %LIBRARY_INC%\cblas.h # [win] # build the C files in parallel. This helps beat the # time limit consistently on drone.io - {{ PYTHON }} setup.py build_ext -j{{ CPU_COUNT }} - {{ PYTHON }} -m pip install . -vv requirements: build: - python # [build_platform != target_platform] - cross-python_{{ target_platform }} # [build_platform != target_platform] - cython # [build_platform != target_platform] - numpy # [build_platform != target_platform] - scipy # [build_platform != target_platform] - {{ compiler('c') }} - {{ compiler('cxx') }} - llvm-openmp # [osx] host: - python # temporary pin pip to avoid missing oldest-supported-numpy error - pip ==22.0.4 - setuptools <60.0 - cython >=0.29.24 - libcblas - numpy - scipy >=1.3.2 # [not aarch64] - scipy >=1.8 # [aarch64] - joblib >=1.1.1 - threadpoolctl >=2.0.0 - llvm-openmp # [osx] run: - python - {{ pin_compatible('numpy') }} - scipy - joblib >=1.1.1 - threadpoolctl >=2.0.0 {% set tests_to_skip = "_not_a_real_test" %} {% set extra_pytest_args = "" %} # https://github.com/scikit-learn/scikit-learn/issues/20335 {% set tests_to_skip = tests_to_skip + " or test_loadings_converges" %} # Numerically unstable test numerical difference in test {% set tests_to_skip = tests_to_skip + " or test_mlp_regressor_dtypes_casting" %} # [ppc64le] {% if aarch64 and CI %} # due to emulation through QEMU, the tests for aarch run very long; # azure has different linux agents, and the weaker ones can be a factor 2 slower; # skip longest-running ones; all run >60sec (on fast agents) resp. >90sec (on slow agents); # since pytest -k skips on string matches, try to match accurately to avoid skipping more than intended {% set tests_to_skip = tests_to_skip + " or (test_quantile and (test_asymmetric_error or test_quantile_estimates_calibration or test_quantile_sample_weight))" + " or test_kernel_pca_solvers_equivalence or test_n_iter_no_change_inf" + " or test_iterative_imputer_no_missing or (test_voting and test_gridsearch)" + " or test_svc_ovr_tie_breaking or test_check_estimator_clones" + " or (test_estimators and QuantileRegressor)" + " or (test_pairwise and test_cosine_distances)" + " or test_randomized_eigsh_reconst_low_rank" + " or test_randomized_svd_power_iteration_normalizer" + " or test_SGDClassifier_fit_for_all_backends" + " or test_classifier_chain_fit_and_predict_with_linear_svc" + " or (test_gradient_boosting and test_poisson)" + " or (test_ridge and test_lbfgs_solver_consistency)" + " or (test_linear_models_cv_fit_for_all_backends and MultiTask)" + " or test_spectral_embedding_callable_affinity" + " or test_spectral_embedding_precomputed_affinity" %} # this problem is exacerbated for PyPy; skip some more tests there {% if python_impl == "pypy" %} {% set tests_to_skip = tests_to_skip + " or (test_bagging and (test_regression or test_classification))" + " or (check_estimator_sparse_data and (Sequential or TSNE or RFECV))" + " or (test_ensemble_heterogeneous_estimators_behavior and stacking)" + " or test_rfe_cv_groups or test_nan_support" + " or (test_tsne_different_square_distances and exact)" + " or (test_forest and test_class_weights[RandomForestClassifier])" + " or test_kde_sample_weights or test_uniform_grid[exact]" + " or test_parallel_classification or test_sparse_coder_parallel_mmap" + " or test_sparse_precomputed_distance or test_n_iter_no_change_inf" + " or test_randomized_eigsh_compared_to_others" + " or (test_quantile and test_equivariance)" + " or (test_estimators and GaussianProcessClassifier)" + " or (test_stacking_with_sample_weight and StackingClassifier)" + " or (test_mlp and test_partial_fit_classification)" + " or (test_tree and test_min_impurity_decrease)" + " or test_scores_attribute_layout_elasticnet" + " or (test_warning_default_transform_alpha and MiniBatch)" + " or (test_tsne_different_square_distances and barnes_hut)" + " or (test_kernel_approximation and test_polynomial_count_sketch)" + " or test_sample_without_replacement_algorithms" %} {% endif %} {% endif %} test: requires: - pytest >=5.3.1 - cython >=0.29.24 - pytest-xdist - pytest-timeout imports: - sklearn commands: # reduce contention for parallelism (xdist-workers, openblas, openmp) that # actually increases the runtime and can lead to timeouts - export OMP_NUM_THREADS=1 # [aarch64 or ppc64le] - pytest --pyargs sklearn -k "not ({{ tests_to_skip }})" -nauto --timeout=1200 --durations=50 # [not ppc64le] # NOTE: test suite is skipped on ppc due to bugs in QEMU code that cause # CI to fail, even though the tests should run through on native hardware about: home: http://scikit-learn.org/ license: BSD-3-Clause license_file: COPYING summary: A set of python modules for machine learning and data mining dev_url: https://github.com/scikit-learn/scikit-learn extra: recipe-maintainers: - amueller - astaric - jakirkham - ogrisel - ocefpaf - lesteve - jnothman - rth - adrinjalali - glemaitre - jeremiedbb - thomasjpfan - jjerphan