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 574C913832E for ; Sat, 23 Jul 2016 07:25:35 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id C299AE09AF; Sat, 23 Jul 2016 07:25:31 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 483D6E09AF for ; Sat, 23 Jul 2016 07:25:30 +0000 (UTC) Received: from oystercatcher.gentoo.org (unknown [IPv6:2a01:4f8:202:4333:225:90ff:fed9:fc84]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id E8346340D77 for ; Sat, 23 Jul 2016 07:25:28 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 699377C9 for ; Sat, 23 Jul 2016 07:25:22 +0000 (UTC) From: "Martin Mokrejs" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Martin Mokrejs" Message-ID: <1469258708.f301a33fa321175c12de267ecfbf4d1b727be3f0.mmokrejs@gentoo> Subject: [gentoo-commits] proj/sci:master commit in: sci-biology/biopython/, sci-biology/biopython/files/ X-VCS-Repository: proj/sci X-VCS-Files: sci-biology/biopython/biopython-1.67-r1.ebuild sci-biology/biopython/files/biopython-1.67-pull-884.patch sci-biology/biopython/metadata.xml X-VCS-Directories: sci-biology/biopython/ sci-biology/biopython/files/ X-VCS-Committer: mmokrejs X-VCS-Committer-Name: Martin Mokrejs X-VCS-Revision: f301a33fa321175c12de267ecfbf4d1b727be3f0 X-VCS-Branch: master Date: Sat, 23 Jul 2016 07:25:22 +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-Archives-Salt: 6e60bfeb-d0b3-4145-abc2-9a0b1fd8c962 X-Archives-Hash: be07a4f85db64b75c0871c2441afa2ba commit: f301a33fa321175c12de267ecfbf4d1b727be3f0 Author: Martin Mokrejš fold natur cuni cz> AuthorDate: Sat Jul 23 07:25:08 2016 +0000 Commit: Martin Mokrejs fold natur cuni cz> CommitDate: Sat Jul 23 07:25:08 2016 +0000 URL: https://gitweb.gentoo.org/proj/sci.git/commit/?id=f301a33f sci-biology/biopython: version bump with one minor upstream patch Package-Manager: portage-2.2.28 sci-biology/biopython/biopython-1.67-r1.ebuild | 60 +++++++++++++++ .../biopython/files/biopython-1.67-pull-884.patch | 87 ++++++++++++++++++++++ sci-biology/biopython/metadata.xml | 8 ++ 3 files changed, 155 insertions(+) diff --git a/sci-biology/biopython/biopython-1.67-r1.ebuild b/sci-biology/biopython/biopython-1.67-r1.ebuild new file mode 100644 index 0000000..197e265 --- /dev/null +++ b/sci-biology/biopython/biopython-1.67-r1.ebuild @@ -0,0 +1,60 @@ +# Copyright 1999-2016 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Id$ + +EAPI=5 + +PYTHON_COMPAT=( python2_7 python3_{3,4,5} pypy ) + +inherit distutils-r1 eutils + +DESCRIPTION="Python modules for computational molecular biology" +HOMEPAGE="http://www.biopython.org/ https://pypi.python.org/pypi/biopython/" +SRC_URI="http://www.biopython.org/DIST/${P}.tar.gz" + +LICENSE="HPND" +SLOT="0" +KEYWORDS="~amd64 ~ppc ~x86 ~amd64-linux ~x86-linux" +IUSE="" + +RDEPEND=" + dev-python/matplotlib[$(python_gen_usedep 'python*')] + dev-python/networkx[$(python_gen_usedep 'python*')] + dev-python/numpy[$(python_gen_usedep 'python*')] + dev-python/rdflib[$(python_gen_usedep 'python*')] + dev-python/pygraphviz[$(python_gen_usedep 'python2*')] + dev-python/reportlab[$(python_gen_usedep 'python*')] + media-gfx/pydot[$(python_gen_usedep 'python2*')] + " +DEPEND="${RDEPEND} + sys-devel/flex" + +DOCS=( CONTRIB DEPRECATED NEWS README Doc/. ) + +src_prepare(){ + epatch "${FILESDIR}"/biopython-1.67-pull-884.patch +} + +python_test() { + distutils_install_for_testing + cp -r "${S}"/{Doc,Tests} "${TEST_DIR}"/lib/ || die + cd "${TEST_DIR}"/lib/Tests || die + rm ./test_BioSQL_psycopg2.py ./test_BioSQL_MySQLdb.py ./test_BioSQL_mysql_connector.py || die + ${PYTHON} run_tests.py --offline --verbose || die +} + +python_install_all() { + distutils-r1_python_install_all + + dodir /usr/share/${PN} + cp -r --preserve=mode Scripts Tests "${ED}"/usr/share/${PN} || die +} + +pkg_postinst() { + elog "For database support you need to install:" + optfeature "MySQL" dev-python/mysql-python + optfeature "PostGreSQL" dev-python/psycopg + echo + elog "Some applications need extra packages:" + optfeature "EMBOSS (The European Molecular Biology Open Software Suite)" sci-biology/emboss +} diff --git a/sci-biology/biopython/files/biopython-1.67-pull-884.patch b/sci-biology/biopython/files/biopython-1.67-pull-884.patch new file mode 100644 index 0000000..f2a2537 --- /dev/null +++ b/sci-biology/biopython/files/biopython-1.67-pull-884.patch @@ -0,0 +1,87 @@ +--- Bio/SeqRecord.py.old 2016-06-08 15:27:00.000000000 +0200 ++++ Bio/SeqRecord.py 2016-07-22 17:48:19.620712535 +0200 +@@ -292,19 +292,28 @@ + >>> sub_record.letter_annotations = {} + >>> sub_record.letter_annotations + {} ++ ++ Note that if replacing the record's sequence with a sequence of a ++ different length you must first clear the letter_annotations dict. + """) + + def _set_seq(self, value): + # TODO - Add a deprecation warning that the seq should be write only? + if self._per_letter_annotations: +- # TODO - Make this a warning? Silently empty the dictionary? +- raise ValueError("You must empty the letter annotations first!") +- self._seq = value +- try: +- self._per_letter_annotations = _RestrictedDict(length=len(self.seq)) +- except AttributeError: +- # e.g. seq is None +- self._per_letter_annotations = _RestrictedDict(length=0) ++ if len(self) != len(value): ++ # TODO - Make this a warning? Silently empty the dictionary? ++ raise ValueError("You must empty the letter annotations first!") ++ else: ++ # Leave the existing per letter annotations unchanged: ++ self._seq = value ++ else: ++ self._seq = value ++ # Reset the (empty) letter annotations dict with new length: ++ try: ++ self._per_letter_annotations = _RestrictedDict(length=len(self.seq)) ++ except AttributeError: ++ # e.g. seq is None ++ self._per_letter_annotations = _RestrictedDict(length=0) + + seq = property(fget=lambda self: self._seq, + fset=_set_seq, +@@ -427,10 +436,17 @@ + if self.seq is None: + raise ValueError("If the sequence is None, we cannot slice it.") + parent_length = len(self) +- answer = self.__class__(self.seq[index], +- id=self.id, +- name=self.name, +- description=self.description) ++ from BioSQL.BioSeq import DBSeqRecord ++ if isinstance(self, DBSeqRecord): ++ answer = SeqRecord(self.seq[index], ++ id=self.id, ++ name=self.name, ++ description=self.description) ++ else: ++ answer = self.__class__(self.seq[index], ++ id=self.id, ++ name=self.name, ++ description=self.description) + # TODO - The description may no longer apply. + # It would be safer to change it to something + # generic like "edited" or the default value. +--- Tests/test_SeqRecord.py.old 2016-06-08 15:27:00.000000000 +0200 ++++ Tests/test_SeqRecord.py 2016-07-22 17:48:45.401428898 +0200 +@@ -72,6 +72,23 @@ + except (TypeError, ValueError) as e: + pass + ++ def test_replacing_seq(self): ++ """Replacing .seq if .letter_annotation present.""" ++ rec = SeqRecord(Seq("ACGT", generic_dna), ++ id="Test", name="Test", description="Test", ++ letter_annotations={"example": [1, 2, 3, 4]}) ++ try: ++ rec.seq = Seq("ACGTACGT", generic_dna) ++ self.fail("Changing .seq length with letter_annotations present should fail!") ++ except ValueError as e: ++ self.assertEqual(str(e), "You must empty the letter annotations first!") ++ # Check we can replace IF the length is the same ++ self.assertEqual(str(rec.seq), "ACGT") ++ self.assertEqual(rec.letter_annotations, {"example": [1, 2, 3, 4]}) ++ rec.seq = Seq("NNNN" , generic_dna) ++ self.assertEqual(str(rec.seq), "NNNN") ++ self.assertEqual(rec.letter_annotations, {"example": [1, 2, 3, 4]}) ++ + def test_valid_id(self): + with self.assertRaises(TypeError): + SeqRecord(Seq("ACGT", generic_dna), id=dict()) diff --git a/sci-biology/biopython/metadata.xml b/sci-biology/biopython/metadata.xml new file mode 100644 index 0000000..959160f --- /dev/null +++ b/sci-biology/biopython/metadata.xml @@ -0,0 +1,8 @@ + + + + + sci-biology@gentoo.org + Gentoo Biology Project + +