diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index dec1f2a0..ab1b4fc2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -9,7 +9,7 @@ jobs: strategy: matrix: os: ["ubuntu-latest", "macos-latest", "windows-latest"] - python-version: ["3.8", "3.9", "3.10", "3.11"] + python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] defaults: run: shell: bash -l {0} diff --git a/pysb/bng.py b/pysb/bng.py index ba3b4925..2cf116a2 100644 --- a/pysb/bng.py +++ b/pysb/bng.py @@ -850,7 +850,7 @@ def _parse_reaction(model, line, reaction_cache): rule_list = rule_list.split(',') # BNG lists all rules that generate a rxn # Support new (BNG 2.2.6-stable or greater) and old BNG naming convention # for reverse rules - rule_name, is_reverse = zip(*[re.subn('^_reverse_|\(reverse\)$', '', r) + rule_name, is_reverse = zip(*[re.subn(r'^_reverse_|\(reverse\)$', '', r) for r in rule_list]) is_reverse = tuple(bool(i) for i in is_reverse) r_names = ['__s%d' % r for r in reactants] diff --git a/pysb/export/stochkit.py b/pysb/export/stochkit.py index 7f4f2f73..1cf1fd42 100644 --- a/pysb/export/stochkit.py +++ b/pysb/export/stochkit.py @@ -225,7 +225,7 @@ def export(self, initials=None, param_values=None): # Reactions reacs = etree.Element('ReactionsList') - pattern = re.compile("(__s\d+)\*\*(\d+)") + pattern = re.compile(r"(__s\d+)\*\*(\d+)") for rxn_id, rxn in enumerate(self.model.reactions): rxn_name = 'Rxn%d' % rxn_id rxn_desc = 'Rules: %s' % str(rxn["rule"]) @@ -325,6 +325,6 @@ def export(self, initials=None, param_values=None): doc = etree.tostring(document) xmldoc = xml.dom.minidom.parseString(doc) uglyXml = xmldoc.toprettyxml(indent=' ') - text_re = re.compile(">\n\s+([^<>\s].*?)\n\s+\g<1>\n\s+([^<>\s].*?)\n\s+\g<1>> A(), kf) - assert_raises_regexp( + assert_raises_regex( BngInterfaceError, 'Molecule created in reaction rule: Component\(s\) a missing from molecule A\(\)', generate_equations, diff --git a/pysb/tests/test_importers.py b/pysb/tests/test_importers.py index 8a8da6bf..e5f5b5c3 100644 --- a/pysb/tests/test_importers.py +++ b/pysb/tests/test_importers.py @@ -4,7 +4,7 @@ from pysb.importers.bngl import model_from_bngl, BnglImportError from pysb.importers.sbml import model_from_sbml, model_from_biomodels import numpy -from nose.tools import assert_raises_regexp, raises +from nose.tools import assert_raises_regex, raises import warnings import mock import tempfile @@ -203,7 +203,7 @@ def test_bngl_import_expected_errors(): for filename, errmsg in expected_errors.items(): full_filename = _bngl_location(filename) - yield (assert_raises_regexp, + yield (assert_raises_regex, BnglImportError, errmsg, bngl_import_compare_simulations,