[med-svn] [Git][med-team/tombo][master] 12 commits: Use execute_after hooks instead of overriding targets

Ananthu C V (@weepingclown) gitlab at salsa.debian.org
Wed Nov 27 20:34:50 GMT 2024



Ananthu C V pushed to branch master at Debian Med / tombo


Commits:
b8a67483 by Ananthu C V at 2024-11-27T23:26:00+05:30
Use execute_after hooks instead of overriding targets

- - - - -
8f6b8a6e by Ananthu C V at 2024-11-27T23:42:54+05:30
Remove built doc files from debian source tree after they are installed

- - - - -
d51c536c by Ananthu C V at 2024-11-27T23:45:31+05:30
Make sure to clean built files before next build (Closes: #1049071)

- - - - -
126f30cb by Ananthu C V at 2024-11-28T00:43:59+05:30
Add patch to use importlib instead of deprecated pkg_resources (Closes: #1083801)

- - - - -
7562a4ad by Ananthu C V at 2024-11-28T00:57:53+05:30
Correct patch header metadata

- - - - -
a85384ad by Ananthu C V at 2024-11-28T01:12:43+05:30
Add patch to drop distutils usage

- - - - -
31f64c1b by Ananthu C V at 2024-11-28T01:13:55+05:30
Apply wrap-and-sort

- - - - -
a5746160 by Ananthu C V at 2024-11-28T01:23:26+05:30
Fix installed file permissions

- - - - -
644a316d by Ananthu C V at 2024-11-28T01:26:58+05:30
Add patch to remove badges from built docs

- - - - -
38dfaeab by Ananthu C V at 2024-11-28T01:43:16+05:30
Add patch to fix invalid escape sequence syntax warnings (Closes: #1087117)

- - - - -
88ffd4fe by Ananthu C V at 2024-11-28T01:43:27+05:30
Bump Standards-Version to 4.7.0 (no changes needed)

- - - - -
9302d1ff by Ananthu C V at 2024-11-28T01:43:28+05:30
Upload to unstable

- - - - -


13 changed files:

- debian/changelog
- debian/control
- debian/patches/2to3.patch
- + debian/patches/fix-invalid-escape-sequences.patch
- debian/patches/mathjax.patch
- debian/patches/no_future.patch
- debian/patches/no_install_depends_cython.patch
- + debian/patches/remove-badges-in-doc.patch
- + debian/patches/remove-distutils-usage.patch
- + debian/patches/remove-pkg-resources-usage.patch
- debian/patches/series
- debian/rules
- debian/tombo.install


Changes:

=====================================
debian/changelog
=====================================
@@ -1,3 +1,22 @@
+tombo (1.5.1-7) unstable; urgency=medium
+
+  * Team upload
+  * Use execute_after hooks instead of overriding targets
+  * Remove built doc files from debian source tree after they are installed
+  * Make sure to clean built files before next build (Closes: #1049071)
+  * Add patch to use importlib instead of deprecated pkg_resources
+    (Closes: #1083801)
+  * Correct patch header metadata
+  * Add patch to drop distutils usage
+  * Apply wrap-and-sort
+  * Fix installed file permissions
+  * Add patch to remove badges from built docs
+  * Add patch to fix invalid escape sequence syntax warnings
+    (Closes: #1087117)
+  * Bump Standards-Version to 4.7.0 (no changes needed)
+
+ -- Ananthu C V <weepingclown at disroot.org>  Thu, 28 Nov 2024 01:40:55 +0530
+
 tombo (1.5.1-6) unstable; urgency=medium
 
   * No runtime dependency from cython


=====================================
debian/control
=====================================
@@ -3,23 +3,23 @@ Maintainer: Debian Med Packaging Team <debian-med-packaging at lists.alioth.debian.
 Uploaders: Andreas Tille <tille at debian.org>
 Section: science
 Priority: optional
-Build-Depends: debhelper-compat (= 13),
+Build-Depends: cython3,
+               debhelper-compat (= 13),
                dh-python,
-               python3-all-dev,
-               python3-setuptools,
-               cython3,
-               sphinx-doc,
-               python3-sphinx,
-               python3-sphinx-rtd-theme,
-               python3-sphinx-argparse,
                libjs-mathjax,
+               python3-all-dev,
                python3-h5py <!nocheck>,
                python3-mappy <!nocheck>,
+               python3-nose2 <!nocheck>,
                python3-numpy <!nocheck>,
                python3-scipy <!nocheck>,
+               python3-setuptools,
+               python3-sphinx,
+               python3-sphinx-argparse,
+               python3-sphinx-rtd-theme,
                python3-tqdm <!nocheck>,
-               python3-nose2 <!nocheck>
-Standards-Version: 4.6.2
+               sphinx-doc
+Standards-Version: 4.7.0
 Vcs-Browser: https://salsa.debian.org/med-team/tombo
 Vcs-Git: https://salsa.debian.org/med-team/tombo.git
 Homepage: https://github.com/nanoporetech/tombo
@@ -27,16 +27,16 @@ Rules-Requires-Root: no
 
 Package: tombo
 Architecture: any
-Depends: ${shlibs:Depends},
-         ${misc:Depends},
-         ${python3:Depends},
-         python3-h5py,
+Depends: python3-h5py,
          python3-mappy,
          python3-numpy,
+         python3-packaging,
          python3-scipy,
-         python3-tqdm
-Recommends: python3-pyfaidx,
-            python3-rpy2
+         python3-tqdm,
+         ${misc:Depends},
+         ${python3:Depends},
+         ${shlibs:Depends}
+Recommends: python3-pyfaidx, python3-rpy2
 Description: identification of modified nucleotides from raw nanopore sequencing data
  Tombo is a suite of tools primarily for the identification of modified
  nucleotides from nanopore sequencing data. Tombo also provides tools for
@@ -45,9 +45,7 @@ Description: identification of modified nucleotides from raw nanopore sequencing
 Package: tombo-doc
 Architecture: all
 Section: doc
-Depends: ${sphinxdoc:Depends},
-         ${misc:Depends},
-         libjs-mathjax
+Depends: libjs-mathjax, ${misc:Depends}, ${sphinxdoc:Depends}
 Multi-Arch: foreign
 Description: identification of modified nucleotides from raw nanopore sequencing data (doc)
  Tombo is a suite of tools primarily for the identification of modified


=====================================
debian/patches/2to3.patch
=====================================
@@ -1,5 +1,5 @@
 Author: Andreas Tille <tille at debian.org>
-Last-Update: Mon, 15 Jun 2020 11:13:59 +0200
+Last-Update: 2020-06-15
 Description: 2to3 patch
 
 --- a/scripts/dump_per_read_statistics.py


=====================================
debian/patches/fix-invalid-escape-sequences.patch
=====================================
@@ -0,0 +1,24 @@
+Description: use raw strings to fix invalid escape sequences
+Author: Ananthu C V <weepingclown at debian.org>
+Last-Update: 2024-11-28
+--- a/tombo/_preprocess.py
++++ b/tombo/_preprocess.py
+@@ -155,3 +155,3 @@
+                 if (re.match('@', fastq_rec[0]) is None or
+-                    re.match('\+', fastq_rec[2]) is None):
++                    re.match(r'\+', fastq_rec[2]) is None):
+                     # TODO maybe send this as a warning code to avoid poorly
+--- a/tombo/_event_resquiggle.py
++++ b/tombo/_event_resquiggle.py
+@@ -67,3 +67,3 @@
+     'cigar', 'rNext', 'pNext', 'tLen', 'seq', 'qual')
+-CIGAR_PAT = re.compile('(\d+)([MIDNSHP=X])')
++CIGAR_PAT = re.compile(r'(\d+)([MIDNSHP=X])')
+ GAP_PAT = re.compile('-+')
+--- a/tombo/_plot_commands.py
++++ b/tombo/_plot_commands.py
+@@ -2252,3 +2252,3 @@
+             'R and rpy2 are installed from the same channel with ' +
+-            '`conda list | grep "r-base\|rpy2"` (last columns should match).')
++            r'`conda list | grep "r-base\|rpy2"` (last columns should match).')
+ 


=====================================
debian/patches/mathjax.patch
=====================================
@@ -1,5 +1,5 @@
 Author: Andreas Tille <tille at debian.org>
-Last-Update: Mon, 15 Jun 2020 11:13:59 +0200
+Last-Update: 2020-06-15
 Description: Use Debian packaged MathJax
 
 --- a/docs/conf.py


=====================================
debian/patches/no_future.patch
=====================================
@@ -1,5 +1,5 @@
 Author: Andreas Tille <tille at debian.org>
-Last-Update: Mon, 15 Jun 2020 11:13:59 +0200
+Last-Update: 2020-06-15
 Description: Do not require future since we are using Python3 anyway
 
 --- a/setup.py


=====================================
debian/patches/no_install_depends_cython.patch
=====================================
@@ -1,7 +1,7 @@
 Description: No runtime dependency from cython
 Bug-Debian: https://bugs.debian.org/1058010
 Author: Andreas Tille <tille at debian.org>
-Last-Update: Mon, 11 Dec 2023 10:10:25 +0100
+Last-Update: 2023-12-11
 
 --- a/setup.py
 +++ b/setup.py


=====================================
debian/patches/remove-badges-in-doc.patch
=====================================
@@ -0,0 +1,17 @@
+Description: Remove badges using third party links from built docs
+Author: Ananthu C V <weepingclown at debian.org>
+Forwarded: not-needed
+Last-Update: 2024-11-28
+--- a/docs/index.rst
++++ b/docs/index.rst
+@@ -12,10 +12,2 @@
+ 
+-|bioconda_badge| |pypi_badge|
+-
+-.. |bioconda_badge| image:: https://img.shields.io/badge/install%20with-bioconda-brightgreen.svg?style=flat-square
+-    :target: http://bioconda.github.io/recipes/ont-tombo/README.html
+-
+-.. |pypi_badge| image:: https://badge.fury.io/py/ont-tombo.svg
+-    :target: https://badge.fury.io/py/ont-tombo
+-
+ Basic tombo installation (python 2.7 and 3.4+ support)


=====================================
debian/patches/remove-distutils-usage.patch
=====================================
@@ -0,0 +1,35 @@
+Description: replace deprecated distutils usage with packaging
+Author: Ananthu C V <weepingclown at debian.org>
+Last-Update: 2024-11-28
+--- a/tombo/_event_resquiggle.py
++++ b/tombo/_event_resquiggle.py
+@@ -24,3 +24,3 @@
+ from tempfile import NamedTemporaryFile
+-from distutils.version import LooseVersion
++from packaging.version import parse
+ from collections import defaultdict, namedtuple, Counter
+@@ -882,3 +882,3 @@
+         # get albacore version, or if not specified set to 0.0
+-        albacore_version = LooseVersion(fast5_data[
++        albacore_version = parse(fast5_data[
+             '/Analyses/' + basecall_group].attrs.get('version')
+@@ -909,3 +909,3 @@
+ 
+-    if albacore_version >= LooseVersion("2.0"):
++    if albacore_version >= parse("2.0"):
+         read_start_rel_to_raw = called_dat['start'][0].astype(np.int64)
+@@ -930,3 +930,3 @@
+     # https://community.nanoporetech.com/posts/albacore-zero-length-even
+-    if albacore_version < LooseVersion("1.0"):
++    if albacore_version < parse("1.0"):
+         last_event = called_dat[-1]
+@@ -942,3 +942,3 @@
+         fix_read_start = False
+-    elif albacore_version < LooseVersion("2.0"):
++    elif albacore_version < parse("2.0"):
+         # compute event starts from length slot as start slot is less
+@@ -964,3 +964,3 @@
+         # but raw was intorduced into rna basecalling one minor release later
+-        if rna and albacore_version < LooseVersion("2.1"):
++        if rna and albacore_version < parse("2.1"):
+             kmer_dom_pos = 2


=====================================
debian/patches/remove-pkg-resources-usage.patch
=====================================
@@ -0,0 +1,146 @@
+Description: replace deprecated pkg_resources usage with importlib
+Author: Ananthu C V <weepingclown at debian.org>
+Bug-Debian: https://bugs.debian.org/1083801
+Last-Update: 2024-11-28
+--- a/tombo/_plot_commands.py
++++ b/tombo/_plot_commands.py
+@@ -20,3 +20,3 @@
+ from itertools import repeat, groupby
+-from pkg_resources import resource_string
++from importlib.resources import files
+ 
+@@ -169,3 +169,3 @@
+         'Comparison':r.StrVector(mod_names_for_r)})
+-    r.r(resource_string(__name__, 'R_scripts/plotROC.R').decode())
++    r.r(files(__name__).joinpath('R_scripts/plotROC.R').read_bytes().decode())
+     r.r('pdf("' + pdf_fn + '", height=4, width=6)')
+@@ -237,3 +237,3 @@
+         'Comparison':r.StrVector(mod_names_for_r)})
+-    r.r(resource_string(__name__, 'R_scripts/plotROC.R').decode())
++    r.r(files(__name__).joinpath('R_scripts/plotROC.R').read_bytes().decode())
+     r.r('pdf("' + pdf_fn + '", height=4, width=6)')
+@@ -342,3 +342,3 @@
+     if VERBOSE: th.status_message('Plotting.')
+-    r.r(resource_string(__name__, 'R_scripts/plotROCPerRead.R').decode())
++    r.r(files(__name__).joinpath('R_scripts/plotROCPerRead.R').read_bytes().decode())
+     r.r('pdf("' + pdf_fn + '", height=4, width=6)')
+@@ -437,3 +437,3 @@
+         'Comparison':r.StrVector(mod_names_for_r)})
+-    r.r(resource_string(__name__, 'R_scripts/plotROCPerRead.R').decode())
++    r.r(files(__name__).joinpath('R_scripts/plotROCPerRead.R').read_bytes().decode())
+     r.r('pdf("' + pdf_fn + '", height=4, width=6)')
+@@ -548,3 +548,3 @@
+     if VERBOSE: th.status_message('Plotting.')
+-    r.r(resource_string(__name__, 'R_scripts/plotKmerDist.R').decode())
++    r.r(files(__name__).joinpath('R_scripts/plotKmerDist.R').read_bytes().decode())
+     if not dont_plot: r.r('pdf("' + pdf_fn + '", height=7, width=10)')
+@@ -629,3 +629,3 @@
+     if VERBOSE: th.status_message('Plotting.')
+-    r.r(resource_string(__name__, 'R_scripts/plotSingleRead.R').decode())
++    r.r(files(__name__).joinpath('R_scripts/plotSingleRead.R').read_bytes().decode())
+     r.r('png("' + png_fn + '", width=3000, height=1400)')
+@@ -1141,3 +1141,3 @@
+     if VERBOSE: th.status_message('Plotting.')
+-    r.r(resource_string(__name__, 'R_scripts/plotReadCorr.R').decode())
++    r.r(files(__name__).joinpath('R_scripts/plotReadCorr.R').read_bytes().decode())
+     r.r('pdf("' + pdf_fn + '", height=7, width=11)')
+@@ -1240,3 +1240,3 @@
+     if VERBOSE: th.status_message('Plotting.')
+-    r.r(resource_string(__name__, 'R_scripts/plotMultiReadCorr.R').decode())
++    r.r(files(__name__).joinpath('R_scripts/plotMultiReadCorr.R').read_bytes().decode())
+     r.r('pdf("' + pdf_fn + '", height=5, width=11)')
+@@ -1353,3 +1353,3 @@
+     if VERBOSE: th.status_message('Plotting.')
+-    r.r(resource_string(__name__, 'R_scripts/plotSingleRun.R').decode())
++    r.r(files(__name__).joinpath('R_scripts/plotSingleRun.R').read_bytes().decode())
+     r.r('pdf("' + pdf_fn + '", height=5, width=11)')
+@@ -1411,3 +1411,3 @@
+     if VERBOSE: th.status_message('Plotting.')
+-    r.r(resource_string(__name__, 'R_scripts/plotGroupComp.R').decode())
++    r.r(files(__name__).joinpath('R_scripts/plotGroupComp.R').read_bytes().decode())
+     r.r('pdf("' + pdf_fn + '", height=5, width=11)')
+@@ -1579,3 +1579,3 @@
+     if VERBOSE: th.status_message('Plotting.')
+-    r.r(resource_string(__name__, 'R_scripts/plotMotifStats.R').decode())
++    r.r(files(__name__).joinpath('R_scripts/plotMotifStats.R').read_bytes().decode())
+     r.r('pdf("' + pdf_fn + '", height=5, width=8)')
+@@ -1613,3 +1613,3 @@
+     if VERBOSE: th.status_message('Plotting.')
+-    r.r(resource_string(__name__, 'R_scripts/plotModelComp.R').decode())
++    r.r(files(__name__).joinpath('R_scripts/plotModelComp.R').read_bytes().decode())
+     r.r('pdf("' + pdf_fn + '", height=5, width=11)')
+@@ -1645,3 +1645,3 @@
+     if VERBOSE: th.status_message('Plotting.')
+-    r.r(resource_string(__name__, 'R_scripts/plotPerReadStats.R').decode())
++    r.r(files(__name__).joinpath('R_scripts/plotPerReadStats.R').read_bytes().decode())
+     r.r('pdf("' + pdf_fn + '", height=5, width=11)')
+@@ -2219,3 +2219,3 @@
+     if VERBOSE: th.status_message('Plotting (and saving data).')
+-    r.r(resource_string(__name__, 'R_scripts/plotSigMDS.R').decode())
++    r.r(files(__name__).joinpath('R_scripts/plotSigMDS.R').read_bytes().decode())
+     r.r('pdf("' + pdf_fn + '", height=7, width=7)')
+--- a/tombo/resquiggle.py
++++ b/tombo/resquiggle.py
+@@ -37,3 +37,3 @@
+ from collections import defaultdict
+-from pkg_resources import resource_string
++from importlib.resources import files
+ 
+@@ -199,3 +199,3 @@
+ 
+-    r.r(resource_string(__name__, 'R_scripts/debugDP.R').decode())
++    r.r(files(__name__).joinpath('R_scripts/debugDP.R').read_bytes().decode())
+     r.globalenv[str('plotDP')](dpDat, tbDat)
+@@ -247,3 +247,3 @@
+ 
+-    r.r(resource_string(__name__, 'R_scripts/debugRawDP.R').decode())
++    r.r(files(__name__).joinpath('R_scripts/debugRawDP.R').read_bytes().decode())
+     r.globalenv[str('plotRawDP')](zDat, fwdDat, tbDat, sigDat)
+@@ -302,3 +302,3 @@
+ 
+-    r.r(resource_string(__name__, 'R_scripts/debugFit.R').decode())
++    r.r(files(__name__).joinpath('R_scripts/debugFit.R').read_bytes().decode())
+     r.globalenv[str('plotFit')](fitDat, bandwidth)
+--- a/tombo/tombo_stats.py
++++ b/tombo/tombo_stats.py
+@@ -10,3 +10,3 @@
+ import random
+-import pkg_resources
++
+ 
+@@ -31,2 +31,3 @@
+ from itertools import repeat, product, count, combinations
++from importlib.resources import files
+ 
+@@ -723,4 +724,3 @@
+         # get full filename path with setuptools
+-        self.ref_fn = th.resolve_path(pkg_resources.resource_filename(
+-            'tombo', 'tombo_models/' + std_ref_fn))
++        self.ref_fn = th.resolve_path(files('tombo')/'tombo_models'/std_ref_fn)
+ 
+@@ -740,4 +740,3 @@
+         # get full filename path with setuptools
+-        self.ref_fn = th.resolve_path(pkg_resources.resource_filename(
+-            'tombo', 'tombo_models/' + std_ref_fn))
++        self.ref_fn = th.resolve_path(files('tombo')/'tombo_models'/std_ref_fn)
+ 
+@@ -797,5 +796,3 @@
+                 self.seq_samp_type = seq_samp_type
+-                self.ref_fn = th.resolve_path(pkg_resources.resource_filename(
+-                    'tombo', 'tombo_models/' + STANDARD_MODELS[
+-                        seq_samp_type.name]))
++                self.ref_fn = th.resolve_path(files('tombo')/'tombo_models'/STANDARD_MODELS[seq_samp_type.name])
+             elif reads_index is not None:
+@@ -1171,4 +1168,3 @@
+         # get full filename path with setuptools
+-        alt_model_fn = pkg_resources.resource_filename(
+-            'tombo', 'tombo_models/' + alt_model_fn)
++        alt_model_fn = (files('tombo')/'tombo_models'/alt_model_fn).as_posix()
+     if alt_model_fn is None or not os.path.isfile(alt_model_fn):
+--- a/setup.py
++++ b/setup.py
+@@ -59,3 +59,3 @@
+     install_requires = ['h5py', 'numpy', 'scipy',
+-                        'setuptools >= 18.0', 'mappy >= 2.10', 'tqdm'],
++                        'mappy >= 2.10', 'tqdm'],
+     extras_require={'full':extras_require},


