14
0
forked from pool/python-nltk

Accepting request 1218969 from home:dgarcia:branches:devel:languages:python

- Remove nltk_data to avoid redistribution of files with
  non-commercial (boo#1232448):
  > NLTK corpora are provided under the terms given in the README file
  > for each corpus; all are redistributable and available for
  > non-commercial use.
- Remove not needed skip-networked-test.patch

OBS-URL: https://build.opensuse.org/request/show/1218969
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-nltk?expand=0&rev=56
This commit is contained in:
2024-10-29 09:09:02 +00:00
committed by Git OBS Bridge
parent 77ef19b559
commit 65aa842527
4 changed files with 26 additions and 53 deletions

View File

@@ -57,11 +57,12 @@ Source0: https://github.com/nltk/%{modname}/archive/refs/tags/%{version}.
# tar -cJf ../nltk_data.tar.xz nltk_data
# popd
# see https://www.nltk.org/data.html for more details
Source1: nltk_data.tar.xz
########### NOTICE #########
# Do not distribute nltk_data.tar.xz because it's licensed under
# non-commercial, boo#1232448
############################
# Source1: nltk_data.tar.xz
Source99: python-nltk.rpmlintrc
# PATCH-FIX-UPSTREAM skip-networked-test.patch gh#nltk/nltk#2969 mcepl@suse.com
# skip tests requiring network connection
Patch0: skip-networked-test.patch
BuildRequires: %{python_module base >= 3.7}
BuildRequires: %{python_module pip}
BuildRequires: %{python_module setuptools}
@@ -118,7 +119,7 @@ Python modules, data sets and tutorials supporting research and
development in Natural Language Processing.
%prep
%setup -q -a1 -n %{modname}-%{version}
%setup -q -n %{modname}-%{version}
# Fix EOL
sed -i 's/\r/\n/g; s/\n$//' \
@@ -162,15 +163,16 @@ sed -E -i "s|#![[:space:]]*%{_bindir}/env python|#!%{_bindir}/python3|" \
chmod -x %{buildroot}%{$python_sitelib}/nltk/test/dependency.doctest
}
%check
export NLTK_DATA=$(readlink -f ./nltk_data/)
# export PYTEST_ADDOPTS="--doctest-modules"
# Skip tests requiring pickle.load gh#nltk/nltk#3266 (CVE-2024-39705)
skip_tests=" or test_basic or test_increment or test_pad_asterisk or test_pad_dotdot"
skip_tests+=" or test_pos_tag_eng or test_pos_tag_eng_universal or test_pos_tag_rus"
skip_tests+=" or test_pos_tag_rus_universal or test_pos_tag_unknown_lang"
skip_tests+=" or test_sent_tokenize or test_unspecified_lang or test_word_tokenize"
%pytest -k "not (network ${skip_tests})"
# Do not test, there's no ntlk_data, boo#1232448
# %%check
# export NLTK_DATA=$(readlink -f ./nltk_data/)
# # export PYTEST_ADDOPTS="--doctest-modules"
# # Skip tests requiring pickle.load gh#nltk/nltk#3266 (CVE-2024-39705)
# skip_tests=" or test_basic or test_increment or test_pad_asterisk or test_pad_dotdot"
# skip_tests+=" or test_pos_tag_eng or test_pos_tag_eng_universal or test_pos_tag_rus"
# skip_tests+=" or test_pos_tag_rus_universal or test_pos_tag_unknown_lang"
# skip_tests+=" or test_sent_tokenize or test_unspecified_lang or test_word_tokenize"
# %%pytest -k "not (network ${skip_tests})"
%post
%python_install_alternative nltk