[med-svn] [Git][med-team/python-csb][master] 4 commits: Fix Python3.12 string syntax Closes: #1085900
Andreas Tille (@tille)
gitlab at salsa.debian.org
Wed Dec 11 13:14:25 GMT 2024
Andreas Tille pushed to branch master at Debian Med / python-csb
Commits:
54dc7d47 by Andreas Tille at 2024-12-11T13:34:28+01:00
Fix Python3.12 string syntax Closes: #1085900
- - - - -
6129f1b8 by Andreas Tille at 2024-12-11T13:39:44+01:00
Fix another Python3.12 error but numpy related ones are left inside the test suite
- - - - -
b4df8643 by Andreas Tille at 2024-12-11T13:40:44+01:00
Standards-Version: 4.7.0 (routine-update)
- - - - -
0a1187fe by Andreas Tille at 2024-12-11T13:40:47+01:00
Build-Depends: s/dh-python/dh-sequence-python3/ (routine-update)
- - - - -
6 changed files:
- debian/changelog
- debian/control
- + debian/patches/pyhon3.12-syntax.patch
- debian/patches/python-3.12.patch
- debian/patches/series
- debian/rules
Changes:
=====================================
debian/changelog
=====================================
@@ -1,3 +1,12 @@
+python-csb (1.2.5+dfsg-11) UNRELEASED; urgency=medium
+
+ * Fix Python3.12 string syntax
+ Closes: #1085900
+ * Standards-Version: 4.7.0 (routine-update)
+ * Build-Depends: s/dh-python/dh-sequence-python3/ (routine-update)
+
+ -- Andreas Tille <tille at debian.org> Wed, 11 Dec 2024 13:22:23 +0100
+
python-csb (1.2.5+dfsg-10) unstable; urgency=medium
* Team Upload.
=====================================
debian/control
=====================================
@@ -6,13 +6,13 @@ Section: science
Testsuite: autopkgtest-pkg-python
Priority: optional
Build-Depends: debhelper-compat (= 13),
- dh-python,
+ dh-sequence-python3,
python3-all,
python3-numpy,
python3-scipy,
python3-matplotlib,
python3-setuptools
-Standards-Version: 4.6.2
+Standards-Version: 4.7.0
Vcs-Browser: https://salsa.debian.org/med-team/python-csb
Vcs-Git: https://salsa.debian.org/med-team/python-csb.git
Homepage: https://github.com/csb-toolbox/CSB
=====================================
debian/patches/pyhon3.12-syntax.patch
=====================================
@@ -0,0 +1,140 @@
+Description: Fix Python3.12 string syntax
+Bug-Debian: https://bugs.debian.org/1085900
+Author: Andreas Tille <tille at debian.org>
+Last-Update: 2024-06-11
+
+--- a/csb/bio/io/hhpred.py
++++ b/csb/bio/io/hhpred.py
+@@ -207,7 +207,7 @@ class HHProfileParser(object):
+ hmm.family = line[6:].strip()
+
+ elif line.startswith('LENG '):
+- m = re.search('(\d+)\D+(\d+)', line).groups()
++ m = re.search(r'(\d+)\D+(\d+)', line).groups()
+ m = tuple(map(int, m))
+ hmm.length = ProfileLength(m[0], m[1])
+
+@@ -257,7 +257,7 @@ class HHProfileParser(object):
+ if header_token in ['>ss_dssp', '>sa_dssp', '>ss_pred', '>ss_conf', '>Consens']:
+
+ lines = entry.strip().splitlines()
+- seq = re.sub('\s+', '', ''.join(lines[1:]))
++ seq = re.sub(r'\s+', '', ''.join(lines[1:]))
+
+ if header_token == '>ss_dssp':
+ hmm.dssp = structure.SecondaryStructure(seq)
+@@ -304,7 +304,7 @@ class HHProfileParser(object):
+ start_probs = None
+
+ lines = iter(self._profile)
+- pattern = re.compile('^[A-Z\-]\s[0-9]+\s+')
++ pattern = re.compile(r'^[A-Z\-]\s[0-9]+\s+')
+
+ if units == ScoreUnits.LogScales:
+
+--- a/csb/bio/io/procheck.py
++++ b/csb/bio/io/procheck.py
+@@ -28,16 +28,16 @@ class ProcheckParser():
+ f_handler = open(os.path.expanduser(fn))
+ text = f_handler.read()
+
+- input_file_name = re.compile('>>>-----.*?\n.*?\n\s*\|\s*(\S+)\s+')
+- residues = re.compile('(\d+)\s*residues\s\|')
+- ramachandran_plot = re.compile('Ramachandran\splot:\s*(\d+\.\d+)' +
+- '%\s*core\s*(\d+\.\d+)%\s*allow\s*(\d+\.\d+)' +
+- '%\s*gener\s*(\d+\.\d+)%\s*disall')
+- labelled_all = re.compile('Ramachandrans:\s*(\d+)\s*.*?out\sof\s*(\d+)')
+- labelled_chi = re.compile('Chi1-chi2\splots:\s*(\d+)\s*.*?out\sof\s*(\d+)')
+- bad_contacts = re.compile('Bad\scontacts:\s*(\d+)')
+- g_factors = re.compile('G-factors\s*Dihedrals:\s*([0-9-+.]+)' +
+- '\s*Covalent:\s*([0-9-+.]+)\s*Overall:\s*([0-9-+.]+)')
++ input_file_name = re.compile(r'>>>-----.*?\n.*?\n\s*\|\s*(\S+)\s+')
++ residues = re.compile(r'(\d+)\s*residues\s\|')
++ ramachandran_plot = re.compile(r'Ramachandran\splot:\s*(\d+\.\d+)' +
++ r'%\s*core\s*(\d+\.\d+)%\s*allow\s*(\d+\.\d+)' +
++ r'%\s*gener\s*(\d+\.\d+)%\s*disall')
++ labelled_all = re.compile(r'Ramachandrans:\s*(\d+)\s*.*?out\sof\s*(\d+)')
++ labelled_chi = re.compile(r'Chi1-chi2\splots:\s*(\d+)\s*.*?out\sof\s*(\d+)')
++ bad_contacts = re.compile(r'Bad\scontacts:\s*(\d+)')
++ g_factors = re.compile(r'G-factors\s*Dihedrals:\s*([0-9-+.]+)' +
++ r'\s*Covalent:\s*([0-9-+.]+)\s*Overall:\s*([0-9-+.]+)')
+
+ info['input_file'] = input_file_name.search(text).groups()[0]
+ info['#residues'] = int(residues.search(text).groups()[0])
+--- a/csb/bio/io/whatif.py
++++ b/csb/bio/io/whatif.py
+@@ -29,11 +29,11 @@ class WhatCheckParser(object):
+ text = f_handler.read()
+
+ info = dict()
+- re_ramachandran = re.compile('Ramachandran\s*Z-score\s*:\s*([0-9.Ee-]+)')
+- re_1st = re.compile('1st\s*generation\s*packing\s*quality\s*:\s*([0-9.Ee-]+)')
+- re_2nd = re.compile('2nd\s*generation\s*packing\s*quality\s*:\s*([0-9.Ee-]+)')
+- re_backbone = re.compile('Backbone\s*conformation\s*Z-score\s*:\s*([0-9.Ee-]+)')
+- re_rotamer = re.compile('chi-1\S*chi-2\s*rotamer\s*normality\s*:\s*([0-9.Ee-]+)')
++ re_ramachandran = re.compile(r'Ramachandran\s*Z-score\s*:\s*([0-9.Ee-]+)')
++ re_1st = re.compile(r'1st\s*generation\s*packing\s*quality\s*:\s*([0-9.Ee-]+)')
++ re_2nd = re.compile(r'2nd\s*generation\s*packing\s*quality\s*:\s*([0-9.Ee-]+)')
++ re_backbone = re.compile(r'Backbone\s*conformation\s*Z-score\s*:\s*([0-9.Ee-]+)')
++ re_rotamer = re.compile(r'chi-1\S*chi-2\s*rotamer\s*normality\s*:\s*([0-9.Ee-]+)')
+
+
+ info['rama_z_score'] = float(re_ramachandran.search(text).groups(0)[0])
+--- a/csb/bio/io/wwpdb.py
++++ b/csb/bio/io/wwpdb.py
+@@ -1219,7 +1219,7 @@ class RegularStructureParser(AbstractStr
+ @return: resolution
+ @rtype: float or None
+ """
+- res = re.search("(\d+(?:\.\d+)?)\s+ANGSTROM", line)
++ res = re.search(r"(\d+(?:\.\d+)?)\s+ANGSTROM", line)
+
+ if res and res.groups():
+ return float(res.group(1))
+--- a/csb/bio/sequence/__init__.py
++++ b/csb/bio/sequence/__init__.py
+@@ -563,7 +563,7 @@ class Sequence(AbstractSequence):
+
+ def _append(self, string):
+ # this seems to be the fastest method for sanitization and storage
+- self._residues += re.sub('([^\w\-\.])+', '', string)
++ self._residues += re.sub(r'([^\w\-\.])+', '', string)
+
+ def _add(self, char):
+ self._append(char)
+--- a/csb/bio/structure/__init__.py
++++ b/csb/bio/structure/__init__.py
+@@ -2126,9 +2126,9 @@ class SecondaryStructure(csb.core.Collec
+ if not isinstance(string, csb.core.string):
+ raise TypeError(string)
+
+- string = ''.join(re.split('\s+', string))
++ string = ''.join(re.split(r'\s+', string))
+ if conf_string is not None:
+- conf_string = ''.join(re.split('\s+', conf_string))
++ conf_string = ''.join(re.split(r'\s+', conf_string))
+ if not len(string) == len(conf_string):
+ raise ValueError('The confidence string has unexpected length.')
+ motifs = [ ]
+--- a/csb/statistics/__init__.py
++++ b/csb/statistics/__init__.py
+@@ -338,7 +338,7 @@ def running_average(x, w, axis=None):
+ return array([mean(x[i:i + w], axis) for i in range(len(x) - w)])
+
+ def weighted_median(x, w):
+- """
++ r"""
+ Calculates the weighted median, that is the minimizer of
+ argmin {\sum w_i |x_i - \mu|}
+
+--- a/csb/test/cases/io/__init__.py
++++ b/csb/test/cases/io/__init__.py
+@@ -479,7 +479,7 @@ class TestDumpLoad(test.Case):
+ "Although that way may not be" + \
+ "obvious at first" + \
+ "unless you're Dutch.",
+- "([0-9a-zA-Z]([-.\w]*[0-9a-zA-Z])"]
++ r"([0-9a-zA-Z]([-.\w]*[0-9a-zA-Z])"]
+
+ # Completly connnected graph
+
=====================================
debian/patches/python-3.12.patch
=====================================
@@ -4,7 +4,7 @@ Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1056464
Last-Update: 2023-12-09
--- a/csb/build.py
+++ b/csb/build.py
-@@ -55,7 +55,7 @@
+@@ -55,7 +55,7 @@ if __name__ == '__main__':
"""
It is now safe to import any modules
"""
@@ -13,7 +13,7 @@ Last-Update: 2023-12-09
import shutil
import tarfile
-@@ -333,7 +333,7 @@
+@@ -333,7 +333,7 @@ Options:
version = package = None
try:
@@ -24,7 +24,7 @@ Last-Update: 2023-12-09
package = d.dist_files[0][2]
--- a/csb/test/__init__.py
+++ b/csb/test/__init__.py
-@@ -159,7 +159,7 @@
+@@ -159,7 +159,7 @@ decorators you would need in order to wr
"""
import os
import sys
@@ -33,7 +33,7 @@ Last-Update: 2023-12-09
import types
import time
import tempfile
-@@ -564,7 +564,7 @@
+@@ -564,7 +564,7 @@ class AbstractTestBuilder(object):
name = os.path.splitext(os.path.abspath(path))[0]
name = name.replace('.', '-').rstrip('__init__').strip(os.path.sep)
@@ -42,3 +42,14 @@ Last-Update: 2023-12-09
def _recurse(self, obj):
"""
+--- a/csb/test/cases/core/__init__.py
++++ b/csb/test/cases/core/__init__.py
+@@ -18,7 +18,7 @@ class TestDeepCopy(test.Case):
+ copy = utils.deepcopy(obj, recursion=(rec + 1))
+
+ self.assertEqual(obj, copy)
+- self.assertNotEquals(id(obj), id(copy))
++ self.assertNotEqual(id(obj), id(copy))
+
+ @test.unit
+ class TestIterable(test.Case):
=====================================
debian/patches/series
=====================================
@@ -4,3 +4,4 @@ fix_setup.patch
avoid-multiple-namespace.patch
python3-syntax.patch
python-3.12.patch
+pyhon3.12-syntax.patch
=====================================
debian/rules
=====================================
@@ -7,7 +7,7 @@ PY3VERS = $(shell py3versions -r)
export PYBUILD_NAME=csb
%:
- dh $@ --with python3 --buildsystem=pybuild
+ dh $@ --buildsystem=pybuild
override_dh_auto_test:
ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
View it on GitLab: https://salsa.debian.org/med-team/python-csb/-/compare/6d562eb33f0ee2379801504716dd102629f84530...0a1187fe307bd2cb0235aec4b9f8ae5690ea2762
--
View it on GitLab: https://salsa.debian.org/med-team/python-csb/-/compare/6d562eb33f0ee2379801504716dd102629f84530...0a1187fe307bd2cb0235aec4b9f8ae5690ea2762
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/20241211/768d0033/attachment-0001.htm>
More information about the debian-med-commit
mailing list