SHA256
1
0
forked from pool/python-nltk

- Clean up the SPEC to get rid of rpmlint warnings.

OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-nltk?expand=0&rev=39
This commit is contained in:
Matej Cepl 2022-12-27 17:26:56 +00:00 committed by Git OBS Bridge
parent 75f3e6db1b
commit c684ece13a
3 changed files with 33 additions and 5 deletions

View File

@ -5,6 +5,7 @@ Mon Dec 26 10:41:22 UTC 2022 - Matej Cepl <mcepl@suse.com>
- Fix failing tests (gh#nltk/nltk#2969) by adding patches:
- port-2to3.patch
- skip-networked-test.patch
- Clean up the SPEC to get rid of rpmlint warnings.
-------------------------------------------------------------------
Tue Mar 22 07:48:14 UTC 2022 - Matej Cepl <mcepl@suse.com>

1
python-nltk.rpmlintrc Normal file
View File

@ -0,0 +1 @@
addFilter("E: zero-length /usr/lib/python3\.\d/site-packages/nltk/tbl/api\.py")

View File

@ -30,6 +30,7 @@ Source0: https://files.pythonhosted.org/packages/source/n/nltk/%{pyname}-
# then unzip downloaded zip archive.
# see https://www.nltk.org/data.html for more details
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
@ -93,11 +94,36 @@ development in Natural Language Processing.
# Remove obsolete scripts
rm tools/nltk_term_index.py tools/run_doctests.py nltk_data/corpora/semcor/semcor.py
# sed -i "1,4{/\/usr\/bin\/env/d}" nltk/corpus/reader/knbc.py
# sed -i "1,4{/\/usr\/bin\/env/d}" nltk/test/runtests.py
# sed -i "1,4{/\/usr\/bin\/env/d}" nltk/test/unit/test_tgrep.py
# sed -i "1,4{/\/usr\/bin\/env/d}" nltk/tgrep.py
# sed -i "1,4{/\/usr\/bin\/env/d}" nltk/tokenize/stanford_segmenter.py
# Fix EOL
sed -i 's/\r/\n/g; s/\n$//' \
README.md \
nltk/corpus/reader/knbc.py \
nltk/test/unit/test_tgrep.py \
nltk/tgrep.py \
nltk/tokenize/stanford_segmenter.py \
nltk/corpus/reader/knbc.py \
nltk/test/unit/test_tgrep.py \
nltk/tgrep.py \
nltk/tokenize/stanford_segmenter.py \
nltk/corpus/reader/knbc.py \
nltk/test/unit/test_tgrep.py \
nltk/tgrep.py \
nltk/tokenize/stanford_segmenter.py
# Remove unrequired shebangs
sed -E -i "/#![[:space:]]*\/usr\/bin\/env python/d" \
nltk/tgrep.py \
nltk/tokenize/stanford_segmenter.py \
nltk/test/unit/test_tgrep.py \
nltk/corpus/reader/knbc.py
# Switch shebangs to the standard Python interpreter
sed -E -i "s|#![[:space:]]*%{_bindir}/env python|#!%{_bindir}/python3|" \
setup.py \
tools/global_replace.py \
nltk_data/corpora/pl196x/splitter.py \
tools/find_deprecated.py \
tools/svnmime.py
%build
%python_build