File python-gensim.spec of Package python-gensim

#
# spec file for package python-gensim
#
# Copyright (c) 2026 SUSE LLC and contributors
#
# 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.

# Please submit bugfixes or comments via https://bugs.opensuse.org/
#


%{?sle15_python_module_pythons}
%define pyname gensim
Name:           python-%{pyname}
Version:        4.4.0
Release:        0
Summary:        Python framework for fast Vector Space Modelling
License:        LGPL-2.1-only
URL:            https://pypi.org/project/%{pyname}
Source:         https://github.com/piskvorky/%{pyname}/archive/refs/tags/%{version}.tar.gz#/%{pyname}-%{version}.tar.gz
BuildRequires:  %{python_module base >= 3.10}
BuildRequires:  %{python_module Cython}
BuildRequires:  %{python_module numpy}
BuildRequires:  %{python_module numpy-devel}
BuildRequires:  %{python_module pip}
BuildRequires:  %{python_module setuptools}
BuildRequires:  %{python_module wheel}
BuildRequires:  c_compiler
BuildRequires:  c++_compiler
BuildRequires:  fdupes
BuildRequires:  python3-devel
BuildRequires:  python-rpm-macros
Requires:       %{python_module numpy}
Requires:       %{python_module scipy}
Requires:       %{python_module smart-open}
%python_subpackages

%description
Gensim is a Python library for topic modelling, document indexing and
similarity retrieval with large corpora. Target audience is the natural
language processing (NLP) and information retrieval (IR) community.

%prep
%autosetup -p1 -n %{pyname}-%{version}
sed -i "s_/usr/bin/env cython_/usr/bin/cython_"  gensim/*.pyx gensim/*/*.pyx
sed -i "s_/usr/bin/env python_/usr/bin/python3_" gensim/*.py gensim/*/*.py

%build
%pyproject_wheel

%install
%pyproject_install
%python_expand %fdupes %{buildroot}%{$python_sitearch}

%check

%files %{python_files}
%doc CHANGELOG.md README.md
%license COPYING
%{python_sitearch}/%{pyname}
%{python_sitearch}/%{pyname}-%{version}.dist-info
%exclude %{python_sitearch}/%{pyname}/*.c
%exclude %{python_sitearch}/%{pyname}/*/*.c
%exclude %{python_sitearch}/%{pyname}/*/*.cpp
%exclude %{python_sitearch}/%{pyname}/*/*.h

%changelog
openSUSE Build Service is sponsored by