[med-svn] [jellyfish] 05/10: Rename python bindings module name
Andreas Tille
tille at debian.org
Tue Aug 30 12:29:11 UTC 2016
This is an automated email from the git hooks/post-receive script.
tille pushed a commit to branch master
in repository jellyfish.
commit db2b6ff13e1576ba06d8aa9d6350ed85c5d2e01d
Author: Andreas Tille <tille at debian.org>
Date: Tue Aug 30 13:46:10 2016 +0200
Rename python bindings module name
---
.../rename-python-module-to-dna_jellyfish.patch | 139 +++++++++++++++++++++
debian/patches/series | 1 +
debian/rules | 2 +-
3 files changed, 141 insertions(+), 1 deletion(-)
diff --git a/debian/patches/rename-python-module-to-dna_jellyfish.patch b/debian/patches/rename-python-module-to-dna_jellyfish.patch
new file mode 100644
index 0000000..bab2d8f
--- /dev/null
+++ b/debian/patches/rename-python-module-to-dna_jellyfish.patch
@@ -0,0 +1,139 @@
+Author: "Diego M. Rodriguez" <diego.plan9 at gmail.com>
+Last-Update: Tue, 22 Mar 2016 23:19:15 +0100
+Bug-Debian: https://bugs.debian.org/819016
+Subject: Rename python bindings module name
+
+--- a/swig/python/setup.py
++++ b/swig/python/setup.py
+@@ -12,13 +12,13 @@ from distutils.core import setup, Extens
+ swig_time = os.path.getmtime('../jellyfish.i')
+ older = True
+ try:
+- older = os.path.getmtime('jellyfish_wrap.cxx') < swig_time or os.path.getmtime('jellyfish.py') < swig_time
++ older = os.path.getmtime('jellyfish_wrap.cxx') < swig_time or os.path.getmtime('dna_jellyfish.py') < swig_time
+ except FileNotFoundError:
+ older = True
+
+ if older:
+- print("Running swig: swig -c++ -python -o jellyfish_wrap.cxx ../jellyfish.i")
+- os.system("swig -c++ -python -o jellyfish_wrap.cxx ../jellyfish.i")
++ print("Running swig: swig -c++ -python -module dna_jellyfish -o jellyfish_wrap.cxx ../jellyfish.i")
++ os.system("swig -c++ -python -module dna_jellyfish -o jellyfish_wrap.cxx ../jellyfish.i")
+
+ jf_include = [re.sub(r'-I', '', x) for x in os.popen("pkg-config --cflags-only-I jellyfish-2.0").read().rstrip().split()]
+ jf_cflags = os.popen("pkg-config --cflags-only-other jellyfish-2.0").read().rstrip().split()
+@@ -28,7 +28,7 @@ jf_libdir = [re.sub(r'-L', '', x) for x
+ jf_ldflags = os.popen("pkg-config --libs-only-other jellyfish-2.0").read().rstrip().split()
+
+
+-jellyfish_module = Extension('_jellyfish',
++jellyfish_module = Extension('_dna_jellyfish',
+ sources = ['jellyfish_wrap.cxx'],
+ include_dirs = jf_include,
+ libraries = jf_libs,
+@@ -36,9 +36,9 @@ jellyfish_module = Extension('_jellyfish
+ extra_compile_args = ["-std=c++0x"] + jf_cflags,
+ extra_link_args = jf_ldflags,
+ language = "c++")
+-setup(name = 'jellyfish',
++setup(name = 'dna_jellyfish',
+ version = '0.0.1',
+ author = 'Guillaume Marcais',
+ description = 'Access to jellyfish k-mer counting',
+ ext_modules = [jellyfish_module],
+- py_modules = ["jellyfish"])
++ py_modules = ["dna_jellyfish"])
+--- a/swig/python/test_hash_counter.py
++++ b/swig/python/test_hash_counter.py
+@@ -1,20 +1,20 @@
+ import unittest
+ import sys
+ import random
+-import jellyfish
++import dna_jellyfish
+
+ class TestHashCounter(unittest.TestCase):
+ def setUp(self):
+- jellyfish.MerDNA.k(100)
+- self.hash = jellyfish.HashCounter(1024, 5)
++ dna_jellyfish.MerDNA.k(100)
++ self.hash = dna_jellyfish.HashCounter(1024, 5)
+
+ def test_info(self):
+- self.assertEqual(100, jellyfish.MerDNA.k())
++ self.assertEqual(100, dna_jellyfish.MerDNA.k())
+ self.assertEqual(1024, self.hash.size())
+ self.assertEqual(5, self.hash.val_len())
+
+ def test_add(self):
+- mer = jellyfish.MerDNA()
++ mer = dna_jellyfish.MerDNA()
+ good = True
+ for i in range(1000):
+ mer.randomize()
+--- a/swig/python/test_mer_file.py
++++ b/swig/python/test_mer_file.py
+@@ -1,4 +1,4 @@
+-import jellyfish
++import dna_jellyfish
+ import unittest
+ import sys
+ import os
+@@ -6,7 +6,7 @@ from collections import Counter
+
+ class TestMerFile(unittest.TestCase):
+ def setUp(self):
+- self.mf = jellyfish.ReadMerFile(os.path.join(data, "swig_python.jf"))
++ self.mf = dna_jellyfish.ReadMerFile(os.path.join(data, "swig_python.jf"))
+
+ def test_histo(self):
+ histo = Counter()
+@@ -46,7 +46,7 @@ class TestMerFile(unittest.TestCase):
+
+ def test_query(self):
+ good = True
+- qf = jellyfish.QueryMerFile(os.path.join(data, "swig_python.jf"))
++ qf = dna_jellyfish.QueryMerFile(os.path.join(data, "swig_python.jf"))
+ for mer, count in self.mf:
+ good = good and count == qf[mer]
+ if not good: break
+--- a/swig/python/test_string_mers.py
++++ b/swig/python/test_string_mers.py
+@@ -1,21 +1,21 @@
+ import unittest
+ import sys
+ import random
+-import jellyfish
++import dna_jellyfish
+
+ class TestStringMers(unittest.TestCase):
+ def setUp(self):
+ bases = "ACGTacgt"
+ self.str = ''.join(random.choice(bases) for _ in range(1000))
+ self.k = random.randint(10, 110)
+- jellyfish.MerDNA.k(self.k)
++ dna_jellyfish.MerDNA.k(self.k)
+
+ def test_all_mers(self):
+ count = 0
+ good = True
+- mers = jellyfish.string_mers(self.str)
++ mers = dna_jellyfish.string_mers(self.str)
+ for m in mers:
+- m2 = jellyfish.MerDNA(self.str[count:count+self.k])
++ m2 = dna_jellyfish.MerDNA(self.str[count:count+self.k])
+ good = good and m == m2
+ count += 1
+ self.assertTrue(good)
+@@ -23,9 +23,9 @@ class TestStringMers(unittest.TestCase):
+
+ def test_canonical_mers(self):
+ good = True
+- mers = jellyfish.string_canonicals(self.str)
++ mers = dna_jellyfish.string_canonicals(self.str)
+ for count, m in enumerate(mers):
+- m2 = jellyfish.MerDNA(self.str[count:count+self.k])
++ m2 = dna_jellyfish.MerDNA(self.str[count:count+self.k])
+ rm2 = m2.get_reverse_complement()
+ good = good and (m == m2 or m == rm2)
+ good = good and (not (m > m2)) and (not (m > rm2))
diff --git a/debian/patches/series b/debian/patches/series
index 108e61a..e56ebcd 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -2,3 +2,4 @@ pkg-config-with-name
drop-rpath
modern-g++
spelling
+rename-python-module-to-dna_jellyfish.patch
diff --git a/debian/rules b/debian/rules
index 790ad39..5d9557e 100755
--- a/debian/rules
+++ b/debian/rules
@@ -55,7 +55,7 @@ override_dh_clean:
rmdir debian/tmp_save_tests ; \
fi
rm -f tests/compat.sh
- rm -f swig/python/jellyfish*
+ rm -f swig/python/jellyfish* swig/python/dna_jellyfish.py
override_dh_auto_build:
mkdir -p debian/tmp_save_tests
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-med/jellyfish.git
More information about the debian-med-commit
mailing list