From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 422FD138350 for ; Fri, 13 Mar 2020 09:56:13 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 48897E0CF3; Fri, 13 Mar 2020 09:56:09 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 11FC7E0CEA for ; Fri, 13 Mar 2020 09:56:09 +0000 (UTC) Received: from oystercatcher.gentoo.org (unknown [IPv6:2a01:4f8:202:4333:225:90ff:fed9:fc84]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 0423D34F051 for ; Fri, 13 Mar 2020 09:56:08 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 0C79118A for ; Fri, 13 Mar 2020 09:56:04 +0000 (UTC) From: "Michał Górny" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Michał Górny" Message-ID: <1584093356.5d19b99d21a76cdffab3e4e8a05455c3d995a798.mgorny@gentoo> Subject: [gentoo-commits] repo/gentoo:master commit in: dev-python/nltk/, dev-python/nltk/files/ X-VCS-Repository: repo/gentoo X-VCS-Files: dev-python/nltk/Manifest dev-python/nltk/files/nltk-3.4.5-corpus-tests.patch dev-python/nltk/nltk-3.4.5.ebuild X-VCS-Directories: dev-python/nltk/files/ dev-python/nltk/ X-VCS-Committer: mgorny X-VCS-Committer-Name: Michał Górny X-VCS-Revision: 5d19b99d21a76cdffab3e4e8a05455c3d995a798 X-VCS-Branch: master Date: Fri, 13 Mar 2020 09:56:04 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: 4a15fa6a-ebe3-494b-8bcf-7bcbd47419dc X-Archives-Hash: cc339d1aec19cb060dc5c3295181a031 commit: 5d19b99d21a76cdffab3e4e8a05455c3d995a798 Author: Michał Górny gentoo org> AuthorDate: Thu Mar 12 18:31:09 2020 +0000 Commit: Michał Górny gentoo org> CommitDate: Fri Mar 13 09:55:56 2020 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=5d19b99d dev-python/nltk: Bump to 3.4.5, enable tests Signed-off-by: Michał Górny gentoo.org> dev-python/nltk/Manifest | 1 + .../nltk/files/nltk-3.4.5-corpus-tests.patch | 37 ++++++++++++++ dev-python/nltk/nltk-3.4.5.ebuild | 58 ++++++++++++++++++++++ 3 files changed, 96 insertions(+) diff --git a/dev-python/nltk/Manifest b/dev-python/nltk/Manifest index 8d078622448..79d80c3f67c 100644 --- a/dev-python/nltk/Manifest +++ b/dev-python/nltk/Manifest @@ -1,2 +1,3 @@ DIST nltk-3.2.3.tar.gz 1166282 BLAKE2B 803dc1a8ec80a17538c2164d5ee0eca201be2307bbf3e08093a55cee93e9a539d8b48ea42c8ad84b540922355bf0b151ae04338d8505378a89173159d7464b76 SHA512 2e5c0899c29f61166b2e161e62e81fd35e045bda979fbfa662bf9ad1349be4aae6aabe4b9de34905e2abbc05b06a096480829fd66638efa35cd5c866f76c62e8 DIST nltk-3.2.5.tar.gz 1188856 BLAKE2B 316e5955d2f90c351673ee9d3f0cc159babbcae08104518db62e796b422dcbf51668001b06b5d5dc399613d4db0ed39ff7dd15ad15d6f6c64e10c73a4d53bc06 SHA512 967b209ce3dde5296dafac16b91bff3894ff1a3f073c76974fd9193912597c82d2d1c50d4419052da77ab66f798f230f725b83f31368a95cacf94d46e45055de +DIST nltk-3.4.5.tar.gz 2821481 BLAKE2B 9d3d6df9a951b4dfbfec335386ba0fb13c484c74a066141ebdfdb541fbec421dd72163d4028e239abd58f95a73e0eef5861574fa9955e4ee11f2c4598c895f59 SHA512 0ca24cd2154e47a8c50fe8e2426fa01c80904ece4100b07cdb4e5835e423e31968e96f0e750e1936f1e758a608596c560aaaee05b844b334f6179249db05f969 diff --git a/dev-python/nltk/files/nltk-3.4.5-corpus-tests.patch b/dev-python/nltk/files/nltk-3.4.5-corpus-tests.patch new file mode 100644 index 00000000000..0284aec02b9 --- /dev/null +++ b/dev-python/nltk/files/nltk-3.4.5-corpus-tests.patch @@ -0,0 +1,37 @@ +diff --git a/nltk/test/corpus.doctest b/nltk/test/corpus.doctest +index 5509fe2fd..0a34c9522 100644 +--- a/nltk/test/corpus.doctest ++++ b/nltk/test/corpus.doctest +@@ -94,7 +94,7 @@ If the reader methods are called without any arguments, they will + typically load all documents in the corpus. + + >>> len(inaugural.words()) +- 145735 ++ 149797 + + If a corpus contains a README file, it can be accessed with a ``readme()`` method: + +@@ -387,8 +387,8 @@ examples illustrate the use of the wordlist corpora: + + >>> stopwords.fileids() # doctest: +ELLIPSIS + ['arabic', 'azerbaijani', 'danish', 'dutch', 'english', 'finnish', 'french', ...] +- >>> stopwords.words('portuguese') # doctest: +ELLIPSIS +- ['de', 'a', 'o', 'que', 'e', 'do', 'da', 'em', 'um', 'para', ...] ++ >>> sorted(stopwords.words('portuguese')) # doctest: +ELLIPSIS ++ ['a', 'ao', 'aos', 'aquela', 'aquelas', 'aquele', 'aqueles', ...] + >>> names.fileids() + ['female.txt', 'male.txt'] + >>> names.words('male.txt') # doctest: +ELLIPSIS +diff --git a/nltk/test/unit/test_wordnet.py b/nltk/test/unit/test_wordnet.py +index a7b26ac91..a1df3d396 100644 +--- a/nltk/test/unit/test_wordnet.py ++++ b/nltk/test/unit/test_wordnet.py +@@ -204,7 +204,7 @@ class WordnNetDemo(unittest.TestCase): + u'preobrat', + u'preobrat_v_mišljenju' + ] +- self.assertEqual(S('about-face.n.02').lemma_names(lang='slv'), expected) ++ self.assertEqual(sorted(S('about-face.n.02').lemma_names(lang='slv')), sorted(expected)) + + def test_iterable_type_for_all_lemma_names(self): + # Duck-test for iterables. diff --git a/dev-python/nltk/nltk-3.4.5.ebuild b/dev-python/nltk/nltk-3.4.5.ebuild new file mode 100644 index 00000000000..b3165b5e4a6 --- /dev/null +++ b/dev-python/nltk/nltk-3.4.5.ebuild @@ -0,0 +1,58 @@ +# Copyright 1999-2020 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +PYTHON_COMPAT=( python3_6 ) +PYTHON_REQ_USE="sqlite,tk?,xml(+)" + +inherit distutils-r1 + +DESCRIPTION="Natural Language Toolkit" +HOMEPAGE="https://www.nltk.org/ https://github.com/nltk/nltk/" +SRC_URI="https://github.com/nltk/nltk/archive/${PV}.tar.gz -> ${P}.tar.gz" + +LICENSE="Apache-2.0" +SLOT="0" +KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~x86-solaris" +IUSE="tk" + +RDEPEND="dev-python/six[${PYTHON_USEDEP}]" +BDEPEND=" + test? ( + dev-python/nltk-data + dev-python/numpy[${PYTHON_USEDEP}] + dev-python/pyparsing[${PYTHON_USEDEP}] + dev-python/twython[${PYTHON_USEDEP}] + sci-libs/scikits_learn[${PYTHON_USEDEP}] + sci-libs/scipy[${PYTHON_USEDEP}] + )" +PDEPEND="dev-python/nltk-data" + +distutils_enable_tests nose + +PATCHES=( + "${FILESDIR}"/nltk-3.4.5-corpus-tests.patch +) + +src_prepare() { + # requires unpackaged pycrfsuite + sed -i -e '/>>>/s@$@ # doctest: +SKIP@' nltk/tag/crf.py || die + # replace fetching from network with duplicate file URL + sed -e 's@https://raw.githubusercontent.com/nltk/nltk/develop/nltk/test/toy.cfg@nltk:grammars/sample_grammars/toy.cfg@' \ + -i nltk/test/data.doctest || die + # requires X and hangs in Xvfb + sed -e 's:test_plot:_&:' \ + -i nltk/test/unit/test_cfd_mutation.py || die + + distutils-r1_src_prepare +} + +src_test() { + cd nltk/test || die + distutils-r1_src_test +} + +python_test() { + "${EPYTHON}" runtests.py -v || die "Tests failed with ${EPYTHON}" +}