=====================================
debian/patches/series
=====================================
@@ -3,3 +3,7 @@ no_future.patch
 mathjax.patch
 cython3-fix.patch
 no_install_depends_cython.patch
+remove-pkg-resources-usage.patch
+remove-distutils-usage.patch
+remove-badges-in-doc.patch
+fix-invalid-escape-sequences.patch


=====================================
debian/rules
=====================================
@@ -8,14 +8,19 @@ export DEB_BUILD_MAINT_OPTIONS=hardening=+all
 %:
 	dh $@ --with python3,sphinxdoc --buildsystem=pybuild
 
-override_dh_fixperms:
-	dh_fixperms
-	find debian -name "*.model" -exec chmod -x \{\} \;
+execute_after_dh_auto_clean:
+	rm -f tombo/_c_dynamic_programming.cpp tombo/_c_helper.cpp
 
-override_dh_auto_build:
-	dh_auto_build
+execute_after_dh_fixperms:
+	find debian -name "*.model" -exec chmod -x {} \;
+	find debian -name "shell_tests.sh" -type f -executable -exec chmod -x {} \+
+
+execute_after_dh_auto_build:
 	sphinx-build -N -bhtml docs docs/build
 
-override_dh_python3:
-	dh_python3
+execute_after_dh_install:
+	rm -f docs/tombo.rst
+	rm -rf docs/build
+
+execute_after_dh_python3:
 	dh_numpy3


=====================================
debian/tombo.install
=====================================
@@ -1,2 +1,2 @@
-usr
 scripts		usr/share/tombo
+usr



View it on GitLab: https://salsa.debian.org/med-team/tombo/-/compare/11edc8439b8aa58af7a1b844da52646810d87e44...9302d1ff43a3855d1acb355fc05d893cf78436a5

-- 
View it on GitLab: https://salsa.debian.org/med-team/tombo/-/compare/11edc8439b8aa58af7a1b844da52646810d87e44...9302d1ff43a3855d1acb355fc05d893cf78436a5
You're receiving this email because of your account on salsa.debian.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/debian-med-commit/attachments/20241127/2876749e/attachment-0001.htm>


More information about the debian-med-commit mailing list