From: "Martin Mokrejs" <mmokrejs@fold.natur.cuni.cz>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/sci:master commit in: sci-biology/biopython/, sci-biology/biopython/files/
Date: Sat, 23 Jul 2016 07:25:22 +0000 (UTC) [thread overview]
Message-ID: <1469258708.f301a33fa321175c12de267ecfbf4d1b727be3f0.mmokrejs@gentoo> (raw)
commit: f301a33fa321175c12de267ecfbf4d1b727be3f0
Author: Martin Mokrejš <mmokrejs <AT> fold <DOT> natur <DOT> cuni <DOT> cz>
AuthorDate: Sat Jul 23 07:25:08 2016 +0000
Commit: Martin Mokrejs <mmokrejs <AT> fold <DOT> natur <DOT> cuni <DOT> 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 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="project">
+ <email>sci-biology@gentoo.org</email>
+ <name>Gentoo Biology Project</name>
+ </maintainer>
+</pkgmetadata>
next reply other threads:[~2016-07-23 7:25 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-07-23 7:25 Martin Mokrejs [this message]
-- strict thread matches above, loose matches on Subject: below --
2014-05-07 10:29 [gentoo-commits] proj/sci:master commit in: sci-biology/biopython/, sci-biology/biopython/files/ Justin Lecher
2014-04-18 18:23 Martin Mokrejs
2014-04-18 18:14 Martin Mokrejs
2014-03-23 16:09 Martin Mokrejs
2014-03-23 16:00 Martin Mokrejs
2013-12-29 0:31 Justin Lecher
2013-09-25 12:29 Martin Mokrejs
2012-03-21 11:20 Justin Lecher
2011-12-07 15:14 Martin Mokrejs
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1469258708.f301a33fa321175c12de267ecfbf4d1b727be3f0.mmokrejs@gentoo \
--to=mmokrejs@fold.natur.cuni.cz \
--cc=gentoo-commits@lists.gentoo.org \
--cc=gentoo-dev@lists.gentoo.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox